//private SqlDataAccess objDataAccess; public clsEntDocumentCategory readerForDocCat(int docCatID) { clsEntDocumentCategory objEnt = new clsEntDocumentCategory(); SqlDataReader reader; try { if (objDataAccess.Connection.State == ConnectionState.Closed) { objDataAccess.Connection.Open(); } SqlParameter[] pram = new SqlParameter[] { new SqlParameter("@DocCatID", docCatID) }; reader = objDataAccess.ExecuteReaderQuery(clsConstant.SP_SELECT_DOCUMENT_CATEGORY_CHECK, CommandType.StoredProcedure, pram); while (reader.Read()) { objEnt.DocCatID = Convert.ToInt32(reader.GetValue(0)); objEnt.DocCatName = reader.GetValue(1).ToString(); } return(objEnt); } catch (Exception ex) { throw ex; } }
protected void Page_Load(object sender, EventArgs e) { try { docCatID = Request.QueryString["DocCatFAID"]; if (!IsPostBack) { if (Utility.CheckAccess("WBSectorAddEdit") == false) { UrlParameterPasser urlWrapper = new UrlParameterPasser(); urlWrapper["pageaccesserr"] = "1"; urlWrapper.Url = "../DocumentLogSystem/DashBoard.aspx"; urlWrapper.PassParameters(); } if (!Convert.ToBoolean(Session[clsConstant.SESS_VIEWTYPE])) { this.MakeReadOnly(this.Controls); } if (docCatID != null) { btnSubmit.Visible = false; btnReset.Visible = false; objEnt = docCatDetailsObj.readerForWBSector(int.Parse(docCatID)); txtDocCatName.Text = objEnt.DocCatName; } else { if (IsPostBack == false) { btnUpdate.Visible = false; btnCancelUpdate.Visible = false; } } } } catch (Exception ex) { logger.Error(ex); } }
protected void Page_Load(object sender, EventArgs e) { try { docCatID = Request.QueryString["docCatID"]; if (!IsPostBack) { if (Utility.CheckAccess("DocumentCategoryAddEdit") == false) { pnlInvalid.Visible = true; MainDiv.Visible = false; } if (!Convert.ToBoolean(Session[clsConstant.SESS_VIEWTYPE])) { this.MakeReadOnly(this.Controls); } if (docCatID != null) { btnSubmit.Visible = false; btnReset.Visible = false; objEnt = docCatDetailsObj.readerForDocCat(int.Parse(docCatID)); txtDocCatName.Text = objEnt.DocCatName; } else { if (IsPostBack == false) { btnUpdate.Visible = false; btnCancelUpdate.Visible = false; } } } } catch (Exception ex) { logger.Error(ex); } }