protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         LstClass.DataBind();
     }
 }
Пример #2
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        var idd    = int.Parse(Request.QueryString["id"]);
        var period = int.Parse(ddlClassNumber.SelectedValue);
        OnlineSchoolEntities km = new OnlineSchoolEntities();

        var wait = new EmployeeWaiting();

        var Exist = (from k in km.EmployeeWaitings where k.AbsenceId == idd && k.Period == period select k).FirstOrDefault();

        if (Exist != null)
        {
            wait = Exist;
        }

        wait.Period     = int.Parse(ddlClassNumber.SelectedValue);
        wait.ClassRoom  = txtClass.Text;
        wait.Do         = txtDo.Text;
        wait.EmployeeId = ddlEmployee.SelectedValue;
        wait.Comment    = txtComments.Text;
        wait.AbsenceId  = idd;
        wait.Subject    = txtSubject.Text;
        if (Exist == null)
        {
            km.EmployeeWaitings.Add(wait);
        }
        km.SaveChanges();

        LstClass.DataBind();
    }
Пример #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["id"] != null)
            {
                var idd = int.Parse(Request.QueryString["id"]);
                SchoolInformation info = new SchoolInformation();
                var schoolid           = info.getId();

                OnlineSchoolEntities km = new OnlineSchoolEntities();

                var absent = (from k in km.Absences where k.Id == idd select k).FirstOrDefault();

                lblDate.Text    = MyDate.getDate(absent.Date + "");
                lblEmpName.Text = (from k in km.Employees where k.IdentityNumber == absent.EmployeeId select k.Name).FirstOrDefault();


                var lstEmployee = (from k in km.Teachers where k.IdentityNumber != absent.EmployeeId && k.SchoolId == schoolid select k).ToList();
                ddlEmployee.DataSource = lstEmployee;
                ddlEmployee.DataBind();

                LstClass.DataBind();
            }
        }
    }
Пример #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ltrSchoolYear.Text     = MyDate.getCurrentYear();
         ltrSchoolSemester.Text = MyDate.getCurrentSemester();
         LstClass.DataBind();
         ltrAffairsSignature.Text = info.getUndersecretaryEducationalAffairs();
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.QueryString["id"] != null)
     {
         if (!IsPostBack)
         {
             LstClass.DataBind();
         }
     }
 }
    protected void LstClass_ItemCommand(object sender, ListViewCommandEventArgs e)
    {
        if (e.CommandName == "del")
        {
            var idd        = int.Parse(e.CommandArgument.ToString());
            var permission = (from k in km.PermissionsClasses where k.Id == idd select k).FirstOrDefault();

            km.PermissionsClasses.Remove(permission);
            km.SaveChanges();
            LstClass.DataBind();
        }
    }
    protected void LstClass_ItemCommand(object sender, ListViewCommandEventArgs e)
    {
        if (e.CommandName == "del")
        {
            var idd  = int.Parse(e.CommandArgument.ToString());
            var wait = (from k in km.EmployeeWaitings where k.Id == idd select k).FirstOrDefault();

            km.EmployeeWaitings.Remove(wait);
            km.SaveChanges();
            LstClass.DataBind();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            FillDropEmp();
            if (Request.QueryString["id"] != null)
            {
                var idd = int.Parse(Request.QueryString["id"]);
                SchoolInformation info = new SchoolInformation();
                var schoolid           = info.getId();

                OnlineSchoolEntities km = new OnlineSchoolEntities();

                var permission = (from k in km.Permissions where k.Id == idd select k).FirstOrDefault();

                lblDate.Text    = MyDate.getDate(permission.Date + "");
                lblEmpName.Text = (from k in km.Employees where k.IdentityNumber == permission.EmployeeId select k.Name).FirstOrDefault();
                lblFrom.Text    = permission.TimeFrom.ToString();
                lblTo.Text      = permission.TimeTo.ToString();
                ltrReason.Text  = permission.Reason;
                //ddlEmpName.SelectedValue= permission.EmployeeId;
                var lstEmployee = (from k in km.Employees where k.IdentityNumber != permission.EmployeeId && k.SchoolId == schoolid select k).ToList();
                ddlEmployee.DataSource = lstEmployee;
                ddlEmployee.DataBind();
                LstClass.DataBind();
            }
            else
            {
                txtReson.Visible = true;

                Label6.Visible     = false;
                Label10.Visible    = false;
                Label1.Visible     = false;
                ddlEmpName.Visible = true;
            }
        }
    }