예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Session["PostID"]   = "1001";
            ViewState["PostID"] = Session["PostID"].ToString();


            if (Session["UData"] != null)
            {
                DataSet MyRecDataSet = (DataSet)Session["UData"];

                if (Convert.ToBoolean(MyRecDataSet.Tables[0].Rows[0]["Gov"]) == true || 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 All Notes and Recommendations Charts by " + Users + "Permission");

                    /// Log Data End
                    ///
                    DropYear.Items.Clear();
                    DropYear.DataSource     = Obj.GetDataSet("GetPlans");
                    DropYear.DataTextField  = "YearName";
                    DropYear.DataValueField = "ID";
                    DropYear.DataBind();

                    ListItem aa = new ListItem("جميع السنوات", "0");

                    DropYear.Items.Insert(0, aa);
                    DropYear.SelectedItem.Value = "0";
                    BindChart();
                    BindChartAdm();
                    BindImportChart();
                    BindStatChart();

                    RepTotalsYears.DataSource = Obj.GetDataSet("GetRepSectionAll");
                    RepTotalsYears.DataBind();


                    Repeater2Years.DataSource = EmployeesDataYears.DataSource = Obj.GetDataSet("GetAllSectionsChart");
                    EmployeesDataYears.DataBind();

                    Repeater2Years.DataBind();


                    DataSet ds = Obj.GetDataSet("GetAllAdmins");
                    Repeater2.DataSource = EmployeesData.DataSource = ds;
                    EmployeesData.DataBind();
                    Repeater2.DataBind();

                    RepTotals.DataSource = Obj.GetDataSet("GetReportsCounts");
                    RepTotals.DataBind();
                }

                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";
                hiddenAdm.Value = "0";
            }
            if (hidden.Value != "0")
            {
                LoadDataChart();
            }

            if (hiddenAdm.Value != "0")
            {
                LoadDataChartAdm();
            }
        }
    }
예제 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Session["PostID"]   = "1001";
            ViewState["PostID"] = Session["PostID"].ToString();

            if (Session["UData"] != null)
            {
                DataSet MyRecDataSet = (DataSet)Session["UData"];

                if (Convert.ToBoolean(MyRecDataSet.Tables[0].Rows[0]["Gov"]) == true || Convert.ToBoolean(MyRecDataSet.Tables[0].Rows[0]["SystemAdmin"]) == true || (Convert.ToBoolean(MyRecDataSet.Tables[0].Rows[0]["ApprovPermission"]) == true))
                {
                    HyperLink1.NavigateUrl = "ReportingAll.aspx?ReqY=" + Request.QueryString["Reqq"];

                    DropYear.Items.Clear();
                    DropYear.DataSource     = Obj.GetDataSet("GetPlans");
                    DropYear.DataTextField  = "YearName";
                    DropYear.DataValueField = "ID";
                    DropYear.DataBind();

                    ListItem aa = new ListItem("جميع السنوات", "0");

                    DropYear.Items.Insert(0, aa);
                    DropYear.SelectedItem.Value = "0";

                    if (Request.QueryString["Reqq"] != "")
                    {
                        DropYear.SelectedValue = Request.QueryString["Reqq"];

                        SectionCharts.PostBackUrl = "SectionsCharts.aspx?Reqq=" + Request.QueryString["Reqq"];

                        AdminCharts.PostBackUrl = "AdminsCharts.aspx?Reqq=" + Request.QueryString["Reqq"];
                    }
                    BindChartAdm();
                    BindChart();
                    BindImportChart();
                    BindStatChart();
                    RepTotalsYears.DataSource = Obj.GetDataSetByID("GetRepSectionAllPlans", Convert.ToInt32(DropYear.SelectedValue));
                    RepTotalsYears.DataBind();


                    Repeater2Years.DataSource = EmployeesDataYears.DataSource = Obj.GetDataSetByID("GetAllSectionsChartPlans", Convert.ToInt32(DropYear.SelectedValue));
                    EmployeesDataYears.DataBind();

                    Repeater2Years.DataBind();

                    DataSet ds = Obj.GetDataSetByID("GetAllSectionsChartPlans", Convert.ToInt32(DropYear.SelectedValue));



                    DataSet dsYear = Obj.GetDataSetByID("GetAllAdminsByPlanNoSec", Convert.ToInt32(DropYear.SelectedValue));

                    Repeater2.DataSource = EmployeesData.DataSource = dsYear;
                    EmployeesData.DataBind();
                    Repeater2.DataBind();
                    RepTotals.DataSource = Obj.GetDataSetByID("GetYearCounts", Convert.ToInt32(DropYear.SelectedValue));
                    RepTotals.DataBind();
                }

                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";
                hiddenAdm.Value = "0";
            }
            if (hidden.Value != "0")
            {
                LoadDataChart();
            }
            if (hiddenAdm.Value != "0")
            {
                LoadDataChartAdm();
            }
        }
    }