예제 #1
0
    protected void MainSector_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (MainSector.SelectedValue != "")
        {
            if (MainYear.SelectedValue != "0")
            {
                ListItem aa = new ListItem();
                aa.Text  = "اختر الادارة";
                aa.Value = "0";
                MainDepart.Items.Clear();
                MainDepart.Items.Insert(0, aa);

                MainDepart.DataSource = Obj.GetPlansAdmins(Convert.ToInt32(MainYear.SelectedValue), Convert.ToInt32(MainSector.SelectedValue));

                MainDepart.DataTextField  = "AdmName";
                MainDepart.DataValueField = "AdmID";
                MainDepart.DataBind();
                EmployeesData.DataSource = null;
                EmployeesData.DataBind();
                EmployeesData.DataSource = Obj.FilterMainReportsSector(Convert.ToInt32(MainYear.SelectedValue), Convert.ToInt32(MainSector.SelectedValue));
                EmployeesData.DataBind();
            }
        }
        else
        {
            BindAllData();
        }
    }
예제 #2
0
 protected void MainYear_SelectedIndexChanged(object sender, EventArgs e)
 {
     // Fill dropdown Lists For Reports Sections تبعا للسنة
     if (MainYear.SelectedValue != "0")
     {
         MainSector.Items.Clear();
         MainSector.DataSource     = Obj.GetDataSetByID("GetPlansSection", Convert.ToInt32(MainYear.SelectedValue));
         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";
         EmployeesData.DataSource = null;
         EmployeesData.DataBind();
         EmployeesData.DataSource = Obj.GetDataSetByID("FilterMainReportsYear", Convert.ToInt32(MainYear.SelectedValue));
         EmployeesData.DataBind();
     }
     else
     {
         BindAllData();
     }
 }
예제 #3
0
    protected void MainDepart_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (Session["UData"] != null)
        {
            DataSet MyRecDataSet = (DataSet)Session["UData"];

            EmployeesData.DataSource = null;
            EmployeesData.DataBind();
            if (MainDepart.SelectedValue != "0")
            {
                if (MainYear.SelectedValue != "0")
                {
                    EmployeesData.DataSource = Obj.FilterMainReportsAll(Convert.ToInt32(MainYear.SelectedValue), Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["SectionID"]), Convert.ToInt32(MainDepart.SelectedValue));
                    EmployeesData.DataBind();
                }
                else
                {
                    EmployeesData.DataSource = Obj.GetDataSetBy2ID("FilterMainReportsAdm", Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["SectionID"]), Convert.ToInt32(MainDepart.SelectedValue));
                    EmployeesData.DataBind();
                }
            }
            else
            {
                BindAllData();
            }
        }
    }
예제 #4
0
    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]["SystemAdmin"]) == true)
                {
                    Sector.DataSource     = Obj.GetDataSet("GetSections");
                    Sector.DataTextField  = "SectionName";
                    Sector.DataValueField = "SectionID";
                    Sector.DataBind();
                    Sector.Items.Insert(0, "");
                    EmployeesData.DataSource = Obj.GetDataSet("GetEmployeesApprov");
                    EmployeesData.DataBind();
                }
                else
                {
                    Response.Redirect("NoPermissions.aspx");
                }
            }
        }
    }
예제 #5
0
파일: Users.aspx.cs 프로젝트: TrekLaps/IAP
    Operations Obj = new Operations();                             // Define an object fron class Operations.cs

    private void BindEmployeesData()                               // Bind the EmployeesData reapeterEmployees Data (Employees Data Grid)
    {
        EmployeesData.DataSource = Obj.GetDataSet("GetEmployees"); // Calling the function that returns the dataset fron Operations
        EmployeesData.DataBind();

        Sector.DataSource     = Obj.GetDataSet("GetSections"); // Bind the Admins (Administrations) DropdownList
        Sector.DataTextField  = "SectionName";                 // Set the text in the dropdown list
        Sector.DataValueField = "SectionID";                   // Set the value in the dropdown list
        Sector.DataBind();
        Sector.Items.Insert(0, "");

        DataSet DsG = Obj.GetDataSet("GetGover");

        if (DsG.Tables.Count > 0 && DsG.Tables[0].Rows.Count > 0)
        {
            foreach (DataRow RowG in DsG.Tables[0].Rows)
            {
                EmpNameG.Value = Convert.ToString(RowG["EmpName"]);
                PassordG.Attributes.Add("value", Convert.ToString(RowG["EmpPassword"]));
                Passord2G.Attributes.Add("value", Convert.ToString(RowG["EmpPassword"]));
                SaveGov.CommandArgument = Convert.ToString(RowG["EmpID"]);
                EmpJobCodeG.Value       = Convert.ToString(RowG["EmpJobCode"]);
            }
        }
    }
예제 #6
0
    protected void Admins_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (Admins.SelectedValue != "")
        {
            NewReg.Visible = true;

            EmployeesData.DataSource = Obj.GetDataSetByID("GetAdministrations", Convert.ToInt32(Admins.SelectedValue));
            EmployeesData.DataBind();
        }
    }
예제 #7
0
    private void BindAllData()
    {
        if (Session["UData"] != null)
        {
            DataSet MyRecDataSet = (DataSet)Session["UData"];

            EmployeesData.DataSource = Obj.GetDataSetByID("GetMainReportsBySection", Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["SectionID"]));
            EmployeesData.DataBind();
        }
    }
예제 #8
0
 protected void MainDepart_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (MainDepart.SelectedValue != "0")
     {
         EmployeesData.DataSource = null;
         EmployeesData.DataBind();
         EmployeesData.DataSource = Obj.FilterMainReportsAll(Convert.ToInt32(MainYear.SelectedValue), Convert.ToInt32(MainSector.SelectedValue), Convert.ToInt32(MainDepart.SelectedValue));
         EmployeesData.DataBind();
     }
     else
     {
         BindAllData();
     }
 }
예제 #9
0
    protected void Admins1_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (Admins1.SelectedValue != "")
        {
            EmployeesData.DataSource = Obj.GetDataSetByID("GetEmployeesByDeptApprov", Convert.ToInt32(Admins1.SelectedValue));
            EmployeesData.DataBind();

            DropNotAdmins.DataSource = Obj.GetDataSetByID("GetEmployeesByDeptNotApprov", Convert.ToInt32(Admins1.SelectedValue));

            DropNotAdmins.DataTextField  = "EmpName";
            DropNotAdmins.DataValueField = "EmpID";
            DropNotAdmins.DataBind();
            DropNotAdmins.Items.Insert(0, "");
        }
    }
예제 #10
0
    private void BindEmployeesData()
    {
        if (Admins1.SelectedValue != "")
        {
            EmployeesData.DataSource = Obj.GetDataSetByID("GetEmployeesByDeptApprov", Convert.ToInt32(Admins1.SelectedValue));
            EmployeesData.DataBind();

            DropNotAdmins.DataSource = Obj.GetDataSetByID("GetEmployeesByDeptNotApprov", Convert.ToInt32(Admins1.SelectedValue));

            DropNotAdmins.DataTextField  = "EmpName";
            DropNotAdmins.DataValueField = "EmpID";
            DropNotAdmins.DataBind();
            DropNotAdmins.Items.Insert(0, "");
        }
    }
예제 #11
0
    protected void MainYear_SelectedIndexChanged(object sender, EventArgs e)
    {
        DataSet MyRecDataSet = (DataSet)Session["UData"];

        // Fill dropdown Lists For Reports Sections تبعا للسنة
        if (MainYear.SelectedValue != "0")
        {
            EmployeesData.DataSource = null;
            EmployeesData.DataBind();
            EmployeesData.DataSource = Obj.GetDataSetBy2ID("FilterMainReportsYearByAdm", Convert.ToInt32(MainYear.SelectedValue), Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["AdmID"]));
            EmployeesData.DataBind();
        }
        else
        {
            BindAllData();
        }
    }
예제 #12
0
    protected void DropUsers_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (DropUsers.SelectedValue != "0")
        {
            EmployeesData.DataSource = null;
            EmployeesData.DataBind();
            DataSet Ds = Obj.GetDataSetByID("GetLogTableByUser", Convert.ToInt32(DropUsers.SelectedValue));
            if (Ds.Tables[0].Rows.Count > 0)
            {
                LblData.Visible          = false;
                EmployeesData.DataSource = Ds;
                EmployeesData.DataBind();
            }
            else
            {
                BindEmployeesData();

                LblData.Visible = true;
            }
        }
    }
예제 #13
0
    protected void MainYear_SelectedIndexChanged(object sender, EventArgs e)
    {
        DataSet MyRecDataSet = (DataSet)Session["UData"];

        // Fill dropdown Lists For Reports Sections تبعا للسنة
        if (MainYear.SelectedValue != "0")
        {
            MainDepart.Items.Clear();
            MainDepart.DataSource     = Obj.GetDataSetBy2ID("GetAdminByYear", Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["SectionID"]), Convert.ToInt32(MainYear.SelectedValue));
            MainDepart.DataTextField  = "AdmName";
            MainDepart.DataValueField = "AdmID";
            MainDepart.DataBind();

            ListItem aa = new ListItem();
            aa.Text  = "اختر الإدارة متوسطة";
            aa.Value = "0";

            MainDepart.Items.Insert(0, aa);

            EmployeesData.DataSource = null;
            EmployeesData.DataBind();
            EmployeesData.DataSource = Obj.FilterMainReportsSector(Convert.ToInt32(MainYear.SelectedValue), Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["SectionID"]));
            EmployeesData.DataBind();
        }
        else
        {
            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 aa = new ListItem();
            aa.Text  = "اختر الإدارة متوسطة";
            aa.Value = "0";

            MainDepart.Items.Insert(0, aa);
            BindAllData();
        }
    }
예제 #14
0
파일: Plans.aspx.cs 프로젝트: TrekLaps/IAP
 private void BindEmployeesData()
 {
     EmployeesData.DataSource = Obj.GetDataSet("GetPlans");
     EmployeesData.DataBind();
 }
예제 #15
0
 private void BindEmployeesData()
 {
     EmployeesData.DataSource = Obj.GetDataSet("GetLogTable");
     EmployeesData.DataBind();
 }
예제 #16
0
 private void BindEmployeesData()
 {
     EmployeesData.DataSource = Obj.GetDataSetByID("GetAdministrations", Convert.ToInt32(Admins.SelectedValue));
     EmployeesData.DataBind();
 }
예제 #17
0
 private void BindAllData()
 {
     EmployeesData.DataSource = Obj.GetDataSet("GetMainReports");
     EmployeesData.DataBind();
 }
예제 #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            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]["SystemAdmin"]) == true) || (Convert.ToBoolean(MyRecDataSet.Tables[0].Rows[0]["ApprovPermission"]) == true))
                    {
                        DropYear.DataSource     = Obj.GetDataSet("GetPlans");
                        DropYear.DataTextField  = "YearName";
                        DropYear.DataValueField = "ID";
                        DropYear.DataBind();

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

                        DropYear.Items.Insert(0, aa);

                        if (Request.QueryString["ReqYR"] != "0")
                        {
                            DropYear.SelectedValue = Request.QueryString["ReqYR"];
                            Admins.DataSource      = Obj.GetDataSetByID("GetPlansSection", Convert.ToInt32(Request.QueryString["ReqYR"]));
                            Admins.DataTextField   = "SectionName";
                            Admins.DataValueField  = "SectionID";
                            Admins.DataBind();
                            ListItem LstNew = new ListItem("اختر الإدارة العليا", "0");

                            Admins.Items.Insert(0, "");
                            Admins.Items.Insert(1, LstNew);



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

                                ReportingLnk.NavigateUrl = "ReportingAdmSections.aspx?ReqYR=" + Request.QueryString["ReqYR"] + "&Reqq=" + Request.QueryString["Reqq"];
                            }
                        }
                        else
                        {
                            Admins.DataSource     = Obj.GetDataSet("GetSectionsDashboard");
                            Admins.DataTextField  = "SectionName";
                            Admins.DataValueField = "SectionID";
                            Admins.DataBind();

                            ListItem aaSection = new ListItem
                            {
                                Text  = "اختر الإدارة العليا",
                                Value = ""
                            };

                            Admins.Items.Insert(0, aaSection);
                            if (Request.QueryString["Reqq"] != null)
                            {
                                Admins.SelectedValue = Request.QueryString["Reqq"];

                                ReportingLnk.NavigateUrl = "ReportingAdmSections.aspx?ReqYR=0" + Request.QueryString["ReqYR"] + "&Reqq=" + Request.QueryString["Reqq"];
                            }
                        }
                    }
                    else
                    {
                        Response.Redirect("NoPermissions.aspx");
                    }
                }


                if (Admins.SelectedValue != null)
                {
                    string YearSelectedValue = Request.QueryString["Year"];
                    if (!string.IsNullOrEmpty(YearSelectedValue))
                    {
                        DropYear.SelectedValue = YearSelectedValue;
                    }

                    if (Admins.SelectedValue != "")
                    {
                        //Completed
                        BindImportChart();
                        //Tomorrow
                        BindStatChart();
                        BindChart();


                        DataSet ds = null;
                        if (string.IsNullOrEmpty(YearSelectedValue))
                        {
                            ds = Obj.GetDataSetByID("GetAllAdminsBySection", Convert.ToInt32(Admins.SelectedValue));
                        }
                        else
                        {
                            ds = Obj.GetDataSetBy2ID("GetAllSectionsChartPlanSEC", Convert.ToInt32(Admins.SelectedValue), Convert.ToInt32(DropYear.SelectedValue));
                        }


                        PrntView.Attributes.Remove("style");
                        PrntView.Style.Add("display", "block");

                        //    PrevAll.Attributes.Remove("style");
                        //   PrevAll.Style.Add("display", "block");

                        NoRep.Visible = false;

                        //RepYears.DataSource = Obj.GetDataSetByID("GetPlansBySection", Convert.ToInt32(Admins.SelectedValue));
                        //RepYears.DataBind();

                        if (string.IsNullOrEmpty(YearSelectedValue))
                        {
                            RepTotals.DataSource = Obj.GetDataSetByID("GetRepSectionCounts", Convert.ToInt32(Admins.SelectedValue));
                        }
                        else
                        {
                            RepTotals.DataSource = Obj.GetDataSetBy2ID("GetRepSectionAllPlansBySec", Convert.ToInt32(Admins.SelectedValue), Convert.ToInt32(DropYear.SelectedValue));
                        }

                        RepTotals.DataBind();


                        Repeater2.DataSource = EmployeesData.DataSource = ds;
                        EmployeesData.DataBind();

                        Repeater2.DataBind();
                    }
                    else
                    {
                        PrntView.Attributes.Remove("style");
                        PrntView.Style.Add("display", "none");

                        //PrevAll.Attributes.Remove("style");
                        //PrevAll.Style.Add("display", "none");
                    }
                }
            }

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

                if (HiddenYear.Value != "0")
                {
                    //RepYears.DataSource = Obj.GetDataSetByID("GetPlansBySection", Convert.ToInt32(Admins.SelectedValue));
                    //RepYears.DataBind();
                }
            }

            try
            {
                DataSet ds = null;
                if (Request.QueryString["ReqYR"] != "0")
                {
                    ds = Obj.GetDataSetBy2ID("GetAllSectionsChartPlanSEC", Convert.ToInt32(Request.QueryString["Reqq"].ToString()), Convert.ToInt32(Request.QueryString["ReqYR"].ToString()));
                }
                else
                {
                    ds = Obj.GetDataSetByID("GetAllAdminsBySection", Convert.ToInt32(Request.QueryString["Reqq"].ToString()));
                }

                Repeater2.DataSource = EmployeesData.DataSource = ds;
                EmployeesData.DataBind();

                Repeater2.DataBind();

                if (Request.QueryString["ReqYR"] != "0")
                {
                    RepTotals.DataSource = Obj.GetDataSetBy2ID("GetRepSectionAllPlansBySec", Convert.ToInt32(Request.QueryString["Reqq"].ToString()), Convert.ToInt32(Request.QueryString["ReqYR"].ToString()));
                }
                else
                {
                    RepTotals.DataSource = Obj.GetDataSetByID("GetRepSectionCounts", Convert.ToInt32(Request.QueryString["Reqq"].ToString()));
                }

                RepTotals.DataBind();
            }
            catch { }
        }
        catch
        { }
    }
예제 #19
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();
            }
        }
    }
예제 #20
0
 private void BindEmployeesData()
 {
     EmployeesData.DataSource = Obj.GetDataSet("GetSystemAdmins");
     EmployeesData.DataBind();
 }
예제 #21
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();
            }
        }
    }
예제 #22
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 (Obj.ExecuteProcedureID("CheckSectionManger", Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["EmpID"])) == 1)
                {/// Log Data Start
                    Obj.ExecuteProcedureStringID("NewLogTable", Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["EmpID"]), "View Notes and Recommendations Charts by Section manager permission");

                    /// Log Data End

                    DropYear.Items.Clear();
                    DropYear.DataSource     = Obj.GetDataSetByID("GetPlansBySection", Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["SectionID"]));
                    DropYear.DataTextField  = "YearName";
                    DropYear.DataValueField = "ID";
                    DropYear.DataBind();

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

                    DropYear.Items.Insert(0, aa);

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


                        HyperLink1.NavigateUrl = "ReportingAllSections.aspx?ReqY=" + DropYear.SelectedValue + "&Reqq=" + Convert.ToString(MyRecDataSet.Tables[0].Rows[0]["SectionID"]);
                    }
                    else
                    {
                        HyperLink1.NavigateUrl = "ReportingAllSections.aspx?ReqY=0&Reqq=" + Convert.ToString(MyRecDataSet.Tables[0].Rows[0]["SectionID"]);
                    }
                }

                else
                {
                    Response.Redirect("NoPermissions.aspx");
                }
            }


            if (Request.QueryString["Reqq"] != null)
            {
                string YearSelectedValue = Request.QueryString["ReqYR"];
                if (!string.IsNullOrEmpty(YearSelectedValue))
                {
                    DropYear.SelectedValue = YearSelectedValue;
                }

                if (Request.QueryString["Reqq"] != "")
                {
                    //Completed
                    BindImportChart();
                    //Tomorrow
                    BindStatChart();
                    BindChart();


                    DataSet ds = null;
                    if (string.IsNullOrEmpty(YearSelectedValue))
                    {
                        ds = Obj.GetDataSetByID("GetAllAdminsBySection", Convert.ToInt32(Request.QueryString["Reqq"]));
                    }
                    else
                    {
                        ds = Obj.GetDataSetBy2ID("GetAllSectionsChartPlanSEC", Convert.ToInt32(Request.QueryString["Reqq"]), Convert.ToInt32(Request.QueryString["ReqYR"]));
                    }


                    PrntView.Attributes.Remove("style");
                    PrntView.Style.Add("display", "block");

                    //    PrevAll.Attributes.Remove("style");
                    //   PrevAll.Style.Add("display", "block");

                    NoRep.Visible = false;

                    //RepYears.DataSource = Obj.GetDataSetByID("GetPlansBySection", Convert.ToInt32(Request.QueryString["Reqq"]));
                    //RepYears.DataBind();

                    if (string.IsNullOrEmpty(YearSelectedValue))
                    {
                        RepTotals.DataSource = Obj.GetDataSetByID("GetRepSectionCounts", Convert.ToInt32(Request.QueryString["Reqq"]));
                    }
                    else
                    {
                        RepTotals.DataSource = Obj.GetDataSetBy2ID("GetRepSectionAllPlansBySec", Convert.ToInt32(Request.QueryString["Reqq"]), Convert.ToInt32(Request.QueryString["ReqYR"]));
                    }

                    RepTotals.DataBind();


                    Repeater2.DataSource = EmployeesData.DataSource = ds;
                    EmployeesData.DataBind();

                    Repeater2.DataBind();
                }
                else
                {
                    PrntView.Attributes.Remove("style");
                    PrntView.Style.Add("display", "none");

                    //PrevAll.Attributes.Remove("style");
                    //PrevAll.Style.Add("display", "none");

                    NoRep.Visible = true;
                }
            }
        }

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

            if (HiddenYear.Value != "0")
            {
                //RepYears.DataSource = Obj.GetDataSetByID("GetPlansBySection", Convert.ToInt32(Request.QueryString["Reqq"]));
                //RepYears.DataBind();
            }
        }
    }