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; } }
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(); }
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(); }
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; } }
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; } }
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; //} }
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; } }
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; } }
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(); getClick(Id); } } if (!radioUnClicked) { } else { } }