Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     CheckAccount();
     if (!IsPostBack)
     {
         App_Code.Base db = new App_Code.Base(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());
         List <string> ls = db.GetIdUMbyName(User.Identity.Name);
         IdUM.DataSource = ls;
         IdUM.DataBind();
         if (ls.Count > 0)
         {
             IdUM.SelectedIndex = 0;
         }
         IdUM_SelectedIndexChanged(sender, e);
         // показ заявок на странице:  VseRaboty(sender, e);
     }
 }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _role = CheckAccount();
     if (_role == "Worker")
     {
         phPost.Visible = false;
         if (!IsPostBack)
         {
             App_Code.Base db1  = new App_Code.Base(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());
             List <string> _wrk = new List <string>();
             _wrk = db1.GetIdUMbyName(User.Identity.Name);
             DdlSklad.DataSource = _wrk;
             DdlSklad.DataBind();
         }
         SkladVvod.Text = DdlSklad.SelectedValue;
         App_Code.Base db = new App_Code.Base(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());
         _workers = db.GetWorkers();
         if (!IsPostBack)
         {
             DdlSklad1.DataSource = _workers;
             DdlSklad1.DataBind();
             DdlSklad1.SelectedIndex = 0;
         }
     }
     else
     {
         if (!IsPostBack)
         {
             List <string> dt = new List <string>()
             {
                 "", "1/1", "1/2", "1/3", "1/4", "2/1", "2/2", "2/3", "2/4", "2/5", "4/1", "4/2", "все"
             };
             DdlSklad.DataSource = dt;
             DdlSklad.DataBind();
             SkladVvod.Text = DdlSklad.SelectedValue;
         }
         App_Code.Base db = new App_Code.Base(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());
         _workers = db.GetWorkers();
         if (!IsPostBack)
         {
             DdlSklad1.DataSource = _workers;
             DdlSklad1.DataBind();
             DdlSklad1.SelectedIndex = 0;
         }
     }
 }