protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UData"] != null) { DataSet MyRecDataSet = (DataSet)Session["UData"]; CloseAll(); Main.Attributes.Remove("Style"); Main.Style.Add("display", "block"); if (Obj.ExecuteProcedureID("CheckAdminManger", Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["EmpID"])) == 1) { MainYear.DataSource = Obj.GetDataSetByID("GetPlansByAdmin", Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["AdmID"])); MainYear.DataTextField = "YearName"; MainYear.DataValueField = "ID"; MainYear.DataBind(); BindAllData(); } else { Response.Redirect("NoPermissions.aspx"); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UData"] != null) { DataSet MyRecDataSet = (DataSet)Session["UData"]; if (Convert.ToBoolean(MyRecDataSet.Tables[0].Rows[0]["Gov"]) == true) { MainYear.DataSource = Obj.GetDataSet("GetPlans"); MainYear.DataTextField = "YearName"; MainYear.DataValueField = "ID"; MainYear.DataBind(); BindAllData(); } else { Response.Redirect("NoPermissions.aspx"); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UData"] != null) { DataSet MyRecDataSet = (DataSet)Session["UData"]; CloseAll(); Main.Attributes.Remove("Style"); Main.Style.Add("display", "block"); if (Convert.ToBoolean(MyRecDataSet.Tables[0].Rows[0]["Gov"]) == true) { Response.Redirect("MainReport.aspx"); } else if (Convert.ToBoolean(MyRecDataSet.Tables[0].Rows[0]["ApprovPermission"]) == true) { MainYear.DataSource = DropYear.DataSource = DropYearU.DataSource = Obj.GetDataSet("GetPlans"); MainYear.DataTextField = DropYear.DataTextField = DropYearU.DataTextField = "YearName"; MainYear.DataValueField = DropYear.DataValueField = DropYearU.DataValueField = "ID"; DropYear.DataBind(); DropYearU.DataBind(); MainYear.DataBind(); BindAllData(); } else { Response.Redirect("NoPermissions.aspx"); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UData"] != null) { DataSet MyRecDataSet = (DataSet)Session["UData"]; CloseAll(); Main.Attributes.Remove("Style"); Main.Style.Add("display", "block"); if (Obj.ExecuteProcedureID("CheckSectionManger", Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["EmpID"])) == 1) { MainYear.DataSource = Obj.GetDataSetByID("GetPlansBySection", Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["SectionID"])); MainYear.DataTextField = "YearName"; MainYear.DataValueField = "ID"; MainYear.DataBind(); MainDepart.Items.Clear(); MainDepart.DataSource = Obj.GetDataSetByID("GetAdministrations", Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["SectionID"])); MainDepart.DataTextField = "AdmName"; MainDepart.DataValueField = "AdmID"; MainDepart.DataBind(); ListItem aa0 = new ListItem(); aa0.Text = "اختر الإدارة متوسطة"; aa0.Value = "0"; MainDepart.Items.Insert(0, aa0); BindAllData(); } else { Response.Redirect("NoPermissions.aspx"); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["UData"] != null) { DataSet MyRecDataSet = (DataSet)Session["UData"]; if (!IsPostBack) { Session["PostID"] = "1001"; ViewState["PostID"] = Session["PostID"].ToString(); HyperLink1.NavigateUrl = "ReportAdmAllMang.aspx?S=" + Request.QueryString["S"] + "&Reqq" + Request.QueryString["Reqq"]; if ((Convert.ToBoolean(MyRecDataSet.Tables[0].Rows[0]["SystemAdmin"]) == true) || (Convert.ToBoolean(MyRecDataSet.Tables[0].Rows[0]["ApprovPermission"]) == true)) { MainYear.DataSource = Obj.GetDataSet("GetPlans"); MainYear.DataTextField = "YearName"; MainYear.DataValueField = "ID"; MainYear.DataBind(); if (Request.QueryString["ReqY"] != null) { DataSet SectionsDS = Obj.GetDataSet("GetSections"); if (Request.QueryString["ReqY"] != "0") { SectionsDS = Obj.GetDataSetByID("GetPlansSection", Convert.ToInt32(Request.QueryString["ReqY"])); } MainYear.SelectedValue = Request.QueryString["ReqY"]; MainSector.Items.Clear(); MainSector.DataSource = SectionsDS; MainSector.DataTextField = "SectionName"; MainSector.DataValueField = "SectionID"; MainSector.DataBind(); ListItem aa = new ListItem(); aa.Text = "اختر الإدارة العليا"; aa.Value = "0"; MainSector.Items.Insert(0, aa); MainSector.SelectedValue = "0"; if (Request.QueryString["S"] != null) { MainSector.SelectedValue = Request.QueryString["S"]; DataSet DepartsDS = Obj.GetDataSetByID("GetAdministrations", Convert.ToInt32(Request.QueryString["S"])); if (Request.QueryString["ReqY"] != "0") { DepartsDS = Obj.GetPlansAdmins(Convert.ToInt32(Request.QueryString["ReqY"]), Convert.ToInt32(MainSector.SelectedValue)); } MainDepart.Items.Clear(); MainDepart.DataSource = DepartsDS; MainDepart.DataTextField = "AdmName"; MainDepart.DataValueField = "AdmID"; MainDepart.DataBind(); ListItem aa0 = new ListItem(); aa0.Text = "اختر الادارة"; aa0.Value = "0"; MainDepart.Items.Insert(0, aa0); } HyperLink1.NavigateUrl = "ReportAdmAllMang.aspx?S=" + Request.QueryString["S"] + "&Reqq=" + Request.QueryString["Reqq"] + "&YQ=" + Request.QueryString["ReqY"]; } if (Request.QueryString["Reqq"] != null) { MainDepart.SelectedValue = Request.QueryString["Reqq"]; NoRep.Attributes.Remove("Style"); NoRep.Style.Add("display", "none"); MainsAll.Attributes.Remove("Style"); MainsAll.Style.Add("display", "block"); if (Request.QueryString["ReqY"] == "0") { var Vall = Obj.ExecuteProcedureID("GetReportCountByAdmin", Convert.ToInt32(Request.QueryString["Reqq"])); if (Vall != 0) { BindImportChart(Convert.ToInt32(Request.QueryString["Reqq"])); BindStatChart(Convert.ToInt32(Request.QueryString["Reqq"])); BindChart(Convert.ToInt32(Request.QueryString["Reqq"])); DataSet ds = Obj.GetDataSetByID("GetCountsByAdmin", Convert.ToInt32(Request.QueryString["Reqq"])); NoRep.Attributes.Remove("Style"); NoRep.Style.Add("display", "none"); MainsAll.Attributes.Remove("Style"); MainsAll.Style.Add("display", "block"); FillSectorChart(); RepTotals.DataSource = Obj.GetDataSetByID("GetRepAdminCounts", Convert.ToInt32(Request.QueryString["Reqq"])); RepTotals.DataBind(); Repeater2.DataSource = ds; Repeater2.DataBind(); } else { NoRep.Attributes.Remove("Style"); NoRep.Style.Add("display", "block"); MainsAll.Attributes.Remove("Style"); MainsAll.Style.Add("display", "none"); } } else if (Request.QueryString["ReqY"] != "0" && Request.QueryString["ReqY"] != null) { var Vall = Obj.GetReportCountByAdminPlan(Convert.ToInt32(Request.QueryString["Reqq"]), Convert.ToInt32(Request.QueryString["ReqY"])); if (Vall != 0) { BindImportChartAdmin(Convert.ToInt32(Request.QueryString["Reqq"]), Convert.ToInt32(Request.QueryString["ReqY"])); BindStatChartAdmin(Convert.ToInt32(Request.QueryString["Reqq"]), Convert.ToInt32(Request.QueryString["ReqY"])); BindChartAdmin(Convert.ToInt32(Request.QueryString["Reqq"]), Convert.ToInt32(Request.QueryString["ReqY"])); DataSet ds = Obj.GetDataSetBy2ID("GetAllSectionsChartPlanADM", Convert.ToInt32(Request.QueryString["Reqq"]), Convert.ToInt32(Request.QueryString["ReqY"])); NoRep.Attributes.Remove("Style"); NoRep.Style.Add("display", "none"); MainsAll.Attributes.Remove("Style"); MainsAll.Style.Add("display", "block"); FillSectorChart(); RepTotals.DataSource = Obj.GetDataSetBy2ID("GetRepSectionAllPlansByAdm", Convert.ToInt32(Request.QueryString["Reqq"]), Convert.ToInt32(Request.QueryString["ReqY"])); RepTotals.DataBind(); Repeater2.DataSource = ds; Repeater2.DataBind(); } else { NoRep.Attributes.Remove("Style"); NoRep.Style.Add("display", "block"); MainsAll.Attributes.Remove("Style"); MainsAll.Style.Add("display", "none"); } } } else { NoRep.Attributes.Remove("Style"); NoRep.Style.Add("display", "block"); MainsAll.Attributes.Remove("Style"); MainsAll.Style.Add("display", "none"); } } else { Response.Redirect("NoPermissions.aspx"); } } else { if (ViewState["PostID"].ToString() == Session["PostID"].ToString()) { Session["PostID"] = (Convert.ToInt16(Session["PostID"]) + 1).ToString(); ViewState["PostID"] = Session["PostID"].ToString(); } else { ViewState["PostID"] = Session["PostID"].ToString(); hidden.Value = "0"; Stat.Value = "0"; } if (Stat.Value != "Non") { LoadDataChart(); } if (HiddenYear.Value != "0") { MainYear.DataSource = Obj.GetDataSetByID("GetPlansByAdmin", Convert.ToInt32(Request.QueryString["Reqq"])); MainYear.DataBind(); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["UData"] != null) { DataSet MyRecDataSet = (DataSet)Session["UData"]; if (!IsPostBack) { Session["PostID"] = "1001"; ViewState["PostID"] = Session["PostID"].ToString(); if (Obj.ExecuteProcedureID("CheckAdminManger", Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["EmpID"])) == 1) { HyperLink1.NavigateUrl = "ReportAdmAll.aspx"; MainYear.DataSource = Obj.GetDataSetByID("GetPlansByAdmin", Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["AdmID"])); MainYear.DataTextField = "YearName"; MainYear.DataValueField = "ID"; MainYear.DataBind(); if (Request.QueryString["ReqY"] != null) { MainYear.SelectedValue = Request.QueryString["ReqY"]; HyperLink1.NavigateUrl = "ReportAdmAll.aspx?YQ=" + Request.QueryString["ReqY"]; } if (Request.QueryString["Reqq"] != null) { NoRep.Visible = false; if (Request.QueryString["ReqY"] == "0") { var Vall = Obj.ExecuteProcedureID("GetReportCountByAdmin", Convert.ToInt32(Request.QueryString["Reqq"])); if (Vall != 0) { BindImportChart(Convert.ToInt32(Request.QueryString["Reqq"])); BindStatChart(Convert.ToInt32(Request.QueryString["Reqq"])); BindChart(Convert.ToInt32(Request.QueryString["Reqq"])); DataSet ds = Obj.GetDataSetByID("GetCountsByAdmin", Convert.ToInt32(Request.QueryString["Reqq"])); NoRep.Visible = false; FillSectorChart(); RepTotals.DataSource = Obj.GetDataSetByID("GetRepAdminCounts", Convert.ToInt32(Request.QueryString["Reqq"])); RepTotals.DataBind(); Repeater2.DataSource = ds; Repeater2.DataBind(); } else { NoRep.Visible = true; } } else if (Request.QueryString["ReqY"] != "0" && Request.QueryString["ReqY"] != null) { var Vall = Obj.GetReportCountByAdminPlan(Convert.ToInt32(Request.QueryString["Reqq"]), Convert.ToInt32(Request.QueryString["ReqY"])); if (Vall != 0) { BindImportChartAdmin(Convert.ToInt32(Request.QueryString["Reqq"]), Convert.ToInt32(Request.QueryString["ReqY"])); BindStatChartAdmin(Convert.ToInt32(Request.QueryString["Reqq"]), Convert.ToInt32(Request.QueryString["ReqY"])); BindChartAdmin(Convert.ToInt32(Request.QueryString["Reqq"]), Convert.ToInt32(Request.QueryString["ReqY"])); DataSet ds = Obj.GetDataSetBy2ID("GetAllSectionsChartPlanADM", Convert.ToInt32(Request.QueryString["Reqq"]), Convert.ToInt32(Request.QueryString["ReqY"])); NoRep.Visible = false; FillSectorChart(); RepTotals.DataSource = Obj.GetDataSetBy2ID("GetRepSectionAllPlansByAdm", Convert.ToInt32(Request.QueryString["Reqq"]), Convert.ToInt32(Request.QueryString["ReqY"])); RepTotals.DataBind(); Repeater2.DataSource = ds; Repeater2.DataBind(); } else { NoRep.Visible = true; } } } else { PrntView.Attributes.Remove("style"); PrntView.Style.Add("display", "none"); NoRep.Visible = true; } } else { Response.Redirect("NoPermissions.aspx"); } } else { if (ViewState["PostID"].ToString() == Session["PostID"].ToString()) { Session["PostID"] = (Convert.ToInt16(Session["PostID"]) + 1).ToString(); ViewState["PostID"] = Session["PostID"].ToString(); } else { ViewState["PostID"] = Session["PostID"].ToString(); hidden.Value = "0"; Stat.Value = "0"; } if (Stat.Value != "Non") { LoadDataChart(); } if (HiddenYear.Value != "0") { MainYear.DataSource = Obj.GetDataSetByID("GetPlansByAdmin", Convert.ToInt32(Request.QueryString["Reqq"])); MainYear.DataBind(); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["UData"] != null) { DataSet MyRecDataSet = (DataSet)Session["UData"]; if (!IsPostBack) { if ((Convert.ToBoolean(MyRecDataSet.Tables[0].Rows[0]["SystemAdmin"]) == true) || (Convert.ToBoolean(MyRecDataSet.Tables[0].Rows[0]["ApprovPermission"]) == true)) { /// Log Data Start String Users = "Governorate"; if (Convert.ToBoolean(MyRecDataSet.Tables[0].Rows[0]["ApprovPermission"]) == true) { Users = "Internal Audit"; } else if (Convert.ToBoolean(MyRecDataSet.Tables[0].Rows[0]["SystemAdmin"]) == true) { Users = "System Administrator"; } Obj.ExecuteProcedureStringID("NewLogTable", Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["EmpID"]), "View Departments Notes and Recommendations Charts by " + Users + "Permission"); /// Log Data End /// MainYear.DataSource = Obj.GetDataSet("GetPlans"); MainYear.DataTextField = "YearName"; MainYear.DataValueField = "ID"; MainYear.DataBind(); if (Request.QueryString["ReqY"] != null) { MainYear.SelectedValue = Request.QueryString["ReqY"]; } MainSector.DataSource = Obj.GetDataSet("GetSectionsDashboard"); MainSector.DataTextField = "SectionName"; MainSector.DataValueField = "SectionID"; MainSector.DataBind(); ListItem aaSection = new ListItem { Text = "اختر الإدارة العليا", Value = "" }; MainSector.Items.Insert(0, aaSection); } else if (Obj.ExecuteProcedureID("CheckAdminManger", Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["EmpID"])) == 1) { MainYear.DataSource = Obj.GetDataSetByID("GetPlansByAdmin", Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["AdmID"])); MainYear.DataTextField = "YearName"; MainYear.DataValueField = "ID"; MainYear.DataBind(); if (Request.QueryString["ReqY"] != null) { MainYear.SelectedValue = Request.QueryString["ReqY"]; } Sections.Attributes.Remove("style"); Sections.Attributes.Add("style", "display:none"); Adms.Attributes.Remove("style"); Adms.Attributes.Add("style", "display:none"); } else { Response.Redirect("NoPermissions.aspx"); } } } }