private static void setDocManVals(Recordset p_ConfigRs, ref OncDocManage.OncDocManage p_docManage) { try { p_ConfigRs.MoveFirst(); for (int i = 0; i < p_ConfigRs.RecordCount; ++i) { switch (p_ConfigRs.Fields[0].Value) { case "ROOT_PATH": p_docManage.SPRootPath = p_ConfigRs.Fields[1].Value.ToString(); break; case "SP_URL": p_docManage.SPSiteURL = p_ConfigRs.Fields[1].Value.ToString(); break; case "JOBWO_REL_PATH": p_docManage.SPRelPath = p_ConfigRs.Fields[1].Value.ToString(); break; } p_ConfigRs.MoveNext(); } p_ConfigRs = null; } catch (Exception ex) { MessageBox.Show("Error: " + ex.Message, "Error: setDocManVals", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
internal static Boolean gGetRedLineFilesfromSp() { Boolean tmpRetVal = false; OncDocManage.OncDocManage spDocMan = new OncDocManage.OncDocManage(); Recordset rsConfigs = null; string sWrName = string.Empty; string sEnvTempPath = string.Empty; try { if (gIsWrJobType(ref sWrName)) { sEnvTempPath = Path.GetTempPath(); rsConfigs = rsDocManageConfigs(); setDocManVals(rsConfigs, ref spDocMan); rsConfigs = null; spDocMan.WrkOrd_Job = sWrName; spDocMan.SPFileType = "Construction Redlines"; spDocMan.SPRelPath = spDocMan.SPRelPath + "/" + sWrName; if (spDocMan.GetFileFromList(sEnvTempPath) == true) { if (bDisplayConstRedLineFile(sEnvTempPath + "\\" + spDocMan.RetFileName) == true) { tmpRetVal = true; } } else { MessageBox.Show("Error: " + spDocMan.RetErrMessage, "Error: gGetRedLineFilesfromSp", MessageBoxButtons.OK, MessageBoxIcon.Error); tmpRetVal = false; } } } catch (Exception ex) { MessageBox.Show("Error: " + ex.Message, "Error: gGetRedLineFilesfromSp", MessageBoxButtons.OK, MessageBoxIcon.Error); tmpRetVal = false; } return(tmpRetVal); }