protected void CheckPermission() { try { ClsBAL objBAL = new ClsBAL(); objBAL.ID = Convert.ToInt32(Session["UserID"]); objBAL.screenName = "Recharge Status"; _objDataSet = (DataSet)objBAL.GetPerByUser(); if (_objDataSet != null) { if (_objDataSet.Tables[0].Rows.Count > 0) { ViewState["UserPermissions"] = _objDataSet.Tables[0]; ViewState["Book"] = _objDataSet.Tables[0].Rows[0]["Book"].ToString(); } else { ViewState["UserPermissions"] = null; } } else { ViewState["UserPermissions"] = null; } } catch (Exception ex) { throw ex; } }
protected void CheckPermission(string pageName, string role) { try { pnlMain.Visible = true; tdmsg.Style.Add("background-color:#E77471;", ""); lblMainMsg.Text = " No Permission to this page. Please contact Administrator for further details."; lblMainMsg.ForeColor = System.Drawing.Color.Maroon; tdmsg.Visible = false; if (role == "CSE") { tdmsg.Visible = true; tdmsg.Style.Add("background-color:#E77471;", ""); pnlMain.Visible = false; ClsBAL objBAL = new ClsBAL(); objBAL.ID = Convert.ToInt32(Session["UserID"]); objBAL.screenName = pageName; DataSet objDataSet = (DataSet)objBAL.GetPerByUser(); if (objDataSet != null) { if (objDataSet.Tables[0].Rows.Count > 0) { ViewState["UserPermissions"] = objDataSet.Tables[0]; ViewState["Book"] = objDataSet.Tables[0].Rows[0]["Book"].ToString(); } else { ViewState["UserPermissions"] = null; } } else { ViewState["UserPermissions"] = null; } if (ViewState["UserPermissions"] != null) { if (ViewState["Book"] != null) { if (ViewState["Book"].ToString() == "1") { pnlMain.Visible = true; tdmsg.Visible = false; } } } } } catch (Exception ex) { throw ex; } }
protected void CheckPermission(string pageName, string role) { try { tblmain.Visible = true; tdmsg.Visible = false; if (role == "CSE") { tdmsg.Visible = true; tdmsg.Style.Add("background-color:#E77471;", ""); tblmain.Visible = false; ClsBAL objBAL = new ClsBAL(); objBAL.ID = Convert.ToInt32(Session["UserID"]); objBAL.screenName = pageName; DataSet objDataSet = (DataSet)objBAL.GetPerByUser(); if (objDataSet != null) { if (objDataSet.Tables[0].Rows.Count > 0) { ViewState["UserPermissions"] = objDataSet.Tables[0]; ViewState["Book"] = objDataSet.Tables[0].Rows[0]["Book"].ToString(); } else { ViewState["UserPermissions"] = null; } } else { ViewState["UserPermissions"] = null; } if (ViewState["UserPermissions"] != null) { if (ViewState["Book"] != null) { if (ViewState["Book"].ToString() == "1") { tblmain.Visible = true; tdmsg.Visible = false; } } } } } catch (Exception ex) { throw ex; } }
protected void CheckPermission() { try { objBAL = new ClsBAL(); objBAL.ID = Convert.ToInt32(Session["UserID"]); objBAL.screenName = "Commission"; ObjDataset = (DataSet)objBAL.GetPerByUser(); if (ObjDataset != null) { if (ObjDataset.Tables[0].Rows.Count > 0) { ViewState["UserPermissions"] = ObjDataset.Tables[0]; ViewState["AddCom"] = ObjDataset.Tables[0].Rows[0]["Add"].ToString(); ViewState["ViewCom"] = ObjDataset.Tables[0].Rows[0]["View"].ToString(); ViewState["DeleteCom"] = ObjDataset.Tables[0].Rows[0]["Delete"].ToString(); ViewState["EditCom"] = ObjDataset.Tables[0].Rows[0]["Edit"].ToString(); } else { ViewState["UserPermissions"] = null; } } else { ViewState["UserPermissions"] = null; } } catch (Exception ex) { throw ex; } }