Ejemplo n.º 1
0
        DataSet MyDataSet = new DataSet();  //for pdf

        protected void Page_Load(object sender, EventArgs e)
        {
            _role = CheckAccount();

            if (!string.IsNullOrEmpty(Request["t"]))
            {
                _type = int.Parse(Request["t"]);
            }

            if (!IsPostBack)
            {
                KOS.App_Code.ClearTemp clear = new App_Code.ClearTemp(Request);
                clear.DeleteOld();

                if (_type == 0)
                {
                    Period.Visible   = true;
                    Beg.SelectedDate = DateTime.Now.AddDays(-2);
                    End.SelectedDate = DateTime.Now;
                    phReport.Visible = false;
                }
                else
                {
                    Period.Visible   = false;
                    phReport.Visible = true;
                }

                UpdateLabel();

                List <Data> data = GetData();
                Out.DataSource = data;
                Out.DataBind();
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _role     = CheckAccount();
            Date.Text = DateTime.Now.ToLongDateString();
            if (!string.IsNullOrEmpty(Request["t"]))
            {
                _type = int.Parse(Request["t"]);
            }

            if (!IsPostBack)
            {
                KOS.App_Code.ClearTemp clear = new App_Code.ClearTemp(Request);
                clear.DeleteOld();

                UpdateLabel();
                if (User.Identity.Name == "Миракс_Парк")
                {
                    ButtonReg.Visible = false;
                }
                else if (User.Identity.Name == "Корона_1")
                {
                    ButtonReg.Visible = false;
                }
                List <Data> data = GetData();
                Out.DataSource = data;
                Out.DataBind();
            }
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _role = CheckAccount();
            //   _role = "ODS";
            if (!string.IsNullOrEmpty(Request["t"]))
            {
                _type = int.Parse(Request["t"]);
            }

            if (!IsPostBack)
            {
                KOS.App_Code.ClearTemp clear = new App_Code.ClearTemp(Request);
                clear.DeleteOld();

                List <Data> data = GetData();
                Out.DataSource = data;
                Out.DataBind();
            }
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _role     = CheckAccount();
            Date.Text = DateTime.Now.ToLongDateString();
            if (!string.IsNullOrEmpty(Request["t"]))
            {
                _type = int.Parse(Request["t"]);
            }

            if (!IsPostBack)
            {
                KOS.App_Code.ClearTemp clear = new App_Code.ClearTemp(Request);
                clear.DeleteOld();

                UpdateLabel();

                List <Data> data = GetData();
                Out1.DataSource = data;
                Out1.DataBind();
            }
        }
Ejemplo n.º 5
0
        DataSet MyDataSet = new DataSet();  //for pdf

        protected void Page_Load(object sender, EventArgs e)
        {
            _role = CheckAccount();

            if (!string.IsNullOrEmpty(Request["t"]))
            {
                _type = int.Parse(Request["t"]);
            }

            if (!IsPostBack)
            {
                KOS.App_Code.ClearTemp clear = new App_Code.ClearTemp(Request);
                clear.DeleteOld();

                if (_type == 0)
                {
                    Period.Visible   = true;
                    Beg.SelectedDate = DateTime.Now.AddDays(-2);
                    End.SelectedDate = DateTime.Now;
                    phReport.Visible = false;
                }
                else
                {
                    Period.Visible   = true;
                    phReport.Visible = true;
                }

                UpdateLabel();

                List <Data> data = GetData();
                Out.DataSource = data;
                Out.DataBind();



                using (SqlConnection conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString()))
                {
                    conn.Open();

                    SqlCommand cmd = new SqlCommand();
                    //    адреса ОДС
                    if (_role == "ODS")
                    {
                        cmd = new SqlCommand("select tt.Ttx, tt.Id from Ttx tt " +
                                             "join LiftsTtx lt on lt.TtxId=tt.Id " +
                                             "join ODSLifts o on o.LiftId=lt.LiftId " +
                                             "join Users u on u.UserId=o.UserId " +
                                             "where tt.TtxTitleId=1 and u.UserName=@userName " +
                                             "group by tt.Ttx, tt.Id", conn);
                        if (User.Identity.Name == "Миракс_Парк")
                        {
                            cmd.Parameters.AddWithValue("userName", "ODS13");
                        }
                        else if (User.Identity.Name == "Корона_1")
                        {
                            cmd.Parameters.AddWithValue("userName", "ODS14");
                        }
                        else
                        {
                            cmd.Parameters.AddWithValue("userName", User.Identity.Name);
                        }
                    }
                    //      Все адреса!
                    if (_role == "Manager" || _role == "Cadry")
                    {
                        cmd = new SqlCommand("select tt.Ttx, tt.Id from Ttx tt " +
                                             "where tt.TtxTitleId=1 " +
                                             "group by tt.Ttx, tt.Id", conn);
                    }

                    List <string> adr = new List <string>()
                    {
                        "все"
                    };
                    SqlDataReader dr = cmd.ExecuteReader();

                    while (dr.Read())
                    {
                        //         addresses.Add(new ListData() { Title = dr[0].ToString(), Id = Int32.Parse(dr[1].ToString()) });
                        adr.Add(dr[0].ToString());
                    }
                    dr.Close();
                    if (!IsPostBack)
                    {
                        DropDownList3.DataSource = adr;
                        DropDownList3.DataBind();
                        DropDownList3.SelectedIndex = 0;
                    }
                }
                List <string> uslugy = new List <string>()
                {
                    "все", "Эксплуатация зданий", "Эксплуатация лифтов", "Электроснабжение", "Отопление", "Водоснабжение", "Водоотведение", "Охрана", "Клининг"
                };
                if (!IsPostBack)
                {
                    DropDownList1.DataSource = uslugy;
                    DropDownList1.DataBind();
                    DropDownList1.SelectedIndex = 0;
                    //   NLift.Text = "Внести!";
                    //   Uslugy_TextChanged(this, EventArgs.Empty);
                }
                List <string> category = new List <string>()
                {
                    "все", "застревание", "останов", "заявка", "плановые работы", "внеплановые ремонты"
                };
                if (!IsPostBack)
                {
                    DropDownList2.DataSource = category;
                }
                DropDownList2.DataBind();
                DropDownList2.SelectedIndex = 0;
            }
        }
Ejemplo n.º 6
0
        DataSet MyDataSet = new DataSet();  //for pdf

        protected void Page_Load(object sender, EventArgs e)
        {
            _role = CheckAccount();

            if (!string.IsNullOrEmpty(Request["t"]))
            {
                _type = int.Parse(Request["t"]);
            }

            if (!IsPostBack)
            {
                KOS.App_Code.ClearTemp clear = new App_Code.ClearTemp(Request);
                clear.DeleteOld();

                if (_type == 0)
                {
                    Period.Visible   = true;
                    Beg.SelectedDate = DateTime.Now.AddDays(-2);
                    End.SelectedDate = DateTime.Now;
                    phReport.Visible = false;
                }
                else
                {
                    Period.Visible   = false;
                    phReport.Visible = true;
                }

                UpdateLabel();

                List <Data> data = GetData();
                Out.DataSource = data;
                Out.DataBind();



                using (SqlConnection conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString()))
                {
                    conn.Open();

                    SqlCommand cmd;
                    //    адреса ОДС
                    {
                        cmd = new SqlCommand("select tt.Ttx, tt.Id from Ttx tt " +
                                             "join LiftsTtx lt on lt.TtxId=tt.Id " +
                                             "join ODSLifts o on o.LiftId=lt.LiftId " +
                                             "join Users u on u.UserId=o.UserId " +
                                             "where tt.TtxTitleId=1 and u.UserName=@userName " +
                                             "group by tt.Ttx, tt.Id", conn);
                        if (User.Identity.Name == "Миракс_Парк")
                        {
                            cmd.Parameters.AddWithValue("userName", "ODS13");
                        }
                        else if (User.Identity.Name == "Корона_1")
                        {
                            cmd.Parameters.AddWithValue("userName", "ODS14");
                        }
                    }

                    /*      Все адреса!
                     *    {
                     *        cmd = new SqlCommand("select tt.Ttx, tt.Id from Ttx tt " +
                     *            "where tt.TtxTitleId=1 " +
                     *            "group by tt.Ttx, tt.Id", conn);
                     *    }
                     */
                }
                List <string> uslugy = new List <string>()
                {
                    "Эксплуатация зданий", "Эксплуатация лифтов", "Электроснабжение", "Отопление", "Водоснабжение", "Водоотведение", "Охрана", "Клининг"
                };
                if (!IsPostBack)
                {
                    DropDownList1.DataSource = uslugy;
                    DropDownList1.DataBind();
                    DropDownList1.SelectedIndex = 0;

                    Uslugy_TextChanged(this, EventArgs.Empty);
                }
            }
        }