Exemplo n.º 1
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;
            }
        }
    }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         FillDrop();
         Calendar1.DataBind();
     }
 }
Exemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DDLItem.DataBind();
         FillListNameEmp();
         Calendar1.DataBind();
         DDLReciveName.Items.Insert(0, new ListItem("اختر المستلم..", "select"));
     }
 }
Exemplo n.º 5
0
 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)
 {
     if (!IsPostBack)
     {
         Fill();
         Calendar1.DataBind();
         Calendar2.DataBind();
         lstDecitions.DataBind();
     }
 }
Exemplo n.º 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Calendar1.DataBind();
         Calendar2.DataBind();
         Calendar1.SelectedDate = DateTime.Now;
         FillDropDownList();
     }
 }
Exemplo n.º 8
0
 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;
                }
            }
        }
    }
Exemplo n.º 10
0
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        //txtEmpCode.CssClass =String.Empty;
        //txtEmpFName.CssClass = String.Empty;
        //txtEmpMName.CssClass = String.Empty;
        //txtEmpLName.CssClass = String.Empty;
        //txtMobileNumber.CssClass = String.Empty;
        //txtEmailID.CssClass = String.Empty;
        ddlMonth.Visible = true;
        ddlYear.Visible  = true;


        Calendar1.Focus();

        Calendar1.Visible = true;
    }
    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();
        }
    }
Exemplo n.º 12
0
    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();
        }
    }
Exemplo n.º 14
0
    protected void Button1_Click1(object sender, EventArgs e)
    {
        bs.fname  = Text_fn.Text;
        bs.lname  = Text_ln.Text;
        bs.gender = RadioButtonList1.Text;
        bs.email  = Text_Email.Text;
        bs.pwd    = Text_pwd.Text;
        bs.cpwd   = Text_cpwd.Text;
        bs.cal    = Convert.ToDateTime(Calendar1.ToString());
        bs.clas   = DropDownList1.Text;
        string str1 = "";

        foreach (ListItem item in ListBox1.Items)
        {
            if (item.Selected == true)
            {
                if (str1 == "")
                {
                    str1 = item.Text;
                }
                else
                {
                    str1 = str1 + "," + item.Text;
                }
            }
        }
        bs.stream = str1;
        string str2 = "";

        for (int i = 0; i < CheckBoxList1.Items.Count; i++)
        {
            if (CheckBoxList1.Items[i].Selected == true)
            {
                if (str2 == "")
                {
                    str2 = CheckBoxList1.Items[i].Text;
                }
                else
                {
                    str2 = str2 + "," + CheckBoxList1.Items[i].Text;
                }
            }
        }
        bs.hobby = str2;
        bs.state = dd_state.SelectedItem.Value;
        bs.city  = dd_city.SelectedItem.Value;

        if (FileUpload1.HasFile)
        {
            filename = FileUpload1.FileName;
            path     = Server.MapPath("~/i/");
            fullpath = path + "//" + filename;

            FileUpload1.SaveAs(fullpath);
            temp = "~/i/" + filename;
        }
        else
        {
            temp = "";
        }
        bs.image = temp;
        int p = bs.bs_insert(bs);

        if (p > 0)
        {
            Response.Write("Insert Succesfully..");
        }
        else
        {
            Response.Write("Try Again..");
        }
    }
Exemplo n.º 15
0
        protected void cmdDelete_Click(object sender, EventArgs e)
        {
            clsDailyMileageReading DB = new clsDailyMileageReading();

            try
            {
                //String txtregno,DateTime dtdate,Decimal txtmileage_reading,String cboDriverno
                if (cboRegNo.Text == null)
                {
                    lblResults.Text = "Please enter the Registration number";
                    return;
                }
                if (Calendar1.SelectedDate == null)
                {
                    lblResults.Text = "Select the date";
                    return;
                }
                if (cboDriverNo.Text == null)
                {
                    lblResults.Text = "Please select the driver number";
                    return;
                }
                if (txtMileageReading.Text == null)
                {
                    lblResults.Text = "Please enter the mileage reading";
                    return;
                }
                int reccount = 0;
                reccount = DB.FindRecKount(cboRegNo.Text, DateTime.Parse(Calendar1.ToString()));

                if (reccount > 0)
                {
                    lblResults.Text = "Record already exists!!!";
                    return;
                }

                DB.Delete_rec(cboRegNo.Text, DateTime.Parse(Calendar1.ToString()), Decimal.Parse(txtMileageReading.Text), cboDriverNo.Text);

                //string connectionString =
                //connectionString = WebConfigurationManager.ConnectionStrings["FleetConnectionString"].ConnectionString;

                //string selectSQL = "SELECT * FROM tb_Customer ORDER BY convert(int,customerno)";
                //SqlConnection con = new SqlConnection(connectionString);
                //SqlCommand cmd = new SqlCommand(selectSQL, con);
                //SqlDataAdapter adapter = new SqlDataAdapter(cmd);

                // Fill the DataSet.
                DataSet ds = new DataSet();
                ds = DB.FindTable();
                //adapter.Fill(ds, "tb_Customer");
                // Perform the binding.
                GridView1.DataSource = ds;
                GridView1.DataBind();

                lblResults.Text = "Operation successful";

                cboRegNo.Text          = "";
                txtMileageReading.Text = "";
                cboDriverNo.Text       = "";
                return;
            }
            catch (FormatException err)
            {
                EventLog log = new EventLog();
                log.Source = "Stock Sales";
                log.WriteEntry(err.Message, EventLogEntryType.Error);
            }
        }
    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);
        }
    }
Exemplo n.º 17
0
 protected void ImageButton14_Click(object sender, ImageClickEventArgs e)
 {
     Calendar1.Visible = !Calendar1.Visible;
     Calendar1.Focus();
 }
    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());
                }
            }
        }
    }