//To Get Data From Button Click in Proforma1 public List <ListProforma1Details> GetProforma1Details(int?villageCode, string baseSurveyNumber) { IDataReader dr = null; List <ListProforma1Details> proformaList = new List <ListProforma1Details>(); try { dbManager.Open(); ListProforma1Details obj = null; dbManager.CreateParameters(2); dbManager.AddParameters(0, "VillageCode", GetDBNullOrValue(villageCode), ParameterDirection.Input, DaoConstants.InParamSize); dbManager.AddParameters(1, "BaseSurveyNo", GetDBNullOrValue(baseSurveyNumber), ParameterDirection.Input, DaoConstants.InParamSize); dr = dbManager.ExecuteReader(CommandType.StoredProcedure, "USP_WL_Prof1_GETRSRBaseSurvey_SubDivisions"); while (dr.Read()) { obj = new ListProforma1Details(); //obj.DistrictCode = dr["dist_code"] == DBNull.Value ? default(int) : Convert.ToInt32(dr["dist_code"]); //obj.MandalCode = dr["mand_code"] == DBNull.Value ? default(int) : Convert.ToInt32(dr["mand_code"]); obj.VillageNameTelugu = dr["vill_name"] == DBNull.Value ? string.Empty : dr["vill_name"].ToString(); obj.VillageNameEnglish = dr["Evill_name"] == DBNull.Value ? string.Empty : dr["Evill_name"].ToString(); obj.BaseSurveyNo = dr["base"] == DBNull.Value ? string.Empty : dr["base"].ToString(); obj.SubDivNo = dr["subdivno"] == DBNull.Value ? string.Empty : dr["subdivno"].ToString(); obj.TotalExtent = dr["area"] == DBNull.Value ? string.Empty : dr["subdivno"].ToString(); obj.LandNature = dr["wlnature"] == DBNull.Value ? string.Empty : dr["wlnature"].ToString(); obj.LandClassification = dr["wlclassification"] == DBNull.Value ? string.Empty : dr["wlclassification"].ToString(); obj.PattadarName = dr["wlpattadar"] == DBNull.Value ? string.Empty : dr["wlpattadar"].ToString(); obj.OfficerRemarks = dr["wlremarks"] == DBNull.Value ? string.Empty : dr["wlremarks"].ToString(); proformaList.Add(obj); obj = null; } dr.Close(); return(proformaList); } catch (Exception ex) { if (dr != null) { dr.Close(); } return(null); } finally { if (dr != null) { dr.Close(); } dbManager.Dispose(); dbManager = null; } }
internal void LogError(string errorNameSpace, string eventName, string errorStack, string errorByUser) { IDBManager dbManager = CommonConnection.Connectionstring(); try { dbManager.Open(); dbManager.CreateParameters(4); if (ConfigurationSettings.AppSettings["DataB"] == "SQL") { dbManager.AddParameters(0, "@ErrorNameSpace", errorNameSpace, ParameterDirection.Input); dbManager.AddParameters(1, "@ErrorEvent", eventName, ParameterDirection.Input); dbManager.AddParameters(2, "@ErrorStack", errorStack, ParameterDirection.Input); dbManager.AddParameters(3, "@ErrorByUser", errorByUser, ParameterDirection.Input); dbManager.ExecuteNonQuery(CommandType.StoredProcedure, "SAVE_ERROR_LOG"); } } catch (Exception ex) { throw ex; } finally { dbManager.Dispose(); } }
// fetches object and object items // user has option of passing object itself OR a string with id and type delimited by '|' public object Fetch(object obj) { int id = ((CableBlock)obj).comp_id; // create new object and database connection _cabBlock = new CableBlock(); _user = (User)System.Web.HttpContext.Current.Session[Constant.session.User]; _dbmgr = new DBManager(_user.plantDBStr); _dbmgr.ConnectionString = _user.plantDBStr; try { _dbmgr.Open(); FetchComponent(id, _dbmgr); FetchCableBlock(id, _dbmgr); FetchVertexList(id, _dbmgr); return _cabBlock; } catch (Exception ex) { throw ex; } finally { _dbmgr.Dispose(); } }
internal int SendResetPswdlink(string UserCode, string UserEmail, string EmlTmpl, string token, DateTimeOffset tokenDt) { IDBManager dbManager = CommonConnection.Connectionstring(); int MsgId = 0; DataSet ds = new DataSet(); try { const string dtFormat = "yyyy-MM-dd HH:mm:ss.fffffff zzz"; string dtString2 = tokenDt.ToString(dtFormat, CultureInfo.InvariantCulture); dbManager.Open(); dbManager.CreateParameters(5); dbManager.AddParameters(0, "UserCode", UserCode, ParameterDirection.Input); dbManager.AddParameters(1, "UserEmail", UserEmail, ParameterDirection.Input); dbManager.AddParameters(2, "EmlTmpl", EmlTmpl, ParameterDirection.Input); dbManager.AddParameters(3, "token", token, ParameterDirection.Input); dbManager.AddParameters(4, "tokenDt", dtString2, ParameterDirection.Input); string spCall = Helper.Ins.GetSPCall(dbManager.Parameters, "SendResetPswdlink"); ds = dbManager.ExecuteDataSet(CommandType.StoredProcedure, "SendResetPswdlink"); MsgId = Convert.ToInt16(ds.Tables[0].Rows[0][0]); return(MsgId); } catch (Exception ex) { throw ex; } finally { dbManager.Dispose(); } }
internal string Validate(string param, string Mode) { IDBManager dbManager = CommonConnection.Connectionstring(); string results = ""; DataSet ds = new DataSet(); try { dbManager.Open(); dbManager.CreateParameters(2); dbManager.AddParameters(0, "params", param, ParameterDirection.Input); dbManager.AddParameters(1, "MODE", Mode, ParameterDirection.Input); string spCall = Helper.Ins.GetSPCall(dbManager.Parameters, "Validations"); if (ConfigurationSettings.AppSettings["DataB"] == "SQL") { ds = dbManager.ExecuteDataSet(CommandType.StoredProcedure, "Validations"); results = Convert.ToString(ds.Tables[0].Rows[0][0]); } return(results); } catch (Exception ex) { throw ex; } finally { dbManager.Dispose(); } }
internal int Save_NewApps(int appid, string AppName, string AppURL, string Status, string mode) { IDBManager dbManager = CommonConnection.Connectionstring(); int results = 0; DataSet ds = new DataSet(); try { dbManager.Open(); dbManager.CreateParameters(5); dbManager.AddParameters(0, "AppId", appid, ParameterDirection.Input); dbManager.AddParameters(1, "AppName", AppName, ParameterDirection.Input); dbManager.AddParameters(2, "AppURL", AppURL, ParameterDirection.Input); dbManager.AddParameters(3, "Status", Status, ParameterDirection.Input); dbManager.AddParameters(4, "mode", mode, ParameterDirection.Input); string spCall = Helper.Ins.GetSPCall(dbManager.Parameters, "Save_Apps"); if (ConfigurationSettings.AppSettings["DataB"] == "SQL") { ds = dbManager.ExecuteDataSet(CommandType.StoredProcedure, "Save_Apps"); results = Convert.ToInt16(ds.Tables[0].Rows[0][0]); } return(results); } catch (Exception ex) { throw ex; } finally { dbManager.Dispose(); } }
public object Fetch(object obj) { int id; id = ((FireRoom)obj).rm_id; // initialize _fireroom = new FireRoom(); _user = (User)System.Web.HttpContext.Current.Session[Constant.session.User]; _dbmgr = new DBManager(_user.plantDBStr); _dbmgr.ConnectionString = _user.plantDBStr; try { _dbmgr.Open(); // fetch object information FetchFireRoom(id, _dbmgr); FetchComponentList(id, _dbmgr); FetchCableList(id, _dbmgr); FetchRouteList(id, _dbmgr); } catch (Exception ex) { throw ex; } finally { _dbmgr.Dispose(); } return _fireroom; }
internal int Save_UserPassword(string UserEmail, string userCode, string UsrPwd, string strToken) { IDBManager dbManager = CommonConnection.Connectionstring(); int results = 0; DataSet ds = new DataSet(); try { dbManager.Open(); dbManager.CreateParameters(4); dbManager.AddParameters(0, "UserEmail", UserEmail, ParameterDirection.Input); dbManager.AddParameters(1, "userCode", userCode, ParameterDirection.Input); dbManager.AddParameters(2, "UsrPwd", UsrPwd, ParameterDirection.Input); dbManager.AddParameters(3, "strToken", strToken, ParameterDirection.Input); string spCall = Helper.Ins.GetSPCall(dbManager.Parameters, "Save_userPassword"); if (ConfigurationSettings.AppSettings["DataB"] == "SQL") { ds = dbManager.ExecuteDataSet(CommandType.StoredProcedure, "Save_userPassword"); results = Convert.ToInt16(ds.Tables[0].Rows[0][0]); } return(results); } catch (Exception ex) { throw ex; } finally { dbManager.Dispose(); } }
internal DataSet Fetch_LoginDtl(string UserCode, string Password, ref string sReturnMsg) { IDBManager dbManager = CommonConnection.Connectionstring(); DataSet ds = new DataSet(); try { dbManager.Open(); dbManager.CreateParameters(3); dbManager.AddParameters(0, "LoginUserCode", UserCode, ParameterDirection.Input); dbManager.AddParameters(1, "UserPassword", Password, ParameterDirection.Input); dbManager.AddParameters(2, "@RetMsg", string.Empty, ParameterDirection.Output, 100); string spCall = Helper.Ins.GetSPCall(dbManager.Parameters, "Fetch_LoginDtl"); if (ConfigurationSettings.AppSettings["DataB"] == "SQL") { ds = dbManager.ExecuteDataSet(CommandType.StoredProcedure, "Fetch_LoginDtl"); } if (dbManager.Parameters[2] != null) { sReturnMsg = dbManager.Parameters[2].Value.ToString(); } return(ds); } catch (Exception ex) { throw ex; } finally { dbManager.Dispose(); } }
internal DataSet Fetch_UserInfo(string Mode, string usercode) { IDBManager dbManager = CommonConnection.Connectionstring(); DataSet ds = new DataSet(); try { dbManager.Open(); dbManager.CreateParameters(2); dbManager.AddParameters(0, "Mode", Mode, ParameterDirection.Input); dbManager.AddParameters(1, "UserCode", usercode, ParameterDirection.Input); string spCall = Helper.Ins.GetSPCall(dbManager.Parameters, "Fetch_Users"); if (ConfigurationSettings.AppSettings["DataB"] == "SQL") { ds = dbManager.ExecuteDataSet(CommandType.StoredProcedure, "Fetch_Users"); } return(ds); } catch (Exception ex) { throw ex; } finally { dbManager.Dispose(); } }
public void Dispose() { if (manager != null) { manager.Dispose(); } }
internal DataSet Open_LoginInfo(string UserCode, string Password, string param) { IDBManager dbManager = CommonConnection.Connectionstring(); DataSet ds = new DataSet(); try { dbManager.Open(); dbManager.CreateParameters(3); dbManager.AddParameters(0, "LoginUserCode", UserCode, ParameterDirection.Input); dbManager.AddParameters(1, "UserPassword", Password, ParameterDirection.Input); dbManager.AddParameters(2, "Param", param, ParameterDirection.Input); string spCall = Helper.Ins.GetSPCall(dbManager.Parameters, "Fetch_LoginInfo"); if (ConfigurationSettings.AppSettings["DataB"] == "SQL") { ds = dbManager.ExecuteDataSet(CommandType.StoredProcedure, "Fetch_LoginInfo"); } return(ds); } catch (Exception ex) { throw ex; } finally { dbManager.Dispose(); } }
//public bool Notifications(Masters AR) //{ // bool _val = false; // try // { // dbManager.Open(); // dbManager.BeginTransaction(); // dbManager.CreateParameters(7); // dbManager.AddParameters(0, "Id", AR.Id, ParameterDirection.Input, DaoConstants.InParamSize); // dbManager.AddParameters(1, "NotificationTitle", AR.Notifications, ParameterDirection.Input, DaoConstants.InParamSize); // dbManager.AddParameters(2, "FromDate", AR.FromDate, ParameterDirection.Input, DaoConstants.InParamSize); // dbManager.AddParameters(3, "ToDate", AR.ToDate, ParameterDirection.Input, DaoConstants.InParamSize); // dbManager.AddParameters(4, "CreatedBy", AR.UserName, ParameterDirection.Input, DaoConstants.InParamSize); // dbManager.AddParameters(5, "IpAddress", AR.Ip, ParameterDirection.Input, DaoConstants.InParamSize); // dbManager.AddParameters(6, "Action", "I", ParameterDirection.Input, DaoConstants.InParamSize); // Int32 iResult = Convert.ToInt32(dbManager.ExecuteNonQuery(CommandType.StoredProcedure, "GLI_Notifications")); // if (iResult > 0) // { // dbManager.CommitTransaction(); // _val = true; // } // else // { // dbManager.RollBackTransaction(); // _val = false; // } // } // catch (Exception ex) // { // } // finally // { // dbManager.Dispose(); // dbManager = null; // } // return _val; //} //public bool Arbitration(Masters AR) //{ // bool _val = false; // try // { // dbManager.Open(); // dbManager.BeginTransaction(); // dbManager.CreateParameters(6); // dbManager.AddParameters(0, "Id", AR.Id, ParameterDirection.Input, DaoConstants.InParamSize); // dbManager.AddParameters(1, "ArbitrationTitle", AR.ArbitrationTitle, ParameterDirection.Input, DaoConstants.InParamSize); // dbManager.AddParameters(2, "ArbitrationDescription", AR.ArbitrationDescription, ParameterDirection.Input, DaoConstants.InParamSize); // dbManager.AddParameters(3, "CreatedBy", AR.UserName, ParameterDirection.Input, DaoConstants.InParamSize); // dbManager.AddParameters(4, "IpAddress", AR.Ip, ParameterDirection.Input, DaoConstants.InParamSize); // dbManager.AddParameters(5, "Action", "I", ParameterDirection.Input, DaoConstants.InParamSize); // Int32 iResult = Convert.ToInt32(dbManager.ExecuteNonQuery(CommandType.StoredProcedure, "GLI_GetArbitration")); // if (iResult > 0) // { // dbManager.CommitTransaction(); // _val = true; // } // else // { // dbManager.RollBackTransaction(); // _val = false; // } // } // catch (Exception ex) // { // } // finally // { // dbManager.Dispose(); // dbManager = null; // } // return _val; //} public List <AdminMenu_DTO> GetArbitrations(AdminMenu_DTO M) { IDataReader dr = null; List <AdminMenu_DTO> lstMenus = new List <AdminMenu_DTO>(); try { dbManager.Open(); AdminMenu_DTO obj = null; dbManager.CreateParameters(1); dr = dbManager.ExecuteReader(CommandType.StoredProcedure, "GetModules"); while (dr.Read()) { obj = new AdminMenu_DTO(); obj.MenuId = dr["MenuId"] == DBNull.Value ? default(int) : Convert.ToInt32(dr["MenuId"]); obj.MenuName = dr["MenuName"] == DBNull.Value ? string.Empty : dr["MenuName"].ToString(); obj.MainMenuId = dr["MainMenuId"] == DBNull.Value ? default(int) : Convert.ToInt32(dr["MainMenuId"]); lstMenus.Add(obj); obj = null; } dr.Close(); return(lstMenus); } catch (Exception ex) { if (dr != null) { dr.Close(); } return(null); } finally { if (dr != null) { dr.Close(); } dbManager.Dispose(); dbManager = null; } }
internal string Save_DocUpload(string sDocType, byte[] DocImgThumb, string Param1, string Param2, string Param3, string Param4, string Param5, string sUserCode, string sFileName) { IDBManager dbManager = CommonConnection.Connectionstring(); try { string sReqNo = string.Empty; DataSet ds = new DataSet(); dbManager.Open(); dbManager.CreateParameters(10); if (ConfigurationSettings.AppSettings["DataB"] == "SQL") { dbManager.AddParameters(0, "@DocType", sDocType, ParameterDirection.Input); if (DocImgThumb != null) { dbManager.AddParameters(1, "@DocImg", DocImgThumb, ParameterDirection.Input); } else { dbManager.AddParameters(1, "@DocImg", DBNull.Value, ParameterDirection.Input); } dbManager.AddParameters(2, "@UserCode", sUserCode, ParameterDirection.Input); dbManager.AddParameters(3, "@FileName", sFileName, ParameterDirection.Input); dbManager.AddParameters(4, "@Param1", Param1, ParameterDirection.Input); dbManager.AddParameters(5, "@Param2", Param2, ParameterDirection.Input); dbManager.AddParameters(6, "@Param3", Param3, ParameterDirection.Input); dbManager.AddParameters(7, "@Param4", Param4, ParameterDirection.Input); dbManager.AddParameters(8, "@Param5", Param5, ParameterDirection.Input); dbManager.AddParameters(9, "@ReqNo", string.Empty, ParameterDirection.Output, 50); string spCall = Helper.Ins.GetSPCall(dbManager.Parameters, "DataImport.GTK_Upld"); ds = dbManager.ExecuteDataSet(CommandType.StoredProcedure, "DataImport.GTK_Upld"); } else { } sReqNo = dbManager.Parameters[9].Value.ToString(); return(sReqNo); } catch (Exception ex) { throw ex; //return null; } finally { dbManager.Dispose(); } }
internal DataSet GetFilterConditions() { IDBManager dbManager = CommonConnection.Connectionstring(); try { dbManager.Open(); dbManager.CreateParameters(2); DataSet dsFilterCond = new DataSet(); if (ConfigurationSettings.AppSettings["DataB"] == "SQL") { if (SessionObjects.obj.GlobalPropertiesObject.FteCode != null && SessionObjects.obj.GlobalPropertiesObject.FteCode != "") { dbManager.AddParameters(0, "@FTECODE", SessionObjects.obj.GlobalPropertiesObject.FteCode, ParameterDirection.Input, 10); } else { dbManager.AddParameters(0, "@FTECODE", DBNull.Value, ParameterDirection.Input, 10); } if (SessionObjects.obj.GlobalPropertiesObject.UserCode != null && SessionObjects.obj.GlobalPropertiesObject.UserCode != "") { dbManager.AddParameters(1, "@UserCode", SessionObjects.obj.GlobalPropertiesObject.UserCode, ParameterDirection.Input, 100); } else { dbManager.AddParameters(1, "@UserCode", DBNull.Value, ParameterDirection.Input, 100); } dsFilterCond = dbManager.ExecuteDataSet(CommandType.StoredProcedure, "GetFilterConditions"); } return(dsFilterCond); } catch (Exception ex) { throw ex; } finally { dbManager.Dispose(); } }
//This method will return the converted value by comparing the UOMs from DB. public static double UomCnvVal(string FrUOM, string ToUOM, double FrQty, double ValFct, double WT, string WTUOM) { IDBManager dbManager = CommonConnection.Connectionstring(); try { double sRetVal = default(double); dbManager.Open(); dbManager.CreateParameters(7); DataSet dsVal = new DataSet(); //Asign values to properties UomConversions cls = new UomConversions(FrUOM, ToUOM, FrQty, ValFct, WT, WTUOM); if (ConfigurationSettings.AppSettings["DataB"] == "SQL") { dbManager.AddParameters(0, "@FrUOM", UomConversions.FrUOM, ParameterDirection.Input); dbManager.AddParameters(1, "@ToUOM", UomConversions.ToUOM, ParameterDirection.Input); dbManager.AddParameters(2, "@FrQty", UomConversions.FrQty, ParameterDirection.Input); dbManager.AddParameters(3, "@ValFct", UomConversions.ValFct, ParameterDirection.Input); dbManager.AddParameters(4, "@WT", UomConversions.WT, ParameterDirection.Input); dbManager.AddParameters(5, "@WTUOM", UomConversions.WTUOM, ParameterDirection.Input); dbManager.AddParameters(6, "@CnvQty", 0, ParameterDirection.Output); string spCall = Helper.Ins.GetSPCall(dbManager.Parameters, "ObjUom_Convert"); dsVal = dbManager.ExecuteDataSet(CommandType.StoredProcedure, "ObjUom_Convert"); } if (dbManager.Parameters[6].Value.ToString() != "") { sRetVal = double.Parse(dbManager.Parameters[6].Value.ToString()); } return(sRetVal); } catch (Exception ex) { throw ex; } finally { dbManager.Dispose(); } }
internal int Save_UserInfo(UserList user) { IDBManager dbManager = CommonConnection.Connectionstring(); int results = 0; DataSet ds = new DataSet(); try { dbManager.Open(); dbManager.CreateParameters(8); dbManager.AddParameters(0, "UserFirstName", user.UserFirstName, ParameterDirection.Input); dbManager.AddParameters(1, "UserMidName", user.UserMidName, ParameterDirection.Input); dbManager.AddParameters(2, "UserLastName", user.UserLastName, ParameterDirection.Input); dbManager.AddParameters(3, "Email", user.UserEmail, ParameterDirection.Input); dbManager.AddParameters(4, "UserApps", user.UserApps, ParameterDirection.Input); dbManager.AddParameters(5, "Mode", user.Mode, ParameterDirection.Input); dbManager.AddParameters(6, "userCode", user.userCode, ParameterDirection.Input); dbManager.AddParameters(7, "eParam", user.EParm, ParameterDirection.Input); string spCall = Helper.Ins.GetSPCall(dbManager.Parameters, "Save_Users"); if (ConfigurationSettings.AppSettings["DataB"] == "SQL") { ds = dbManager.ExecuteDataSet(CommandType.StoredProcedure, "Save_Users"); results = Convert.ToInt16(ds.Tables[0].Rows[0][0]); } return(results); } catch (Exception ex) { throw ex; } finally { dbManager.Dispose(); } }
// fetches object and object items // user has option of passing object itself OR a string with id and type delimited by '|' public object Fetch(object obj) { int id; string type; string objtype = obj.GetType().ToString(); if (objtype == "System.String") { string[] strTemp = ((string)obj).Split(new char[] { '|' }); id = Convert.ToInt32(strTemp[0]); type = strTemp[1]; } else { id = ((Component)obj).comp_id; type = "all"; } // create new object and database connection _comp = new Component(); _user = (User)System.Web.HttpContext.Current.Session[Constant.session.User]; _dbmgr = new DBManager(_user.plantDBStr); _dbmgr.ConnectionString = _user.plantDBStr; try { _dbmgr.Open(); // determine type switch (type) { case "ra": FetchRAList(id, _dbmgr); return _comp.ralist; default: FetchComponent(id, _dbmgr); FetchFACompDispList(id, _dbmgr); FetchRAList(id, _dbmgr); return _comp; } } catch (Exception ex) { throw ex; } finally { _dbmgr.Dispose(); } }
private void UpdateDrawing(object obj, IDBManager dbmgr) { RoutelocaDwg item = (RoutelocaDwg)obj; // cast object to proper item type try { dbmgr.Open(); // open database dbmgr.CreateParameters(5); // create required paramaters dbmgr.AddParameters(0, "@nodeloca_id", item.nodeloca_id); dbmgr.AddParameters(1, "@dwg_id", item.dwg_id); dbmgr.AddParameters(2, "@dwg_rev", item.dwg_rev); dbmgr.AddParameters(3, "@dwgtype_id", 4); // "Other" drawing type dbmgr.AddParameters(4, "@col_ref", item.col_ref); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.ROUTELOCADWGS_u"); // execute stored procedure } catch (Exception ex) { throw ex; } finally { dbmgr.Dispose(); } }
// updates recovery action private void UpdateRA(object obj, IDBManager dbmgr) { CompRA item = (CompRA)obj; try { dbmgr.Open(); // open database dbmgr.CreateParameters(6); // create required paramaters dbmgr.BeginTransaction(); dbmgr.AddParameters(0, "@comp_id", item.comp_id); dbmgr.AddParameters(1, "@fa_id", item.fa_id); dbmgr.AddParameters(2, "@ra_disp", item.ra_disp); dbmgr.AddParameters(3, "@bin", item.bin); dbmgr.AddParameters(4, "@ra_type", item.ra_type); dbmgr.AddParameters(5, "@ra_feasible", item.ra_feasible); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.FACOMPRA_u"); // execute stored procedure dbmgr.CommitTransaction(); } catch (Exception ex) { // if there is problem with transaction roll back to original dbmgr.RollbackTransaction(); throw ex; } finally { dbmgr.Dispose(); } }
private void UpdateDocument(object obj, IDBManager dbmgr) { FADoc item = (FADoc)obj; try { dbmgr.Open(); dbmgr.CreateParameters(3); dbmgr.AddParameters(0, "@fa_id", item.fa_id); dbmgr.AddParameters(1, "@doc_id", item.doc_id); dbmgr.AddParameters(2, "@comment", item.comment); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.FADOC_u"); } catch (Exception ex) { throw ex; } finally { dbmgr.Dispose(); } }
public object Fetch(object obj) { int fa_id; int comp_id = 0; string type; // type of object passed string objtype = obj.GetType().ToString(); // get object type if (objtype == "System.String") { string[] strTemp = ((string)obj).Split(new char[] { '|' }); // if the object type is a string then extract the id and type fa_id = Convert.ToInt32(strTemp[0]); type = strTemp[1]; comp_id = Convert.ToInt32(strTemp[2]); } else { fa_id = ((FireArea)obj).fa_id; type = "all"; // object is a cable and get all information } _firearea = new FireArea(); _user = (User)System.Web.HttpContext.Current.Session[Constant.session.User]; _dbmgr = new DBManager(_user.plantDBStr); _dbmgr.ConnectionString = _user.plantDBStr; try { _dbmgr.Open(); switch (type) { //case "facompdisp": // FetchCompDispList(fa_id, _dbmgr); // return _firearea.compdisplist; case "facabdisp": FetchCabDispList(fa_id, comp_id, _dbmgr); break; //return _firearea.cabdisplist; case "facompinfo": FetchCabDispList(fa_id, comp_id, _dbmgr); break; //return _firearea; case "faB3Table": FetchFireArea(fa_id, _dbmgr); FetchVFDRList(fa_id, _dbmgr); FetchPGList(fa_id, _dbmgr); FetchGENdocList(fa_id, _dbmgr); FetchEEdocList(fa_id, _dbmgr); FetchLICdocList(fa_id, _dbmgr); FetchIgnitionList(fa_id, _dbmgr); FetchProtectionList(fa_id, _dbmgr); break; //return _firearea; case "all": FetchFireArea(fa_id, _dbmgr); FetchCompDispList(fa_id, _dbmgr); FetchCascPowerList("SSD", fa_id, _dbmgr); FetchCascIntlkList("SSD", fa_id, _dbmgr); break; //return _firearea; } } catch (Exception ex) { throw ex; } finally { _dbmgr.Dispose(); } return _firearea; }
private void DeleteCabDisp(object obj, IDBManager dbmgr) { FACabDisp item = (FACabDisp)obj; // cast object to proper item type try { dbmgr.Open(); // open database dbmgr.CreateParameters(4); // create required paramaters dbmgr.AddParameters(0, "@fa_id", item.fa_id); dbmgr.AddParameters(1, "@comp_id", item.comp_id); dbmgr.AddParameters(2, "@cable_id", item.cable_id); dbmgr.AddParameters(3, "@disp_id", item.disp_id); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.FACABDISP_d"); // execute stored procedure } catch (Exception ex) { throw ex; } finally { dbmgr.Dispose(); } }
private void DeleteVFDR(object obj, IDBManager dbmgr) { FAVFDR item = (FAVFDR)obj; try { dbmgr.Open(); dbmgr.CreateParameters(2); dbmgr.AddParameters(0, "@fa_id", item.fa_id); dbmgr.AddParameters(1, "@vfdr_id", item.vfdr_id); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.FAVFDR_d"); } catch (Exception ex) { throw ex; } finally { dbmgr.Dispose(); } }
// updates key safety function private void UpdateKSF(object obj, IDBManager dbmgr) { CompKSF item = (CompKSF)obj; try { dbmgr.Open(); // open database dbmgr.CreateParameters(4); // create required paramaters dbmgr.BeginTransaction(); dbmgr.AddParameters(0, "@comp_id", item.comp_id); dbmgr.AddParameters(1, "@ksf_id", item.ksf_id); dbmgr.AddParameters(2, "@mode_id", item.mode_id); dbmgr.AddParameters(3, "@note", item.note); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.COMPKSF_u"); // execute stored procedure dbmgr.CommitTransaction(); } catch (Exception ex) { // if there is problem with transaction roll back to original dbmgr.RollbackTransaction(); throw ex; } finally { dbmgr.Dispose(); } }
public DataSet FetchDataSet(string criteria) { _user = (User)System.Web.HttpContext.Current.Session[Constant.session.User]; DataSet ds = new DataSet(); string qryString; switch (_user.plant) { case "BLN": case "TFAC": qryString = "SELECT * FROM viewROUTELIST_FR ORDER BY NODE"; break; default: qryString = "SELECT * FROM viewROUTELIST ORDER BY NODE"; break; } _user = (User)System.Web.HttpContext.Current.Session[Constant.session.User]; _dbmgr = new DBManager(_user.plantDBStr); _dbmgr.ConnectionString = _user.plantDBStr; try { _dbmgr.Open(); ds = (DataSet)_dbmgr.ExecuteDataSet(CommandType.Text, qryString); } catch (Exception ex) { throw ex; } finally { _dbmgr.Dispose(); } return ds; }
private void DeleteRoute(object obj, IDBManager dbmgr) { Route item = (Route)obj; try { dbmgr.Open(); // open database dbmgr.CreateParameters(2); // create required paramaters dbmgr.AddParameters(0, "@node_id", item.node_id); dbmgr.AddParameters(1, "@error_num", 0, true); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.ROUTELIST_d"); // execute stored procedure } catch (Exception ex) { throw ex; } finally { dbmgr.Dispose(); } }
private void UpdateVFDR(object obj, IDBManager dbmgr) { FAVFDR item = (FAVFDR)obj; try { dbmgr.Open(); dbmgr.CreateParameters(6); dbmgr.AddParameters(0, "@fa_id", item.fa_id); dbmgr.AddParameters(1, "@vfdr_id", item.vfdr_id); dbmgr.AddParameters(2, "@vfdr", item.vfdr); dbmgr.AddParameters(3, "@vfdr_disp", item.vfdr_disp); dbmgr.AddParameters(4, "@status", item.status); dbmgr.AddParameters(5, "@fre_ref", item.fre_ref); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.FAVFDR_u"); } catch (Exception ex) { throw ex; } finally { dbmgr.Dispose(); } }
public object Fetch(object obj) { int id; string type; // type of object passed string objtype = obj.GetType().ToString(); // get object type if (objtype == "System.String") { string[] strTemp = ((string)obj).Split(new char[] { '|' }); // if the object type is a string then extract the id and type id = Convert.ToInt32(strTemp[0]); type = strTemp[1]; } else { id = ((Route)obj).node_id; type = "all"; // object is a cable and get all information } _route = new Route(); // create new instance of object _user = (User)System.Web.HttpContext.Current.Session[Constant.session.User]; _dbmgr = new DBManager(_user.plantDBStr); _dbmgr.ConnectionString = _user.plantDBStr; try { _dbmgr.Open(); switch (type) { case "routeloca": FetchRoutelocaList(id, _dbmgr); return _route.routelocalist; case "routelocadwg": FetchRoutelocaList(id, _dbmgr); FetchDrawingList(_route.routelocalist, _dbmgr); return _route.drawinglist; case "bdendpoint": FetchBDEndpointList(id, _dbmgr); return _route.bdendpointlist; case "cable": FetchCableList(id, _dbmgr); return _route.cablelist; default: FetchRoute(id, _dbmgr); FetchRoutelocaList(id, _dbmgr); FetchBDEndpointList(id, _dbmgr); FetchDrawingList(_route.routelocalist, _dbmgr); FetchCableList(id, _dbmgr); return _route; } } catch (Exception ex) { throw ex; } finally { _dbmgr.Dispose(); } }
private void UpdateRouteloca(object obj, IDBManager dbmgr) { Routeloca item = (Routeloca)obj; // cast object to proper item type try { dbmgr.Open(); // open database dbmgr.CreateParameters(3); // create required paramaters dbmgr.AddParameters(0, "@node_id", item.node_id); switch (_user.locaType) { case Constant.type_FR: dbmgr.AddParameters(1, "@loca_id", item.rm_id); break; default: dbmgr.AddParameters(1, "@loca_id", item.fz_id); break; } dbmgr.AddParameters(2, "@locatype_id", _user.locaType); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.ROUTELOCA_u"); // execute stored procedure } catch (Exception ex) { throw ex; } finally { dbmgr.Dispose(); } }
private void UpdateRoute(object obj, IDBManager dbmgr) { Route item = (Route)obj; System.Data.Common.DbParameter param; try { dbmgr.Open(); dbmgr.BeginTransaction(); // check to see if new object if (item.node_id == 0) { // if id is null then new object dbmgr.CreateParameters(2); dbmgr.AddParameters(0, "@id", 0, true); dbmgr.AddParameters(1, "@node", item.node); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.ROUTELIST_i"); // get item id param = (System.Data.Common.DbParameter)dbmgr.Parameters.GetValue(0); item.node_id = Convert.ToInt32(param.Value); } // otherwise update existing object else { // update ROUTELIST table dbmgr.CreateParameters(2); dbmgr.AddParameters(0, "@node_id", item.node_id); dbmgr.AddParameters(1, "@node", item.node); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.ROUTELIST_u"); } dbmgr.CommitTransaction(); } catch (Exception ex) { // if there is problem with transaction roll back to original dbmgr.RollbackTransaction(); throw ex; } finally { dbmgr.Dispose(); } }
public ArrayList FetchComboList(string initMsg, string param) { string qryString = "SELECT DISTINCT CABLE_ID, CABLE FROM viewFADATA_SSD WHERE FA_ID = @fa_id AND COMP_ID = @comp_id ORDER BY CABLE"; ArrayList list = new ArrayList(); string[] strTemp = ((string)param).Split(new char[] { '|' }); int fa_id = Convert.ToInt32(strTemp[0]); int comp_id = Convert.ToInt32(strTemp[1]); _user = (User)System.Web.HttpContext.Current.Session[Constant.session.User]; _dbmgr = new DBManager(_user.plantDBStr); _dbmgr.ConnectionString = _user.plantDBStr; try { // initialize if (initMsg.Length > 0) list.Add(new ComboBoxItem(initMsg, "0")); _dbmgr.Open(); _dbmgr.CreateParameters(2); _dbmgr.AddParameters(0, "@fa_id", fa_id); _dbmgr.AddParameters(1, "@comp_id", comp_id); _dbmgr.ExecuteReader(CommandType.Text, qryString); while (_dbmgr.DataReader.Read() == true) { if (_dbmgr.DataReader.GetInt32(0) != 0) list.Add(new ComboBoxItem(_dbmgr.DataReader.GetString(1), _dbmgr.DataReader.GetInt32(0).ToString())); ; } } catch (Exception ex) { throw ex; } finally { _dbmgr.Dispose(); } return list; }
private void UpdateDrawing(object obj, IDBManager dbmgr) { Drawing item = (Drawing)obj; System.Data.Common.DbParameter param; try { dbmgr.Open(); dbmgr.BeginTransaction(); // check to see if new object if (item.dwg_id == 0) { // if id is null then new object dbmgr.CreateParameters(3); dbmgr.AddParameters(0, "@id", 0, true); dbmgr.AddParameters(1, "@dwg_ref", item.dwg_ref); dbmgr.AddParameters(2, "@dwg_rev", item.dwg_rev); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.DWGLIST_i"); // get item id param = (System.Data.Common.DbParameter)dbmgr.Parameters.GetValue(0); item.dwg_id = Convert.ToInt32(param.Value); } // otherwise update existing object else { dbmgr.CreateParameters(5); dbmgr.AddParameters(0, "@dwg_id", item.dwg_id); dbmgr.AddParameters(1, "@dwg_ref", item.dwg_ref); dbmgr.AddParameters(2, "@dwg_rev", item.dwg_rev); dbmgr.AddParameters(3, "@dwg_type", item.dwg_type); dbmgr.AddParameters(4, "@dwg_desc", item.dwg_desc); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.DWGLIST_u"); } dbmgr.CommitTransaction(); } catch (Exception ex) { dbmgr.RollbackTransaction(); throw ex; } finally { dbmgr.Dispose(); } }
public DataSet FetchDataSet(string criteria) { DataSet ds = new DataSet(); string qryString = "SELECT * FROM viewFALIST ORDER BY FA"; _user = (User)System.Web.HttpContext.Current.Session[Constant.session.User]; _dbmgr = new DBManager(_user.plantDBStr); _dbmgr.ConnectionString = _user.plantDBStr; try { _dbmgr.Open(); ds = (DataSet)_dbmgr.ExecuteDataSet(CommandType.Text, qryString); } catch (Exception ex) { throw ex; } finally { _dbmgr.Dispose(); } return ds; }
private void DeleteDrawing(object obj, IDBManager dbmgr) { Drawing item = (Drawing)obj; try { dbmgr.Open(); dbmgr.CreateParameters(2); dbmgr.AddParameters(0, "@dwg_id", item.dwg_id); dbmgr.AddParameters(1, "@error_num", 0, true); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.DWGLIST_d"); } catch (Exception ex) { throw ex; } finally { dbmgr.Dispose(); } }
private void DeleteFireArea(object obj, IDBManager dbmgr) { FireArea item = (FireArea)obj; //cast object to proper item type try { dbmgr.Open(); //open database dbmgr.CreateParameters(1); //create required paramaters dbmgr.AddParameters(0, "@fa_id", item.fa_id); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.FALIST_d"); //execute stored procedure } catch (Exception ex) { throw ex; } finally { dbmgr.Dispose(); } }
public object Fetch(object obj) { int id; string type; //type of object passed string objtype = obj.GetType().ToString(); //get object type if (objtype == "System.String") { string[] strTemp = ((string)obj).Split(new char[] { '|' }); //if the object type is a string then extract the id and type id = Convert.ToInt32(strTemp[0]); type = strTemp[1]; } else { id = ((Document)obj).doc_id; type = "all"; //object is document and get all information } _document = new Document(); _user = (User)System.Web.HttpContext.Current.Session[Constant.session.User]; _dbmgr = new DBManager(_user.plantDBStr); _dbmgr.ConnectionString = _user.plantDBStr; try { _dbmgr.Open(); switch (type) { case "firearea": FetchFAList(id, _dbmgr); return _document.falist; default: FetchDocument(id, _dbmgr); FetchFAList(id, _dbmgr); return _document; } } catch (Exception ex) { throw ex; } finally { _dbmgr.Dispose(); } }
private void UpdateCompDisp(object obj, IDBManager dbmgr) { FACompDisp item = (FACompDisp)obj; // cast object to proper item type try { dbmgr.Open(); dbmgr.CreateParameters(5); // create required paramaters dbmgr.AddParameters(0, "@fa_id", item.fa_id); dbmgr.AddParameters(1, "@comp_id", item.comp_id); dbmgr.AddParameters(2, "@old_disp_id", item.old_disp_id); dbmgr.AddParameters(3, "@disp_id", item.disp_id); dbmgr.AddParameters(4, "@status", item.status); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.FACOMPDISP_u"); // execute stored procedure } catch (Exception ex) { throw ex; } finally { dbmgr.Dispose(); } }
private void UpdateFireRoom(object obj, IDBManager dbmgr) { FireRoom item = (FireRoom)obj; System.Data.Common.DbParameter param; try { dbmgr.Open(); dbmgr.BeginTransaction(); // check to see if new object if (item.rm_id == 0) { // if id is null then new object dbmgr.CreateParameters(4); dbmgr.AddParameters(0, "@rm", item.rm); dbmgr.AddParameters(1, "@id", 0, true); dbmgr.AddParameters(2, "@fz_id", item.fz_id); dbmgr.AddParameters(3, "@rm_desc", item.rm_desc); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.FRLIST_i"); // get item id param = (System.Data.Common.DbParameter)dbmgr.Parameters.GetValue(1); item.rm_id = Convert.ToInt32(param.Value); } // otherwise update existing object else { // update FRLIST table dbmgr.CreateParameters(11); dbmgr.AddParameters(0, "@rm_id", item.rm_id); dbmgr.AddParameters(1, "@rm", item.rm); dbmgr.AddParameters(2, "@rm_desc", item.rm_desc); dbmgr.AddParameters(3, "@bldg", item.bldg); dbmgr.AddParameters(4, "@elev", item.elev); dbmgr.AddParameters(5, "@fz_id", item.fz_id); dbmgr.AddParameters(6, "@req", item.req); dbmgr.AddParameters(7, "@supp", item.supp); dbmgr.AddParameters(8, "@det", item.det); dbmgr.AddParameters(9, "@dwg_id", item.dwg_id); dbmgr.AddParameters(10, "@dwg_rev", item.dwg_rev); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.FRLIST_u"); } dbmgr.CommitTransaction(); } catch (Exception ex) { // if there is problem with transaction roll back to original dbmgr.RollbackTransaction(); throw ex; } finally { dbmgr.Dispose(); } }
private void UpdateFireArea(object obj, IDBManager dbmgr) { FireArea item = (FireArea)obj; System.Data.Common.DbParameter param; try { dbmgr.Open(); dbmgr.BeginTransaction(); // check to see if new object if (item.fa_id == 0) { dbmgr.CreateParameters(3); dbmgr.AddParameters(0, "@id", 0, true); dbmgr.AddParameters(1, "@fa", item.fa); dbmgr.AddParameters(2, "@fa_desc", item.fa_desc); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.FALIST_i"); // get item id param = (System.Data.Common.DbParameter)dbmgr.Parameters.GetValue(0); item.fa_id = (int)param.Value; } // otherwise update existing object else { dbmgr.CreateParameters(14); dbmgr.AddParameters(0, "@fa_id", item.fa_id); dbmgr.AddParameters(1, "@fa", item.fa); dbmgr.AddParameters(2, "@fa_desc", item.fa_desc); dbmgr.AddParameters(3, "@bldg", item.bldg); dbmgr.AddParameters(4, "@elev", item.elev); dbmgr.AddParameters(5, "@ssd_path", item.ssd_path); dbmgr.AddParameters(6, "@req", item.req); dbmgr.AddParameters(7, "@supp", item.supp); dbmgr.AddParameters(8, "@det", item.det); dbmgr.AddParameters(9, "@comment", item.comment); dbmgr.AddParameters(10, "@dwg_id", item.dwg_id); dbmgr.AddParameters(11, "@dwg_rev", item.dwg_rev); dbmgr.AddParameters(12, "@risk_summary", item.risk_summary); dbmgr.AddParameters(13, "@reg_basis", item.reg_basis); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.FALIST_u"); // execute the stored procedure //update status UpdateStatus(dbmgr, item, 1, item.prep_by, item.prep_date); UpdateStatus(dbmgr, item, 5, item.chkd_by, item.chkd_date); } dbmgr.CommitTransaction(); } catch (Exception ex) { dbmgr.RollbackTransaction(); throw ex; } finally { dbmgr.Dispose(); } }
private void DeleteFireRoom(object obj, IDBManager dbmgr) { FireRoom item = (FireRoom)obj; try { dbmgr.Open(); // open database dbmgr.BeginTransaction(); dbmgr.CreateParameters(1); // create required paramaters dbmgr.AddParameters(0, "@rm_id", item.rm_id); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.FRLIST_d"); // execute stored procedure dbmgr.CommitTransaction(); } catch (Exception ex) { // if there is problem with transaction roll back to original dbmgr.RollbackTransaction(); throw ex; } finally { dbmgr.Dispose(); } }
private void UpdatePG(object obj, IDBManager dbmgr) { FAPG item = (FAPG)obj; try { dbmgr.Open(); dbmgr.CreateParameters(4); dbmgr.AddParameters(0, "@fa_id", item.fa_id); dbmgr.AddParameters(1, "@pg", item.pg); dbmgr.AddParameters(2, "@method", item.method); dbmgr.AddParameters(3, "@comment", item.comment); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.FAPG_u"); } catch (Exception ex) { throw ex; } finally { dbmgr.Dispose(); } }
private void UpdateBDEndpoint(object obj, IDBManager dbmgr) { RouteBDEndpoint item = (RouteBDEndpoint)obj; // cast object to proper item type try { dbmgr.Open(); // open database dbmgr.CreateParameters(2); // create required paramaters dbmgr.AddParameters(0, "@endpt", item.endpt); dbmgr.AddParameters(1, "@bdendpt", item.bd_endpt); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.BDENDPOINTS_u"); // execute stored procedure } catch (Exception ex) { throw ex; } finally { dbmgr.Dispose(); } }
protected void btnlogin_Click(object sender, EventArgs e) { int iRecordsFetched = 0; int iTempGroupID = 0; m_db = new DBManager(DataProvider.Oracle); if (m_db == null) { Response.Redirect("Error_page.aspx?ERROR=UNABLE_CREATE_DBOBJ"); } ///''''''''''''If user clicked on login button check for username,password and selecttype are filled or not if they are not empty then proceed if (txtuser.Value.Length != 0 & txtpwd.Value.Length != 0) { m_db.ConnectionString = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString; m_db.Open(); if (m_db.Connection == null) { ///''''''' If Failed to Eastablish database Connection Show Error Page to the User // strstacktrace = HttpUtility.UrlEncode(m_db.Exception_str) strstacktrace = ""; Response.Redirect("Error_page.aspx?ERROR=DATABASE_CONNECTION_FAILED&MESSAGE=" + strstacktrace); } ///''''''''''' Form the query to get the login userdetails from tbl_usermaster // strQry = "select tbl_usermaster.userid,tbl_usermaster.usertypeflag,tbl_usermaster.webaccountflag,usersmemberslink.memberid,upper(username) as username,grp.groupid,grp.groupname from tbl_usermaster inner join groupe as grp on tbl_usermaster.groupid=grp.groupid inner join usersmemberslink on tbl_usermaster.userid=usersmemberslink.userid where username='******' and password='******' and tbl_usermaster.activated=1 and tbl_usermaster.webaccountflag=1" //strQry = "select usermaster.userid,usermaster.usertypeflag,usermaster.webaccountflag,upper(username) as username,grp.groupid,grp.groupname from usermaster inner join groupe as grp on usermaster.groupid=grp.groupid where username='******' and password='******' and usermaster.activated=1 and usermaster.webaccountflag=1"; //strQry = "select usermaster.userid,upper(username) as username from usermaster ";// where username='******' and password='******'"; strQry = string.Format("select users.userid,upper(username) as username,groupid from users where username='******' and userpassword='******'", txtuser.Value, txtpwd.Value); objDataset = m_db.ExecuteDataSet(CommandType.Text, strQry); if (objDataset == null) { m_db.Close(); m_db.Dispose(); // strstacktrace = HttpUtility.UrlEncode(m_db.Exception_str) Response.Redirect("Error_page.aspx?ERROR=RECORDSET_FETCH_FAILED&MESSAGE=" + strstacktrace); } ///'''''''''''''' get the no of records that exsist for the framed query iRecordsFetched = int.Parse(objDataset.Tables[0].Rows.Count.ToString()); ///''''''''''''' if no records present give msg to the user alerting him that he is invalid user if (iRecordsFetched == 0) { txtuser.Focus(); } else { ///'''''''''''' if records present get all the userdetails and store them inside a session CUSERDetails objUserDetails = new CUSERDetails(); objUserDetails.iUserID = Convert.ToInt32(objDataset.Tables[0].Rows[0]["userid"].ToString()); objUserDetails.strUserName = objDataset.Tables[0].Rows[0]["username"].ToString(); objUserDetails.iGroupID = Convert.ToInt32(objDataset.Tables[0].Rows[0]["groupid"]); //objUserDetails.strGroupName = objDataset.Tables[0].Rows[0]["groupname"].ToString(); objUserDetails.iMemberID = "1"; //objDataset.Tables(0).Rows(0)("memberid").ToString() //objUserDetails.iRooterFlag = Convert.ToInt32(objDataset.Tables[0].Rows[0]["usertypeflag"]); //objUserDetails.iWebAccountFlag = Convert.ToInt32(objDataset.Tables[0].Rows[0]["webaccountflag"]); //objUserDetails.iUserID = CType(objDataset.Tables(0).Rows(0)("userid").ToString(), Integer) //objUserDetails.strUserName = objDataset.Tables(0).Rows(0)("username").ToString() //objUserDetails.iGroupID = 4 ' CType(objDataset.Tables(0).Rows(0)("groupid"), Integer) //objUserDetails.strGroupName = objDataset.Tables(0).Rows(0)("groupname").ToString() //objUserDetails.iMemberID = 1 'objDataset.Tables(0).Rows(0)("memberid").ToString() //objUserDetails.iRooterFlag = 1 'CType(objDataset.Tables(0).Rows(0)("usertypeflag"), Integer) //objUserDetails.iWebAccountFlag = 1 'CType(objDataset.Tables(0).Rows(0)("webaccountflag"), Integer) Session["sesuUserDetails"] = objUserDetails; objDataset.Dispose(); // Free dataset m_db.Close(); // Free SQL Connection iTempGroupID = objUserDetails.iGroupID; objUserDetails = null; m_db = null; //Response.Redirect("~/frmNewConnection.aspx"); Response.Redirect("SBMUpload.aspx"); } } }
// porcedure update incominginterlock private void UpdateInterlock(object obj, IDBManager dbmgr) { CompIntlk item = (CompIntlk)obj; try { dbmgr.Open(); // open database dbmgr.CreateParameters(9); // create required paramaters dbmgr.BeginTransaction(); dbmgr.AddParameters(0, "@comp_id", item.comp_id); dbmgr.AddParameters(1, "@intlk_id", item.intlk_id); dbmgr.AddParameters(2, "@device", item.device); dbmgr.AddParameters(3, "@contacts", item.contacts); dbmgr.AddParameters(4, "@note", item.note); dbmgr.AddParameters(5, "@ssd_req", item.ssd_req); dbmgr.AddParameters(6, "@pra_req", item.pra_req); dbmgr.AddParameters(7, "@npo_req", item.npo_req); dbmgr.AddParameters(8, "@cfp_req", item.cfp_req); dbmgr.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.COMPINTLKS_u"); // execute stored procedure // save hisotry SaveHistory(item, _oldobj, item.argUser.name, "COMPINTLKS", item.intlk, item.comp, dbmgr, _fieldlist); dbmgr.CommitTransaction(); } catch (Exception ex) { // if there is problem with transaction roll back to original dbmgr.RollbackTransaction(); throw ex; } finally { dbmgr.Dispose(); } }