예제 #1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            EmpBusiness ebb = new EmpBusiness();
            Employee eq = new Employee();
            eq.EmpId =Convert.ToInt32(TextBox15.Text);
            eq.FirstName = TextBox1.Text;
            eq.MiddleName = TextBox2.Text;
            eq.LastName = TextBox3.Text;
            eq.Addreee = TextBox4.Text;
            eq.City = TextBox5.Text;
            eq.State = TextBox6.Text;
            eq.ZipCode = TextBox7.Text + "-" + TextBox8.Text;
            eq.Department = DropDownList1.SelectedItem.Text;
            eq.PhoneNumber = TextBox9.Text;
            eq.EmailId = TextBox10.Text;
            eq.Salary = Convert.ToDecimal(TextBox11.Text);
            eq.Leaves = Convert.ToInt32(TextBox12.Text);
            eq.Position = TextBox14.Text.ToString();

            if (picUpload.HasFile)
            {
                string fileName = Path.GetFileName(picUpload.PostedFile.FileName);
                picUpload.PostedFile.SaveAs(Server.MapPath("Images/") + fileName);
                eq.Picture = fileName;
            }
            ebb.updateEmp(eq);
            Response.Redirect(Request.Url.AbsoluteUri);
        }
예제 #2
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     Employee e1 = new Employee();
     e1.FirstName = txtFname.Text;
     e1.MiddleName = txtMname.Text;
     e1.LastName = txtLname.Text;
     e1.Leaves = Convert.ToInt32(txtLeaves.Text);
     e1.PhoneNumber = txtPhoneNo.Text;
     e1.Position = txtPos.Text;
     e1.ZipCode = txtZip1.Text + "-" + txtZip2.Text;
     e1.State = txtState.Text;
     e1.Salary = Convert.ToDecimal(txtSal.Text);
     e1.Addreee = txtAdd.Text;
     e1.City = txtCity.Text;
     e1.Department = ddlDept.SelectedItem.Text;
     e1.EmailId = txtEmailId.Text;
     if (picUpload.HasFile)
     {
         string fileName = Path.GetFileName(picUpload.PostedFile.FileName);
         picUpload.PostedFile.SaveAs(Server.MapPath("Images/") + fileName);
         e1.Picture = fileName;
     }
     EmpBusiness eba = new EmpBusiness();
     eba.insertNewEmployee(e1);
     string text2disp = "Emp Id "+x+" created successfully";
        // string script = text2disp;
     Label2.Visible = true;
     Label2.Text = text2disp;
     clearst();
 }
예제 #3
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            EmpBusiness ebb = new EmpBusiness();
            int l =ebb.getEmpLeave(Convert.ToInt32(Session["username"]));
             EmpBusiness ebbb = new EmpBusiness();
             Employee  p = ebbb.getEmpOnId(Convert.ToInt32(Session["username"]));

            TimeSpan ts = Calendar2.SelectedDate-Calendar1.SelectedDate;
            int leavLeft = p.Leaves - l - ts.Days;
            if (leavLeft>0)
            {
                EmpLeave el = new EmpLeave();
                el.EmpId = Convert.ToInt32(Session["username"]);
                el.FromDate = Calendar1.SelectedDate;
                el.ToDate = Calendar2.SelectedDate;
                el.Descr = TextBox1.Text;
                ebb.insertEmpLeave(el);
                string body = "Emp Id with" + el.EmpId + "has applied leave from " + el.FromDate + " to " + el.ToDate + " for the particular reason " + el.Descr;
                Email s = new Email();
                s.SendEmail(body);
                Response.Redirect(Request.Url.AbsoluteUri);
            }

            else
                Label1.Visible = true;
        }
예제 #4
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            bool radioUnClicked=true;
             //   TokenCodeDO tokenCodeDO = new TokenCodeDO();
                foreach (GridViewRow token in GridViewTokenCodeDetails.Rows)
                {

                    RadioButton tkn = (RadioButton)token.FindControl("tknCdeRadioButton");
                   if (tkn.Checked)
                   {
             int Id = Convert.ToInt32(GridViewTokenCodeDetails.DataKeys[token.RowIndex].Values["EmpId"]);
            EmpBusiness ea = new EmpBusiness();
                       ea.deleteEmp(Id);
                       Button1_Click(sender,e);

                   }
                }

                if (!radioUnClicked)
                {

                }
                else
                {

                }
        }
예제 #5
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     EmpBusiness eq=new EmpBusiness();
     List<Employee> eList = new List<Employee>();
     eList=eq.getEmp(TextBox14.Text);
     GridViewTokenCodeDetails.DataSource=eList;
     GridViewTokenCodeDetails.DataBind();
 }
예제 #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     EmpBusiness eb = new EmpBusiness();
     int s = Convert.ToInt32(Session["username"]);
        EmpEntity.Employee ew= eb.getEmpOnId(s);
        Label3.Text = ew.Leaves.ToString();
      int leavesTaken=  eb.getEmpLeave(s);
      Label4.Text = (ew.Leaves - leavesTaken).ToString();
 }
예제 #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     int eid = Convert.ToInt32(Session["username"]);
     EmpBusiness eb = new EmpBusiness();
        int exa =     eb.getsetAttendance(eid,DateTime.UtcNow);
        if (exa == 2)
        {
        Button1.Enabled = false;
        }
 }
예제 #8
0
        public void getClick(int id)
        {
            EmpBL.EmpBusiness eb = new EmpBL.EmpBusiness();
            Auths             a  = new Auths();
            Employee          eq = eb.getEmpOnId(id);

            if (eq.EmpId == 0)
            {
                Label17.Text = "Employee not found";

                Label17.Visible = true;
            }
            else
            {
                Label2.Text = eq.EmpId.ToString();
                Label3.Text = eq.FirstName;
                Label4.Text = eq.MiddleName;
                Label5.Text = eq.LastName;
                Label6.Text = eq.Addreee;
                Label7.Text = eq.City;
                Label8.Text = eq.State;
                string[] zip = eq.ZipCode.Split('-');
                Label9.Text = zip[0].ToString() + '-' + zip[1].ToString();
                //Label8.Text =
                Label10.Text = eq.PhoneNumber;
                Label11.Text = eq.EmailId;
                Label12.Text = eq.Department;
                //     Label13.Text = Convert.ToString(eq.Salary);
                //Label14.Text = eq.Leaves.ToString();
                //Label15.Text = eq.Position;

                Label14.Text = Convert.ToString(eq.Salary);
                Label15.Text = eq.Leaves.ToString();
                Label16.Text = eq.Position;
                if (eq.Picture != string.Empty)
                {
                    Image1.ImageUrl = "images/" + eq.Picture;
                }

                if (Session["admin"] == "true")
                {
                    //   setlabels();
                    Panel1.Visible = true;
                    Panel2.Visible = true;
                }
                //else
                //    Panel2.Visible = true;
            }
        }
예제 #9
0
        public void getClick(int id)
        {
            EmpBL.EmpBusiness eb = new EmpBL.EmpBusiness();
            Auths a = new Auths();
            Employee eq = eb.getEmpOnId(id);
            if (eq.EmpId == 0)
            {
                Label17.Text = "Employee not found";

                Label17.Visible = true;
            }
            else
            {
                Label2.Text = eq.EmpId.ToString();
                Label3.Text = eq.FirstName;
                Label4.Text = eq.MiddleName;
                Label5.Text = eq.LastName;
                Label6.Text = eq.Addreee;
                Label7.Text = eq.City;
                Label8.Text = eq.State;
                string[] zip = eq.ZipCode.Split('-');
                Label9.Text = zip[0].ToString() + '-' + zip[1].ToString();
                //Label8.Text =
                Label10.Text = eq.PhoneNumber;
                Label11.Text = eq.EmailId;
                Label12.Text = eq.Department;
                //     Label13.Text = Convert.ToString(eq.Salary);
                //Label14.Text = eq.Leaves.ToString();
                //Label15.Text = eq.Position;

                Label14.Text = Convert.ToString(eq.Salary);
                Label15.Text = eq.Leaves.ToString();
                Label16.Text = eq.Position;
                if (eq.Picture != string.Empty)
                {
                    Image1.ImageUrl = "images/" + eq.Picture;
                }

                if (Session["admin"] == "true")
                {
                    //   setlabels();
                    Panel1.Visible = true;
                    Panel2.Visible = true;
                }
                //else
                //    Panel2.Visible = true;
            }
        }
예제 #10
0
        public void setlabels()
        {
            int ids = Convert.ToInt32(Session["username"]);
            EmpBusiness ebb = new EmpBusiness();
            Employee eq = new Employee();
            eq = ebb.getEmpOnId(ids);
            Label2.Text = eq.EmpId.ToString();
            Label3.Text = eq.FirstName;
            Label4.Text = eq.MiddleName;
            Label5.Text = eq.LastName;
            Label6.Text = eq.Addreee;
            Label7.Text = eq.City;
            Label8.Text = eq.State;
            string[] zip = eq.ZipCode.Split('-');
            Label9.Text = zip[0].ToString() +'-' +zip[1].ToString();
            //Label8.Text =
            Label10.Text = eq.PhoneNumber;
            Label11.Text = eq.EmailId;
            Label12.Text = eq.Department;
            Label14.Text = Convert.ToString(eq.Salary);
            Label15.Text = eq.Leaves.ToString();
            Label16.Text = eq.Position;
            if (eq.Picture!=string.Empty)
            {
                Image1.ImageUrl = "images/" + eq.Picture;
            }

            //if (Session["admin"] == "false")
            //{
            //    //   setlabels();
            //    Panel1.Visible = true;
            //    Panel2.Visible = false;
            //}
            //else
            //{
            //    Panel2.Visible = true;
            //    Panel1.Visible = true;
            //}
        }
예제 #11
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            EmpBusiness eb = new EmpBusiness();
              //   int   EmpId = Convert.ToInt32(Session["username"]);
            //=eb.getEmpOnId(EmpId);
             Auths a = new Auths();
            EmpEntity.Employee ee=      a.getEmpOName(TextBox2.Text);
            if (ee.EmpId == 0)
            {
            Label5.Visible = true;

            }
            else
            {
            int month = Convert.ToInt32(ddlMonth.SelectedValue);
            Label4.Text = Convert.ToString(eb.calcuSalary(ee.EmpId, month));
            //Label3.Text = ee.Position;
            Label2.Text = ee.Department;
            Label1.Text = ee.EmpId.ToString();
            Panel1.Visible = true;
            }
        }
예제 #12
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            int ids = 0;
            ids = Convert.ToInt32(TextBox15.Text);
            EmpBusiness ebb = new EmpBusiness();
            Employee eq = new Employee();
            eq = ebb.getEmpOnId(ids);
            if (eq.EmpId != 0)
            {
                TextBox1.Text = eq.FirstName;
                TextBox2.Text = eq.MiddleName;
                TextBox3.Text = eq.LastName;
                TextBox4.Text = eq.Addreee;
                TextBox5.Text = eq.City;
                TextBox6.Text = eq.State;
                string[] zip = eq.ZipCode.Split('-');
                TextBox7.Text = zip[0].ToString();
                TextBox8.Text = zip[1].ToString();
                TextBox9.Text = eq.PhoneNumber;
                TextBox10.Text = eq.EmailId;
                TextBox11.Text = Convert.ToString(eq.Salary);
                TextBox12.Text = eq.Leaves.ToString();
                TextBox14.Text = eq.Position;
                Label1.Text = eq.Department.ToString();
                DropDownList1.SelectedItem.Text = eq.Department.ToString();
                if (eq.Picture != string.Empty)
                {
                    Image1.ImageUrl = "images/" + eq.Picture;
                }

            }
            else
            {
                Label17.Text = "Employee Not Found";
                Label17.Visible = true;
            }
        }
예제 #13
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            EmpBusiness eq = new EmpBusiness();
            List<Employee> eList = new List<Employee>();
            eList = eq.getEmp(TextBox1.Text);
            GridViewTokenCodeDetails.DataSource = eList;
            GridViewTokenCodeDetails.DataBind();
            Button2.Visible = true;
            if (eList.Count==0)
            {
                  Label17.Text = "Employee not found";

                Label17.Visible = true;
                Button2.Visible = false;
            }
        }