Exemplo n.º 1
0
    protected void MainSector_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (MainSector.SelectedValue != "")
        {
            MainsAll.Attributes.Remove("Style");
            MainsAll.Style.Add("display", "none");

            if (MainYear.SelectedValue != "0")
            {
                MainDepart.Items.Clear();


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

                MainDepart.DataTextField = "AdmName";
                MainDepart.DataValueField = "AdmID";
                MainDepart.DataBind();
                ListItem aa = new ListItem();
                aa.Text = "اختر الادارة";
                aa.Value = "0";

                MainDepart.Items.Insert(0, aa);

            }
        }
    }
Exemplo n.º 2
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();
        }
    }
Exemplo n.º 3
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();
        }
    }
Exemplo n.º 4
0
    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");
                }
            }
        }
    }
Exemplo n.º 5
0
    protected void MainSector_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (MainSector.SelectedValue != "")
        {
            if (MainYear.SelectedValue != "0")
            {
                MainDepart.Items.Clear();

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

                MainDepart.DataTextField  = "AdmName";
                MainDepart.DataValueField = "AdmID";
                MainDepart.DataBind();
                ListItem aa = new ListItem();
                aa.Text  = "اختر الادارة";
                aa.Value = "0";

                MainDepart.Items.Insert(0, aa);
            }
            else
            {
                MainDepart.Items.Clear();

                MainDepart.DataSource = Obj.GetDataSetByID("GetAdministrations", Convert.ToInt32(MainSector.SelectedValue));

                MainDepart.DataTextField  = "AdmName";
                MainDepart.DataValueField = "AdmID";
                MainDepart.DataBind();
                ListItem aa = new ListItem();
                aa.Text  = "اختر الادارة";
                aa.Value = "0";

                MainDepart.Items.Insert(0, aa);
            }
        }
    }
Exemplo n.º 6
0
    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();
                }

            }
        }
    }