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; } }