cheguri saikumar

cheguri saikumar

  • NA
  • 43
  • 5.3k

cannot perform = operation on system.int32

Jul 27 2018 2:42 AM
public void MatchedDocumentsInFileCabinet(string MainFolder, string SubFolder, string FileName, string FilePath)
{
// Checking Main Folder is present in FileCabinet, if present retrieving MainFolderID if not Inserting MainFolderName
if (SelectedFileCabinetID == "")
{
SelectedFileCabinetID = "1";
}
int Mainfoldercount = 0;
DocSortResult getfolderdetails = objFolderManager.GetFolderDetails();
DataTable getFolderNames = new DataTable();
if (getfolderdetails.resultDS != null && getfolderdetails.resultDS.Tables[0].Rows.Count > 0)
{
 
Below line is showing error cannot perform '=' operation on system.int32 and system.string 
 
 
DataRow[] drResult = getfolderdetails.resultDS.Tables[0].Select("FileCabinet_ID = '" + SelectedFileCabinetID + "'" + "and" + " ParentFolderID = '" + "0" + "'" + "and" + " IsDelete = '" + "True" + "'");
if (drResult.Count() != 0)
{
getFolderNames = drResult.CopyToDataTable();
}
if (getFolderNames != null && getFolderNames.Rows.Count > 0)
{
foreach (DataRow dr in getFolderNames.Rows)
{
if (dr["Folder_Name"].ToString().ToUpper() == MainFolder.ToUpper())
{
Mainfoldercount += 1;
MainFolderID = dr["Folder_ID"].ToString();
}
}
}
}
if (Mainfoldercount == 0)
{
DocSortResult objinsertintofolder = objFolderManager.InsertFolderDetails(SelectedFileCabinetID, MainFolder.ToUpper(), "0", "True");
if (objinsertintofolder.resultDS != null && objinsertintofolder.resultDS.Tables[0].Rows.Count > 0)
{
DataRow dr = objinsertintofolder.resultDS.Tables[0].Rows[0];
MainFolderID = dr["FolderId"].ToString();
}
}
m_sMainFolderFile = null;
if (m_sMainFolderFile == null)
{
m_sMainFolderFile = m_sRootFile + "\\" + MainFolder.ToUpper();
if (!System.IO.Directory.Exists(m_sMainFolderFile))
System.IO.Directory.CreateDirectory(m_sMainFolderFile);
}
//End
if (SubFolder != "")
{
// Checking Sub Folder is present in Main Folder of FileCabinet, if present retrieving SubFolderID if not Inserting SubFolderName into MainFolder
int Subfoldercount = 0;
DocSortResult objgetfolderdetails = objFolderManager.GetFolderDetails();
DataTable getSubFolderNames = new DataTable();
if (objgetfolderdetails.resultDS != null && objgetfolderdetails.resultDS.Tables[0].Rows.Count > 0)
{
DataRow[] drResult = objgetfolderdetails.resultDS.Tables[0].Select("ParentFolderID = '" + MainFolderID + "'" + "and" + " ParentFolderID <> '" + 0 + "'" + "and" + " IsDelete = '" + "True" + "'");
if (drResult.Count() != 0)
{
getSubFolderNames = drResult.CopyToDataTable();
}
if (getSubFolderNames != null && getSubFolderNames.Rows.Count > 0)
{
foreach (DataRow dr in getSubFolderNames.Rows)
{
if (dr["Folder_Name"].ToString().ToUpper() == SubFolder.ToUpper())
{
Subfoldercount += 1;
SubFolderID = dr["Folder_ID"].ToString();
}
}
}
}
if (Subfoldercount == 0)
{
DocSortResult objinsertintofolder = objFolderManager.InsertFolderDetails(SelectedFileCabinetID, SubFolder.ToUpper(), MainFolderID, "True");
if (objinsertintofolder.resultDS != null && objinsertintofolder.resultDS.Tables[0].Rows.Count > 0)
{
DataRow dr = objinsertintofolder.resultDS.Tables[0].Rows[0];
SubFolderID = dr["FolderId"].ToString();
}
}
// creating sub folders in FileCabinets path and moving that file into it
m_sSubFolderFile = null;
if (m_sSubFolderFile == null)
{
m_sSubFolderFile = m_sMainFolderFile + "\\" + SubFolder.ToUpper();
if (!System.IO.Directory.Exists(m_sSubFolderFile))
System.IO.Directory.CreateDirectory(m_sSubFolderFile);
}
System.IO.File.Copy(FilePath, m_sSubFolderFile + "\\" + FileName, true);

Answers (5)