Example #1
0
        private void FillControls()
        {
            if (DropDay.Items.Count > 1)
            {
                return;
            }
            List <int>    years = new List <int>();
            List <string> days  = new List <string>();

            for (int i = DateTime.Now.Year - 1; i > DateTime.Now.Year - 100; i--)
            {
                years.Add(i);
            }
            if (DateTimeFormatInfo.CurrentInfo != null)
            {
                DropMonth.DataSource = DateTimeFormatInfo.CurrentInfo.MonthNames;
                DropMonth.DataBind();
            }
            for (int i = 1; i <= 31; i++)
            {
                string day = ((i < 10) ? "0" : "") + i;
                days.Add(day);
            }
            DropDay.DataSource = days;
            DropDay.DataBind();

            DropYear.DataSource = years;
            DropYear.DataBind();
        }
Example #2
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 (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");
                }
            }
        }
    }
Example #3
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) || (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 Sections 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";


                    Admins.DataSource     = Obj.GetDataSet("GetSectionsDashboard");
                    Admins.DataTextField  = "SectionName";
                    Admins.DataValueField = "SectionID";
                    Admins.DataBind();

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

                    Admins.Items.Insert(0, aaSection);
                }

                else
                {
                    Response.Redirect("NoPermissions.aspx");
                }
            }
        }
    }
    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();
            }
        }
    }
Example #5
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
        { }
    }
Example #6
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();
            }
        }
    }
Example #7
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();
            }
        }
    }