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 override void OnPreRender(EventArgs e) { if (!IsPostBack) { if (((DateTime?)FieldValue).HasValue) { Calendar1.SelectedDate = ((DateTime?)FieldValue).Value; DateTimePicker.SelectedDate = ((DateTime?)FieldValue).Value; } if (!_useTimePicker) { Calendar1.DataBind(); } else { DateTimePicker.DataBind(); } } FieldLabel.Text = GetMetaDataValue("Name", Attribute.StaticName); FieldLabel.HelpText = GetMetaDataValue <string>("Notes"); valCalendar1.Enabled = GetMetaDataValue <bool>("Required"); valDateTimePicker.Enabled = GetMetaDataValue <bool>("Required"); base.OnPreRender(e); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { FillDrop(); Calendar1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Calendar1.DataBind(); Calendar2.DataBind(); Calendar1.SelectedDate = DateTime.Now; FillDropDownList(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Fill(); Calendar1.DataBind(); Calendar2.DataBind(); lstDecitions.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DDLItem.DataBind(); FillListNameEmp(); Calendar1.DataBind(); DDLReciveName.Items.Insert(0, new ListItem("اختر المستلم..", "select")); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Calendar1.DataBind(); ddlType.DataBind(); // datepicker.Text = DateTime.Now.ToShortDateString(); FillEmployeeName(); } }
protected void Page_Load(object sender, EventArgs e) { lblTodayDate.Text = MyDate.getDate(); if (!IsPostBack) { Calendar1.DataBind(); EmployeeName(); FillBook(); ddlBookName.Items.Insert(0, new ListItem("اسم الكتاب..", "-1")); } }
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 Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var schoolid = new SchoolInformation().getId(); var Emp = (from p in ose.Students where p.SchoolId == schoolid orderby p.Name select p).ToList(); ddlStudentName.DataValueField = "IdentityNumber"; ddlStudentName.DataTextField = "Name"; ddlStudentName.DataSource = Emp; ddlStudentName.DataBind(); Calendar1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ddlType.DataBind(); ddlFileAttach.DataBind(); ddlFrom.DataBind(); Calendar1.DataBind(); FillEmpName(); FillListJopName(); FillSpecification(); if (Request.QueryString["id"] != null) { int id = int.Parse(Request.QueryString["id"].ToString()); PlaceHolder2.Visible = false; var c = (from k in ose.Incomings where k.Id == id select k).FirstOrDefault(); txtIncomingID.Text = c.Number; txtFileNumber.Text = c.FileNumber.ToString(); txtDate.Text = ((DateTime)c.Date).ToString("yyyy/MM/dd"); ddlFrom.Text = c.Type.ToString(); ddlType.SelectedValue = c.Type.ToString(); ddlFileAttach.Text = c.Id.ToString(); txtSubject.Text = c.Subject; if (c.FileLocation != null) { pdfFrame.Attributes.Add("src", "~/" + c.FileLocation); } btnAdd.Text = "تعديل الوارد"; } else { btnAdd.Text = "تسجيل الوارد"; } } }
//protected int getCounter2() //{ // return ++counter2; //} //protected int getCounter3() //{ // return ++counter3; //} protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var schoolid = new SchoolInformation().getId(); var semesterid = MyDate.getCurrentSemesterId(); Calendar1.DataBind(); txtDate.Text = MyDate.getDate(); ddlClass.DataSource = (from k in km.SubjectsInSemesters where k.SchoolId == schoolid && k.SemesterId == semesterid orderby k.ClassId select k.ClassId).ToList().Distinct(); ddlClass.DataBind(); lstAbsence.DataBind(); lstLate.DataBind(); lstNotes.DataBind(); lstViolence.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request.QueryString["id"] != null) { Calendar1.DataBind(); int id = int.Parse(Request.QueryString["id"].ToString()); var c = (from k in km.Outcomings where k.Id == id select k).FirstOrDefault(); txtOutcomingNumber.Text = c.Number; if (c.Date != null) { txtDate.Text = MyDate.getDate(c.Date.ToString()); } if (c.Type != null) { txtType.Text = ConstantManager.getConstant((int)c.Type); } if (c.SourceFrom != null) { txtSourceFrom.Text = ConstantManager.getConstant((int)c.SourceFrom); } if (!String.IsNullOrEmpty(c.ReceivedName)) { txtRecivedName.Text = c.ReceivedName; } else { txtRecivedName.Text = "لم يتم تسجيل الاستلام بعد"; } if (c.SourceTo != null) { txtSourceTo.Text = ConstantManager.getConstant((int)c.SourceTo); } if (c.FileNumber != null) { txtFileNumber.Text = c.FileNumber.ToString(); } if (c.Attachment != null) { txtFileAttach.Text = ConstantManager.getConstant((int)c.Attachment); } if (!String.IsNullOrEmpty(c.Subject)) { txtTitle.Text = c.Subject; } if (c.FileLocation != null) { pdfFrame.Attributes.Add("src", "~/" + c.FileLocation); } lnkTask.NavigateUrl = "~/Communication/TaskAdd.aspx?type=Outcoming&typeId=" + id; if (c.ReceivedName != null) { lblDone.Text = "تم تسليم المعاملة"; txtReceiver.Text = c.ReceivedName; txtDateReceive.Text = MyDate.getDate(c.ReceivedDate.ToString()); } } } }
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); } }