Summary description for MyClass
示例#1
0
    protected void LstOutcoming_DataBinding(object sender, EventArgs e)
    {
        OnlineSchoolEntities km = new OnlineSchoolEntities();
        var schoolId            = new SchoolInformation().getId();
        var semesterId          = MyDate.getCurrentSemesterId();

        var Outcoming = (from I in km.Outcomings
                         join p in km.Schools on I.SchoolId equals p.Id
                         where I.SchoolId == schoolId && I.IsDeleted != true && I.SemesterId == semesterId
                         orderby I.Id descending
                         select new
        {
            I.Date,
            I.Number,
            I.FileNumber,
            SourceTo = (from c in km.Constants where c.Id == I.SourceTo select c.value).FirstOrDefault(),
            I.Subject,
            Type = (from c in km.Constants where c.Id == I.Type select c.value).FirstOrDefault(),
            Attachment = (from c in km.Constants where c.Id == I.Type select c.value).FirstOrDefault(),
            I.Id,
        }).ToList();

        LstOutcoming.DataSource = Outcoming;
        LstOutcoming.DataBind();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        SchoolInformation info = new SchoolInformation();
        var schoolid           = info.getId();
        var semesterid         = MyDate.getCurrentSemesterId();

        OnlineSchoolEntities km = new OnlineSchoolEntities();
        var studentlist         = (from k in km.StudentsSubjects
                                   join s in km.SubjectsInSemesters on k.SubjectId equals s.Id
                                   join x in km.Students on k.StudentId equals x.IdentityNumber
                                   where s.SchoolId == schoolid && s.SemesterId == semesterid
                                   orderby x.Name
                                   select new
        {
            stdId = x.Id,
            Name = x.Name,
            x.IdentityNumber,
            subject = (from m in km.Subjects where m.Id == s.SubjectId select m.Name).FirstOrDefault(),
            rate = k.Rate
        }
                                   ).ToList();

        ListView1.DataSource = studentlist;
        ListView1.DataBind();
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        OnlineSchoolEntities km = new OnlineSchoolEntities();
        Week week = (from k in km.Weeks where k.Id == 1 select k).FirstOrDefault();

        //   week.startDate = Convert.ToDateTime(txtStartDate.Text);
        if (MyDate.getDateCulture() == "ar-EG")
        {
            week.startDate = DateTime.ParseExact(txtStartDate.Text, "yyyy/MM/dd", new CultureInfo("ar-EG"));
        }
        else
        {
            week.startDate = MyDate.convertHijriToGregorian(txtStartDate.Text);
        }

        for (int i = 2; i <= 21; ++i)
        {
            var          lblname = "lblDateWeek" + (i);
            Label        lbl     = (Label)Panel2.FindControl(lblname);
            DropDownList ddl     = (DropDownList)Panel2.FindControl("DropDownList" + i);
            week = (from k in km.Weeks where k.Id == i select k).FirstOrDefault();

            if (MyDate.getDateCulture() == "ar-EG")
            {
                week.startDate = DateTime.ParseExact(lbl.Text, "yyyy/MM/dd", new CultureInfo("ar-EG"));
            }
            else
            {
                week.startDate = MyDate.convertHijriToGregorian(lbl.Text);
            }
            week.type = int.Parse(ddl.SelectedValue);
        }

        km.SaveChanges();
    }
示例#4
0
    protected void LstOutcoming_DataBinding(object sender, EventArgs e)
    {
        OnlineSchoolEntities km = new OnlineSchoolEntities();
        var schoolId            = new SchoolInformation().getId();
        int semesterId          = MyDate.getCurrentSemesterId();

        var Outcoming = (from O in km.Outcomings
                         where O.IsDeleted != true &&
                         O.ReceivedDate != null && O.SemesterId == semesterId &&
                         O.SchoolId == schoolId
                         select new
        {
            O.Number,
            O.Date,
            O.Type,
            O.Attachment,
            O.Subject,
            O.SourceTo,
            O.ReceivedName,
            O.ReceivedDate,
            O.Id,
        }).ToList();

        LstOutcoming.DataSource = Outcoming;
        LstOutcoming.DataBind();
    }
    public static bool TryParse(string input, out MyDate result)
    {
        Match match = dtRegex.Match(input);

        result = default(MyDate);

        if (match.Success)
        {
            if (match.Groups["year"].Success)
            {
                result.Year = Int32.Parse(match.Groups["year"].Value);
            }
            if (match.Groups["month"].Success)
            {
                result.Month = Int32.Parse(match.Groups["month"].Value);
            }
            if (match.Groups["day"].Success)
            {
                result.Day = Int32.Parse(match.Groups["day"].Value);
            }
            if (match.Groups["hour"].Success)
            {
                result.Hour = Int32.Parse(match.Groups["hour"].Value);
            }
            if (match.Groups["minute"].Success)
            {
                result.Minute = Int32.Parse(match.Groups["minute"].Value);
            }
        }

        return(match.Success);
    }
示例#6
0
    protected void lstBorrow_DataBinding(object sender, EventArgs e)
    {
        OnlineSchoolEntities km   = new OnlineSchoolEntities();
        SchoolInformation    info = new SchoolInformation();

        var schoolId   = info.getId();
        var semesterId = MyDate.getCurrentSemesterId();

        ltrSecretaryLearningResourceCenter.Text = info.getLearningResources();

        var preInfo = (from k in km.BorrowsofEmployees
                       join ee in km.Employees on k.EmployeeId equals ee.IdentityNumber
                       where k.SchoolId == schoolId && k.SemesterId == semesterId
                       orderby k.DateReturn, k.DateBorrow
                       select new
        {
            ee.Name,
            k.DateReturn,
            k.DateBorrow,
            k.BookId,
            auther = (from b in km.Books where b.Id == k.BookId select b.Auther).FirstOrDefault(),
            bookname = (from b in km.Books where b.Id == k.BookId select b.Title).FirstOrDefault(),
            k.isReturn
        }).ToList();

        lstBorrow.DataSource = preInfo;
        lstBorrow.DataBind();
    }
示例#7
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        Communication communucation = new Communication();

        if (!String.IsNullOrEmpty(txtContactNo.Text))
        {
            communucation.ContactNo = txtContactNo.Text;
        }


        int SchoolID = SchoolInfo.getId();

        communucation.SchoolId = SchoolID;

        communucation.SemesterId = MyDate.getCurrentSemesterId();

        TimeSpan Timee = Convert.ToDateTime(txtTime.Text).TimeOfDay;

        communucation.Time = Timee;

        if (!String.IsNullOrEmpty(txtReason.Text))
        {
            communucation.Reason = txtReason.Text;
        }

        if (!String.IsNullOrEmpty(txtReply.Text))
        {
            communucation.Reply = txtReply.Text;
        }

        km.Communications.Add(communucation);
        km.SaveChanges();
        ClientScript.RegisterStartupScript(this.GetType(), "openModal", "<script> addSuccess(' !! تمت الاضافة بنجاح'); </script>", false);
    }
示例#8
0
    protected void btnLate_Click(object sender, EventArgs e)
    {
        var schoolId   = info.getId();
        var semesterId = MyDate.getCurrentSemesterId();
        //     var LibrarianId = info.getSchoolLibrarian();

        var preInfo = (from k in km.BorrowsofEmployees
                       join emp in km.Employees on k.EmployeeId equals emp.IdentityNumber
                       where k.SchoolId == schoolId && k.SemesterId == semesterId &&
                       k.isReturn == false && k.DateReturn < DateTime.Now
                       orderby k.DateReturn, k.DateBorrow
                       select new
        {
            emp.Name,
            k.DateReturn,
            k.DateBorrow,
            k.BookId,
            auther = (from b in km.Books where b.Id == k.BookId select b.Auther).FirstOrDefault(),
            bookname = (from b in km.Books where b.Id == k.BookId select b.Title).FirstOrDefault(),
            k.isReturn
        }).ToList();

        LstEmployeeBorrow.DataSource = preInfo;
        LstEmployeeBorrow.DataBind();
    }
示例#9
0
 private void releasDayd(HostingUnit unit, GuestRequest req)
 {
     for (MyDate temp = Cloning.Clone(req.EntryDate); temp.CompareTo(req.ReleaseDate) != 0; temp.addDays(1))
     {
         unit.Diary[temp] = false;
     }
 }
示例#10
0
        public IEnumerable <HostingUnit> getEmptyUnits(MyDate date, int numOfDays)
        {
            MyDate last = Cloning.Clone(date);

            last.addDays(numOfDays);
            return(dal.getAllUnits().Where(unit => unit.checkEmpty(date, last)));
        }
示例#11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //    MyDate mydate = new MyDate();
        if (!IsPostBack)
        {
            var schoolid   = new SchoolInformation().getId();
            var semesterid = MyDate.getCurrentSemesterId();

            lbldate.Text = "التاريخ: " + MyDate.getHijriDate();
            lblDay.Text  = "اليوم: " + MyDate.getDay();

            ddlClass.DataSource = (from k in km.SubjectsInSemesters where
                                   k.SchoolId == schoolid && k.SemesterId == semesterid
                                   orderby k.ClassId
                                   select k.ClassId).ToList().Distinct();
            ddlClass.DataBind();


            ddlSubject.DataBind();
            SchoolInformation info = new SchoolInformation();
            //     var schoolid = info.getId();
            var lstStudents = (from k in km.Students
                               where k.SchoolId == schoolid
                               select new
            {
                k.IdentityNumber,
                k.Name
            }).ToList();
            ListView1.DataSource = lstStudents;
            ListView1.DataBind();
        }
        // VisiblePlaceHolder();
    }
示例#12
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnView_Click(object sender, EventArgs e)
    {
        var classid    = ddlClass.SelectedValue;
        var subjectid  = (from k in km.Subjects where k.Name == ddlSubject.SelectedValue select k.Id).FirstOrDefault();
        var schoolid   = new SchoolInformation().getId();
        var semesterid = MyDate.getCurrentSemesterId();

        var subject = (from k in km.SubjectsInSemesters
                       where k.SchoolId == schoolid && k.SemesterId == semesterid &&
                       k.SubjectId == subjectid && k.ClassId == classid
                       select k
                       ).FirstOrDefault();

        var lstStudent = (from k in km.StudentsSubjects
                          join
                          s in km.Students on k.StudentId equals s.IdentityNumber
                          where k.SubjectId == subject.Id
                          orderby s.Name
                          select new
        {
            s.Name,
            s.Id,
            s.IdentityNumber
        }).ToList();

        ListView1.DataSource = lstStudent;
        ListView1.DataBind();
    }
示例#13
0
    protected void LstEmployee_DataBinding(object sender, EventArgs e)
    {
        OnlineSchoolEntities km = new OnlineSchoolEntities();
        var schoolId            = new SchoolInformation().getId();
        var semesterId          = MyDate.getCurrentSemesterId();

        var    isSeen = (from m in km.UsersGeneralizations select m.isSeen).FirstOrDefault();
        string IsSeenn;

        if (isSeen == false)
        {
            IsSeenn = "لا";
        }

        else
        {
            IsSeenn = "نعم";
        }


        var emp = (from k in km.UsersGeneralizations

                   select new
        {
            IsSeenn,
            EmployeeName = (from m in km.Employees where m.IdentityNumber == k.UserId select m.Name).FirstOrDefault()
        }).ToList();

        LstEmployee.DataSource = emp;
        LstEmployee.DataBind();
    }
示例#14
0
 public int Create(TaskChange entity)
 {
     entity.Id         = changes.Keys.Count == 0 ? 1 : changes.Keys.Max() + 1;
     entity.ChangeDate = MyDate.GetDate();
     changes.Add(entity.Id, entity);
     return(entity.Id);
 }
示例#15
0
    protected void lstPatients_DataBinding(object sender, EventArgs e)
    {
        var schoolid   = info.getId();
        int semesterid = MyDate.getCurrentSemesterId();


        var RepInfo = (from ep in km.StudentPatients
                       join ee in km.Students on ep.StudentId equals ee.IdentityNumber
                       where ep.SemesterId == semesterid && ep.SchoolId == schoolid
                       orderby ep.Class descending
                       select new
        {
            ee.Name,
            ep.Action,
            ep.Class,
            ep.Description,
            ep.HomeTel,
            ep.Id,
            ep.Mobile,
            ep.Recommendations,
            ep.WorkTel,
        }).ToList();

        lstPatients.DataSource = RepInfo;
        lstPatients.DataBind();
    }
示例#16
0
        public void AddCompletedTask(int reportId, int taskId)
        {
            if (!taskService.CheckExistence(taskId))
            {
                throw new NonexistentTask();
            }
            TaskDTO taskDto = taskService.Get(taskId);

            if (taskDto.Status != Task.TaskStatus.Resolved)
            {
                throw new NonresolvedTask();
            }
            ReportDTO reportDto = ConvertDalToBbl(repository.GetById(reportId));

            if (MyDate.GetDate().Day != reportDto.CreationDate.Day ||
                MyDate.GetDate().Month != reportDto.CreationDate.Month ||
                MyDate.GetDate().Year != reportDto.CreationDate.Year)
            {
                throw new TaskTimeIsOver();
            }
            if (reportDto.GetCompletedTasks().Contains(taskId))
            {
                throw new TaskAlreadyCompleted();
            }
            reportDto.AddCompletedTask(taskId);
            repository.Update(ConvertBblToDal(reportDto));
        }
    protected void lstObligation_ItemDataBound(object sender, ListViewItemEventArgs e)
    {
        LinkButton       lnkReceive  = (LinkButton)(e.Item.FindControl("lnkReceive"));
        Label            lblReceived = (Label)(e.Item.FindControl("lblReceived"));
        ListViewDataItem dataItem    = (ListViewDataItem)e.Item;
        //      int obligationID = int.Parse(((HiddenField)(e.Item.FindControl("obligationID"))).Value);

        var dateReceive = DataBinder.Eval(e.Item.DataItem, "DateReceive");

        if (e.Item.ItemType == ListViewItemType.DataItem)
        {
            //            var obligation = (from j in km.Obligations where j.Id == idd select j).FirstOrDefault();


            if (dateReceive == null)
            {
                lnkReceive.Visible = true;
            }
            else
            {
                lblReceived.Text   = MyDate.getDate(dateReceive.ToString());
                lnkReceive.Visible = false;
            }
        }
        lstObligation.DataBind();
    }
示例#18
0
    public void FillDropDownList()
    {
        if (!IsPostBack)
        {
            int schoolId    = SchoolInfo.getId();
            int semesterId  = MyDate.getCurrentSemesterId();
            var lststudents = (from k in km.Students where k.SchoolId == schoolId select k).ToList();

            ddlClass.DataSource = (from k in km.SubjectsInSemesters where k.SchoolId == schoolId && k.SemesterId == semesterId orderby k.ClassId select k.ClassId).Distinct().ToList();
            ddlClass.DataBind();

            ddlSubject.DataSource = (from k in km.SubjectsInSemesters join s in km.Subjects on k.SubjectId equals s.Id where k.SchoolId == schoolId && k.SemesterId == semesterId orderby s.Name select s).Distinct().ToList();
            ddlSubject.DataBind();

            ddlSpecification.DataSource = (from k in lststudents orderby k.Specification select k.Specification).Distinct().ToList();
            ddlSpecification.DataBind();

            ddlYear.DataSource = (from k in lststudents where k.Id != null orderby k.Id select(k.Id / 1000)).Distinct().ToList();
            ddlYear.DataBind();

            ddlStdNumber.DataSource = (from k in lststudents where k.Id != null orderby k.Id select k).ToList();
            ddlStdNumber.DataBind();

            ddlName.DataSource = lststudents;
            ddlName.DataBind();
        }
    }
示例#19
0
    protected void btnShow_Click(object sender, EventArgs e)
    {
        DateTime DateFrom = new DateTime(), DateTo = new DateTime();

        if (Calendar1.CultureName == "ar-SA")
        {
            DateFrom = MyDate.convertHijriToGregorian(DatePickerFrom.Text);
            DateTo   = MyDate.convertHijriToGregorian(DatePickerTo.Text);
        }
        else
        {
            DateFrom = DateTime.ParseExact(DatePickerFrom.Text, "yyyy/MM/dd", CultureInfo.CreateSpecificCulture("ar-EG"));
            DateTo   = DateTime.ParseExact(DatePickerTo.Text, "yyyy/MM/dd", CultureInfo.CreateSpecificCulture("ar-EG"));
        }
        var semesterId = MyDate.getCurrentSemesterId();
        var schoolId   = info.getId();

        var preInfo = (from ep in km.StudentsPermissions
                       join emp in km.Students on ep.StudentId equals emp.IdentityNumber
                       where ep.SemesterId == semesterId && ep.SchoolId == schoolId && ep.Date >= DateFrom && ep.Date <= DateTo
                       orderby ep.Date descending
                       select new
        {
            emp.Name,
            ep.Reason,
            ep.TimeFrom,
            ep.ParentName,
            ep.Date,
            ep.Class,
            ep.Comments
        }).ToList();

        lstPermission.DataSource = preInfo;
        lstPermission.DataBind();
    }
示例#20
0
 public int Create(Report entity)
 {
     entity.Id           = reports.Keys.Count == 0 ? 1 : reports.Keys.Max() + 1;
     entity.CreationDate = MyDate.GetDate();
     reports.Add(entity.Id, entity);
     return(entity.Id);
 }
示例#21
0
 public void ПроверкаВисокосностиГодов()
 {
     Assert.AreEqual(MyDate.IsYearLeap(2015), false);
     Assert.AreEqual(MyDate.IsYearLeap(2000), true);
     Assert.AreEqual(MyDate.IsYearLeap(1900), false);
     Assert.AreEqual(MyDate.IsYearLeap(2008), true);
 }
    public void FillByLevel()
    {
        var semesterId = MyDate.getCurrentSemesterId();
        //DateTime DateFrom = Convert.ToDateTime(txtDateFrom.Text);
        //DateTime DateTo = Convert.ToDateTime(txtDateTo.Text);

        DateTime DateFrom = new DateTime(), DateTo = new DateTime();

        if (CalendarTo.CultureName == "ar-SA")
        {
            DateFrom = MyDate.convertHijriToGregorian(txtDateFrom.Text);
            DateTo   = MyDate.convertHijriToGregorian(txtDateTo.Text);
        }
        else
        {
            DateFrom = DateTime.ParseExact(txtDateFrom.Text, "yyyy/MM/dd", CultureInfo.CreateSpecificCulture("ar-EG"));
            DateTo   = DateTime.ParseExact(txtDateTo.Text, "yyyy/MM/dd", CultureInfo.CreateSpecificCulture("ar-EG"));
        }
        int SchoolID    = info.getId();
        var LatenessEmp = (from k in km.StudentsLatenesses
                           join p in km.Students on k.StudentId equals p.IdentityNumber
                           where k.SemesterId == semesterId && k.SchoolId == SchoolID && k.Date >= DateFrom && k.Date <= DateTo
                           orderby k.Date descending
                           select new
        {
            p.Name,
            k.Date,
            k.Amount
        }).ToList();

        lstLateness.DataSource = LatenessEmp;
        lstLateness.DataBind();
    }
    public void FillByDate()
    {
        var semesterId = MyDate.getCurrentSemesterId();

        DateTime Today = DateTime.Now.Date;

        int SchoolID = info.getId();

        var LatenessEmp = (from k in km.Absences
                           join p in km.Employees on k.EmployeeId equals p.IdentityNumber
                           where k.SemesterId == semesterId && k.SchoolId == SchoolID && k.Date == Today
                           orderby k.Date descending
                           select new
        {
            k.Id,
            p.Name,
            k.Date,
            k.Type,
            alertId = k.AlertId,
            Reason = ((from alert in km.AbsenceAlerts where alert.Id == k.AlertId select alert.Reason).FirstOrDefault()),
            isReply = ((from alert in km.AbsenceAlerts where alert.Id == k.AlertId select alert.Decision).FirstOrDefault()) == null
        }).ToList();

        lstLateness.DataSource = LatenessEmp;
        lstLateness.DataBind();
    }
示例#24
0
    protected void lstBorrow_DataBinding(object sender, EventArgs e)
    {
        OnlineSchoolEntities km   = new OnlineSchoolEntities();
        SchoolInformation    info = new SchoolInformation();

        ltrYear.Text     = " " + (from k in km.Semesters where k.IsCurrent == true select k.YearH).FirstOrDefault().ToString();
        ltrSemester.Text = " " + MyDate.getCurrentSemester();
        ltrSecretaryResourceCenter.Text = info.getLearningResources();
        var schoolId   = info.getId();
        var semesterId = MyDate.getCurrentSemesterId();
        //   var LibrarianId = info.getSchoolLibrarian();

        var preInfo = (from k in km.BorrowsofStudents
                       join ss in km.Students on k.StudentId equals ss.IdentityNumber
                       where k.SchoolId == schoolId && k.SemesterId == semesterId
                       orderby k.DateBorrow
                       select new
        {
            ss.Name,
            k.DateReturn,
            k.DateBorrow,
            k.BookId,
            ss.Class,
            auther = (from b in km.Books where b.Id == k.BookId select b.Auther).FirstOrDefault(),
            bookname = (from b in km.Books where b.Id == k.BookId select b.Title).FirstOrDefault(),
            k.isReturn
        }).ToList();

        lstBorrow.DataSource = preInfo;
    }
 static void Main(string[] args)
 {
     foreach (var testcase in new [] {
         "2011-11-07T11:17",
         "-11-07T11:17",
         "2011--07T11:17",
         "2011-11-T11:17",
         "2011-11-07T:17",
         "2011-11-07T11:",
         // extra:
         "--T11:17",                   // (11:17 am, no date, only time)
         "-11-07",                     // (november the 7th, no year, no time)
         // failures:
         "2011/11/07 T 11:17",
         "no match"
     })
     {
         MyDate parsed;
         if (MyDate.TryParse(testcase, out parsed))
         {
             Console.WriteLine("'{0}' -> Parsed into '{1}'", testcase, parsed);
         }
         else
         {
             Console.WriteLine("'{0}' -> Parse failure", testcase);
         }
     }
 }
示例#26
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        Laboratory laboratory = new Laboratory();

        if (txtProductNo.Text != null)
        {
            laboratory.KindId = Convert.ToInt32(txtProductNo.Text);
        }

        if (!String.IsNullOrEmpty(txtProductName.Text))
        {
            laboratory.KindName = txtProductName.Text;
        }

        if (txtAmount.Text != null)
        {
            laboratory.Quantity = Convert.ToInt32(txtAmount.Text);
        }

        if (!String.IsNullOrEmpty(txtUnit.Text))
        {
            laboratory.Unit = txtUnit.Text;
        }

        if (!String.IsNullOrEmpty(txtNote.Text))
        {
            laboratory.Comment = txtNote.Text;
        }

        laboratory.SchoolId   = new SchoolInformation().getId();
        laboratory.SemesterId = MyDate.getCurrentSemesterId();
        onlineSchool.Laboratories.Add(laboratory);
        onlineSchool.SaveChanges();
        PlaceHolderSuccess.Visible = true;
    }
    public void FillByDate()
    {
        DatePickerFrom.Text = "";
        DatePickerTo.Text   = "";

        var      semesterId  = MyDate.getCurrentSemesterId();
        DateTime Today       = DateTime.Now.Date;
        int      SchoolID    = info.getId();
        var      LatenessEmp = (from k in km.Latenesses
                                join p in km.Employees on k.EmployeeId equals p.IdentityNumber
                                where k.SemesterId == semesterId && k.SchoolId == SchoolID && k.Date == Today
                                orderby k.Date descending
                                select new
        {
            k.Id,
            p.Name,
            k.Date,
            k.Amount,
            isReply = ((from alert in km.LatenessAlerts where alert.LatenessId == k.Id select alert).FirstOrDefault()) == null,

            Latetype = (from x in km.Constants where x.Id == k.Type select x.value).FirstOrDefault()
        }).ToList();

        lstLateness.DataSource = LatenessEmp;
        lstLateness.DataBind();
    }
示例#28
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        int idd = int.Parse(Request.QueryString["id"]);

        LatenessAlert alert = new LatenessAlert();

        alert.LatenessId = idd;
        alert.Reason     = txtExecuse.Text;
        alert.isAccepted = Convert.ToBoolean(RadioButtonList1.SelectedValue);

        if (Calendar1.CultureName == "ar-SA")
        {
            alert.ReplyDate  = MyDate.convertHijriToGregorian(txtDateReplayEmp.Text);
            alert.AcceptDate = MyDate.convertHijriToGregorian(txtAcceptDate.Text);
        }
        else
        {
            alert.ReplyDate  = DateTime.ParseExact(txtDateReplayEmp.Text, "yyyy/MM/dd", CultureInfo.CreateSpecificCulture("ar-EG"));
            alert.AcceptDate = DateTime.ParseExact(txtAcceptDate.Text, "yyyy/MM/dd", CultureInfo.CreateSpecificCulture("ar-EG"));
        }

        km.LatenessAlerts.Add(alert);
        km.SaveChanges();
        ClientScript.RegisterStartupScript(this.GetType(), "openModal", "<script> openModal(); </script>", false);
    }
示例#29
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Calendar1.DataBind();
            Calendar2.DataBind();

            if (Request.QueryString["id"] != null)
            {
                int    idd      = int.Parse(Request.QueryString["id"]);
                string type     = Request.QueryString["type"];
                var    schoolId = info.getId();

                Employee emp = new Employee();

                #region

                var late = (from k in km.Latenesses where k.Id == idd select k).FirstOrDefault();

                emp = (from k in km.Employees where k.IdentityNumber == late.EmployeeId select k).FirstOrDefault();


                if (late.Type == (ConstantManager.getConstantId("تأخر صباحي")))
                {
                    TimeSpan amount        = (TimeSpan)late.Amount;
                    TimeSpan timestartwork = (TimeSpan)(from k in km.Schools where k.Id == schoolId select k.TimeStartWork).FirstOrDefault();
                    TimeSpan timearrive    = amount + timestartwork;

                    lblReson.Text = "نأخر من بداية  العمل ، والحضور الساعة " + timearrive.ToString();
                }

                else
                if (late.Type == (ConstantManager.getConstantId("انصراف مبكر")))
                {
                    TimeSpan amount    = (TimeSpan)late.Amount;
                    TimeSpan timeEnd   = (TimeSpan)(from k in km.Schools where k.Id == schoolId select k.TimeEndWork).FirstOrDefault();
                    TimeSpan timeleave = timeEnd - amount;

                    lblReson.Text = " انصراف مبكر قبل نهاية العمل من الساعة  " + timeleave.ToString();
                }
                else
                if (late.Type == (ConstantManager.getConstantId("خروج دون استئذان")))
                {
                    TimeSpan timeFrom = (TimeSpan)late.TimeFrom;
                    TimeSpan timeTo   = (TimeSpan)late.Timeto;
                    //     TimeSpan timeleave = timeEnd - amount;

                    lblReson.Text = " عدم تواجد أثناء العمل من الساعة (" + timeFrom + "إلى الساعة ( " + timeTo + ")  ";
                }

                lblDay.Text  = MyDate.getDay((DateTime)late.Date);
                lblDate.Text = MyDate.getDate(late.Date.ToString());

                #endregion

                lblEmpName.Text  = emp.Name;
                lblIdentity.Text = emp.IdentityNumber;
            }
        }
    }
示例#30
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();
            }
        }
    }
示例#31
0
 public static void Main()
 {
     string myString = "Hello";
     Console.WriteLine("MyString : {0}", myString);
     {
         MyDate myBirth = new MyDate(1971,12,11);
         Console.WriteLine("My Birthday : {0}",
                           myBirth);
     }
     {
         MyDate yourBirth;
         yourBirth = new MyDate();
         yourBirth.year = 1975;
         // yourBirth.month = 09;
         // yourBirth.day = 08;
         Console.WriteLine("Her Birthday : {0}",
                           yourBirth);
     }
 }
示例#32
0
 static void Main7()
 {
     MyDate d1 = new MyDate(12, 10, 2010);
     Console.WriteLine(d1.day);
     d1.day = 21;
 }
示例#33
0
        public string SelectAction(string id, MyDate myDate, bool bl)
        {
            StringBuilder sbBuilder = new StringBuilder();
            string check = "selected='selected'";
            DateTime dt = DateTime.Now;
            sbBuilder.Append(string.Format("<select id='{0}'  class='easyui-combobox' >", id));
            if (MyDate.DataYear == myDate)
            {

                for (int i = 0; i < Yearvalue; i++)
                {


                    string op = ((dt.Year == YearNow - i) && bl) ? check : "";
                    sbBuilder.AppendFormat("<option value='{0}' {1} >{0}年</option>\r\n", YearNow - i, op);
                }

            }
            else if (MyDate.DataJd == myDate)
            {
                int mt = dt.Month;
                string c1 = "";
                string c2 = "";
                string c3 = "";
                string c4 = "";
                if (bl)
                {
                    c1 = (mt >= 1 && mt <= 3) ? check : "";
                    c2 = (mt > 3 && mt <= 6) ? check : "";
                    c3 = (mt > 6 && mt <= 9) ? check : "";
                    c4 = (mt > 9 && mt <= 12) ? check : "";

                }

                sbBuilder.AppendFormat("<option value='{0}' {1}>{0}月</option>\r\n", "1-3", c1);
                sbBuilder.AppendFormat("<option value='{0}' {1}>{0}月</option>\r\n", "1-6", c2);
                sbBuilder.AppendFormat("<option value='{0}' {1}>{0}月</option>\r\n", "1-9", c3);
                sbBuilder.AppendFormat("<option value='{0}' {1}>{0}月</option>\r\n", "1-12", c4);

            }
            else if (MyDate.DataYue == myDate)
            {
                for (int i = 1; i <= 12; i++)
                {
                    string sd = i.ToString();
                    if (i < 10)
                    {
                        sd = "0" + i;
                    }
                    string op = ((dt.Month == i) && bl) ? check : "";
                    sbBuilder.AppendFormat("<option value='{0}' {1}>{2}月</option>\r\n", sd, op, i);
                }

            }
            sbBuilder.Append("</select>");
            return sbBuilder.ToString();
        }
示例#34
0
        /// <summary>
        /// 返回对应的select年。或者月,或者季度
        /// </summary>
        /// <param name="id"></param>
        /// <param name="myDate"></param>
        /// <returns></returns>
        public string SelectAction(string id, MyDate myDate)
        {
            StringBuilder sbBuilder = new StringBuilder();
            sbBuilder.Append(string.Format("<select id='{0}'  class='easyui-combobox' >", id));
            if (MyDate.DataYear == myDate)
            {

                for (int i = 0; i < Yearvalue; i++)
                {
                    sbBuilder.AppendFormat("<option value='{0}'>{0}年</option>\r\n", YearNow - i);
                }

            }
            else if (MyDate.DataJd == myDate)
            {
                sbBuilder.AppendFormat("<option value='{0}'>{0}月</option>\r\n", "1-3");
                sbBuilder.AppendFormat("<option value='{0}'>{0}月</option>\r\n", "1-6");
                sbBuilder.AppendFormat("<option value='{0}'>{0}月</option>\r\n", "1-9");
                sbBuilder.AppendFormat("<option value='{0}'>{0}月</option>\r\n", "1-12");

            }
            else if (MyDate.DataYue == myDate)
            {
                for (int i = 1; i <= 12; i++)
                {
                    string sd = i.ToString();
                    if (i < 10)
                    {
                        sd = "0" + i;
                    }
                    sbBuilder.AppendFormat("<option value='{0}'>{1}月</option>\r\n", sd, i);
                }

            }

            sbBuilder.Append("</select>");
            return sbBuilder.ToString();
        }
示例#35
0
 public Person(string nm,int d,int m,int y)
 {
     name = nm;
     dob = new MyDate(d,m,y);
 }
示例#36
0
 private void DatabindLiveSupportCount(MyDate md)
 {
     this.lblAccountCount.Text = md.AccountCount + "";
     this.lblVisitorCount.Text = md.VisitorCount + "";
     this.lblChatCount.Text = md.ChatCount + "";
 }
示例#37
0
 public Person()
 {
     name = "";
     dob = new MyDate();
 }