protected void imgbtnfrDelete_Click(object sender, ImageClickEventArgs e) { cmdMode = CommandMode.D; objTypeOfUser = new Store.TypeOfUser.BusinessObject.TypeOfUser(); oblTypeOfUser = new Store.TypeOfUser.BusinessLogic.TypeOfUser(); try { ImageButton btndetails = sender as ImageButton; GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer; objTypeOfUser.TypeofUserID = Convert.ToInt32(dgvTypeofUser.DataKeys[gvrow.RowIndex].Value.ToString()); objTypeOfUser.TypeofUserName = ""; objTypeOfUser.CreatedBy = 1; objMessageInfo = oblTypeOfUser.ManageItemMaster(objTypeOfUser, cmdMode); BindTypeOfUser(); updateTypeofUserBdInfo.Update(); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "alert", "alert('" + objMessageInfo.TranMessage + "')", true); } catch (Exception ex) { Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(TypeOfUser).FullName, 1); } finally { objTypeOfUser = null; objMessageInfo = null; oblTypeOfUser = null; } }
void ManageTypeOfUser() { objTypeOfUser = new Store.TypeOfUser.BusinessObject.TypeOfUser(); oblTypeOfUser = new Store.TypeOfUser.BusinessLogic.TypeOfUser(); try { if (cmdMode == Store.Common.CommandMode.M) { objTypeOfUser.TypeofUserID = Convert.ToInt32(txtTypeofUserId.Text); //objTypeOfUser.ModifiedBy = Convert.ToInt32(Session["UserId"]); } else { objTypeOfUser.TypeofUserID = 0; //objTypeOfUser.CreatedBy = Convert.ToInt32(Session["UserId"]); } objTypeOfUser.TypeofUserName = Convert.ToString(txtTypeofUserName.Text); objMessageInfo = oblTypeOfUser.ManageItemMaster(objTypeOfUser, cmdMode); } catch (Exception ex) { Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(TypeOfUser).FullName, 1); } finally { objTypeOfUser = null; //objMessageInfo = null; oblTypeOfUser = null; } }
public Store.TypeOfUser.BusinessObject.TypeOfUser GetAllTypeOfUser(int TypeofUserID, int Flag, string FlagValue) { Store.TypeOfUser.BusinessObject.TypeOfUser objTypeOfUser = null; string SQL = string.Empty; ParameterList paramList = new ParameterList(); DataTableReader dr; try { SQL = "proc_TypeOfUser"; paramList.Add(new SQLParameter("@TypeofUserID", TypeofUserID)); paramList.Add(new SQLParameter("@Flag", Flag)); paramList.Add(new SQLParameter("@FlagValue", Flag)); dr = ExecuteQuery.ExecuteReader(SQL, paramList); while (dr.Read()) { objTypeOfUser = new BusinessObject.TypeOfUser(); if (dr.IsDBNull(dr.GetOrdinal("TypeofUserID")) == false) { objTypeOfUser.TypeofUserID = dr.GetInt32(dr.GetOrdinal("TypeofUserID")); } if ((dr.IsDBNull(dr.GetOrdinal("TypeofUserName")) == false)) { objTypeOfUser.TypeofUserName = dr.GetString(dr.GetOrdinal("TypeofUserName")); } if ((dr.IsDBNull(dr.GetOrdinal("ClientID")) == false)) { objTypeOfUser.ClientID = dr.GetInt32(dr.GetOrdinal("ClientID")); } if ((dr.IsDBNull(dr.GetOrdinal("CreatedOn")) == false)) { objTypeOfUser.CreatedOn = dr.GetDateTime(dr.GetOrdinal("CreatedOn")); } if ((dr.IsDBNull(dr.GetOrdinal("CreatedBy")) == false)) { objTypeOfUser.CreatedBy = dr.GetInt32(dr.GetOrdinal("CreatedBy")); } if ((dr.IsDBNull(dr.GetOrdinal("ModifiedBy")) == false)) { objTypeOfUser.ModifiedBy = dr.GetInt32(dr.GetOrdinal("ModifiedBy")); } if ((dr.IsDBNull(dr.GetOrdinal("ModifiedOn")) == false)) { objTypeOfUser.ModifiedOn = dr.GetDateTime(dr.GetOrdinal("ModifiedOn")); } if ((dr.IsDBNull(dr.GetOrdinal("ReferenceID")) == false)) { objTypeOfUser.ReferenceID = dr.GetInt32(dr.GetOrdinal("ReferenceID"));; } } dr.Close(); } catch (Exception ex) { Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(TypeOfUser).FullName, 1); } return(objTypeOfUser); }
public Store.Common.MessageInfo ManageItemMaster(Store.TypeOfUser.BusinessObject.TypeOfUser objTypeOfUser, CommandMode cmdMode) { try { return(odlTypeOfUser.ManageTypeOfUser(objTypeOfUser, cmdMode)); } catch (Exception ex) { Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(TypeOfUser).FullName, 1); return(null); } }
public Store.Common.MessageInfo ManageTypeOfUser(Store.TypeOfUser.BusinessObject.TypeOfUser objTypeOfUser, CommandMode cmdMode) { string SQL = ""; ParameterList param = new ParameterList(); DataTableReader dr; Store.Common.MessageInfo objMessageInfo = null; try { SQL = "USP_ManageTypeOfUser"; param.Add(new SQLParameter("@TypeofUserID", objTypeOfUser.TypeofUserID)); param.Add(new SQLParameter("@TypeofUserName", objTypeOfUser.TypeofUserName)); if (cmdMode == CommandMode.N) { param.Add(new SQLParameter("@UserId", objTypeOfUser.CreatedBy)); } else { param.Add(new SQLParameter("@UserId", objTypeOfUser.ModifiedBy)); } param.Add(new SQLParameter("@ReferenceID", objTypeOfUser.ReferenceID)); param.Add(new SQLParameter("@CMDMode", cmdMode)); dr = ExecuteQuery.ExecuteReader(SQL, param); if (dr.Read()) { objMessageInfo = new Store.Common.MessageInfo(); objMessageInfo.ErrorCode = Convert.ToInt32(dr["ErrorCode"]); objMessageInfo.ErrorMessage = Convert.ToString(dr["ErrorMessage"]); objMessageInfo.TranID = Convert.ToInt32(dr["TranID"]); objMessageInfo.TranCode = Convert.ToString(dr["TranCode"]); objMessageInfo.TranMessage = Convert.ToString(dr["TranMessage"]); } } catch (Exception ex) { Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(TypeOfUser).FullName, 1); } return(objMessageInfo); }