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; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Calendar1.DataBind(); Calendar2.DataBind(); Fill(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Calendar1.DataBind(); Calendar2.DataBind(); Calendar1.SelectedDate = DateTime.Now; FillDropDownList(); } }
private void calendarMenuItem_Click(object sender, EventArgs e) { if (this.calendar_wind == null) { this.calendar_wind = new Calendar2(this); this.calendar_wind.MdiParent = this; this.calendar_wind.Show(); } else { this.calendar_wind.Activate(); } }
public CustomDateEvent2(MainForm main_form, Calendar2 calendar, DateTime date, int current_month, List <AbsentVM> absent_list, List <Istab> absent_cause, List <TrainingCalendar> trainer_list, NoteCalendar note, List <Users> users_list, int max_leave) { //Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); InitializeComponent(); this.main_form = main_form; this.date = date; this.current_month = current_month; this.absent_list = absent_list; this.absent_cause = absent_cause; this.trainer_list = trainer_list; this.note = note; this.users_list = users_list; this.max_leave = max_leave; this.calendar = calendar; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["id"] != null || Request.QueryString["view"] != null) { Calendar1.DataBind(); Calendar2.DataBind(); int idd = 0; if (Request.QueryString["id"] != null) { idd = int.Parse(Request.QueryString["id"]); } else { idd = int.Parse(Request.QueryString["view"]); } AbsenceAlert absence = (from k in km.AbsenceAlerts where k.Id == idd select k).FirstOrDefault(); var emp = (from k in km.Employees where k.IdentityNumber == absence.EmployeeId select k).FirstOrDefault(); lblEmpName.Text = emp.Name; lblIdentity.Text = emp.IdentityNumber; lblfrom.Text = MyDate.getDate(absence.DateFrom + ""); lblto.Text = MyDate.getDate(absence.DateTo + ""); lblCount.Text = absence.count + ""; if (Request.QueryString["view"] != null) { btnAdd.Visible = false; Calendar1.Visible = false; Calendar2.Visible = false; txtDateReplay.Text = MyDate.getDate(absence.DecisionDate + ""); txtDateReplayEmp.Text = MyDate.getDate(absence.ReplyDate + ""); txtReson.Text = absence.Reason; txtDateReplay.Enabled = false; txtDateReplayEmp.Enabled = false; txtReson.Enabled = false; lstDecition.SelectedValue = absence.Decision; lstDecition.Enabled = false; } } } }
protected void ImageButton15_Click(object sender, ImageClickEventArgs e) { Calendar2.Visible = !Calendar2.Visible; Calendar2.Focus(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { OnlineSchoolEntities km = new OnlineSchoolEntities(); var yearH = (from k in km.Semesters orderby k.Id descending select k.YearH).FirstOrDefault(); txtYear.Text = yearH + "-" + (yearH + 1) + " هـ "; var yearM = (from k in km.Semesters orderby k.Id descending select k.YearM).FirstOrDefault(); txtYearM.Text = yearM + "-" + (yearM + 1) + " م "; DDLSemester.SelectedValue = MyDate.getCurrentSemesterNumber().ToString(); ddlSemesters.SelectedValue = MyDate.getCurrentSemesterNumber().ToString(); ddlYear.SelectedValue = txtYear.Text; Calendar1.DataBind(); Calendar2.DataBind(); Calendar3.DataBind(); var start = MyDate.getCurrentSemesteStartDate().Split(' ').FirstOrDefault(); if (start != null) { txtStart.Text = start; } var culture = MyDate.getDateCulture(); if (culture == "ar-EG") { radioDate.SelectedValue = "False"; } else { radioDate.SelectedValue = "True"; } lstSemesters.DataBind(); ddlYear.DataBind(); var end = MyDate.getCurrentSemesteEndDate(); if (end != null) { txtEnd.Text = end; } Week week = (from k in km.Weeks where k.Id == 1 select k).FirstOrDefault(); txtStartDate.Text = MyDate.getDate(week.startDate.ToString()); for (int i = 2; i <= 21; ++i) { var lblname = "lblDateWeek" + (i); Label lbl = (Label)Panel2.FindControl(lblname); DropDownList ddl = (DropDownList)Panel2.FindControl("DropDownList" + i); ddl.DataBind(); week = (from k in km.Weeks where k.Id == i select k).FirstOrDefault(); lbl.Text = MyDate.getDate(week.startDate.ToString()); ddl.SelectedValue = week.type.ToString(); } } if (Request.QueryString["Date"] == "Ok") { ClientScript.RegisterStartupScript(this.GetType(), "openModal", "<script> addSuccess(' تم تعديل التاريخ بنجاح'); </script>", false); } }