//insert data into database public Int32 insert(usersClass obj) { try { obj_con.clearParameter(); createParameter(obj, DBTrans.Insert); obj_con.BeginTransaction(); obj_con.ExecuteNoneQuery("sp_users_insert", CommandType.StoredProcedure); obj_con.CommitTransaction(); return(obj.Userid = Convert.ToInt32(obj_con.getValue("@Userid"))); } catch (Exception ex) { obj_con.RollbackTransaction(); throw new Exception("sp_users_insert"); } }
//insert data into database public Int32?insert(ContactUsDataClass obj) { try { obj_con.clearParameter(); createParameter(obj, DBTrans.Insert); obj_con.BeginTransaction(); obj_con.ExecuteNoneQuery("sp_ContactUsData_insert", CommandType.StoredProcedure); obj_con.CommitTransaction(); return(obj.Contactusdataid = Convert.ToInt32(obj_con.getValue("@Contactusdataid"))); } catch (Exception ex) { obj_con.RollbackTransaction(); throw new Exception("sp_ContactUsData_insert:" + ex.Message); } }
//insert data into database public Int32?insert(GeneralSettingsClass obj) { try { obj_con.clearParameter(); createParameter(obj, DBTrans.Insert); obj_con.BeginTransaction(); obj_con.ExecuteNoneQuery("sp_GeneralSettings_insert", CommandType.StoredProcedure); obj_con.CommitTransaction(); return(obj.Generalsettings = Convert.ToInt32(obj_con.getValue("@Generalsettings"))); } catch (Exception ex) { obj_con.RollbackTransaction(); throw new Exception("sp_GeneralSettings_insert:" + ex.Message); } }
public List <Dictionary <string, object> > GetBlockName(string ProjectID) { try { obj_con.clearParameter(); obj_con.addParameter("@ProjectID", ProjectID); return(ConnectionCls.JsonUtils.ConvertDataTableToJsonString(ConvertDatareadertoDataTable(obj_con.ExecuteReader("Sp_mstBlock_GetBlockNamebyProjectID", CommandType.StoredProcedure)))); } catch (Exception ex) { obj_con.RollbackTransaction(); throw new Exception("Sp_mstBlock_GetBlockNamebyProjectID : " + ex.Message); } }
public SecurityClass Checkuserlogin(string UserName, string Password) { try { obj_con.clearParameter(); obj_con.addParameter("@UserName", UserName); obj_con.addParameter("@Password", Password); DataTable dt = ConvertDataReaderToDataTable(obj_con.ExecuteReader("RE_Users_Login", CommandType.StoredProcedure)); return(ConvertToOjbect(dt)); } catch (Exception ex) { obj_con.RollbackTransaction(); throw new Exception("RE_Users_Login : " + ex.Message); } }