Exemple #1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            EmpBL.EmpBusiness eb = new EmpBL.EmpBusiness();
            Auths a = new Auths();
            Employee ee= a.getEmpOName(TextBox2.Text);
            if (ee.EmpId == 0)
            {
                Label6.Visible = true;
            }
            else
            {
                int i = eb.getSalaryForDays(ee.EmpId, Convert.ToInt32(ddlMonth.SelectedValue));
                int totalDays = DateTime.DaysInMonth(2014, Convert.ToInt32(ddlMonth.SelectedValue));
                int leavesLeft = totalDays - i;
             int attendedDays=   a.getNoofDaysAttendedMonth(ee.EmpId, Convert.ToInt32(ddlMonth.SelectedValue));
                Panel1.Visible = true;
                //Label5.Visible = false;

              //  Label5.Text = totalDays.ToString();
                Label4.Text = attendedDays.ToString();
             //   Label3.Text = ee.Position;
                Label2.Text = ee.Department;
                Label1.Text = ee.EmpId.ToString();
            }
        }
Exemple #2
0
        public void SendEmail(string body)
        {
            // Console.WriteLine("Mail To");
            string userName = System.Configuration.ConfigurationManager.AppSettings["adminEmailId"];
            MailAddress to = new MailAddress(userName);
            try
            {
                MailMessage mail = new MailMessage();
                SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");

                mail.From = new MailAddress("*****@*****.**");
                mail.To.Add(userName);
                mail.Subject = "Leave Notification";
                mail.Body = "Leave Applied";

                SmtpServer.Port = 587;
                SmtpServer.Credentials = new System.Net.NetworkCredential("employeemanager2014", "polly@123");
                SmtpServer.EnableSsl = true;

                SmtpServer.Send(mail);

            }
            catch (Exception ex)
            {
                 Auths aa = new Auths();
                 aa.insertEmail(" " + body + " " + ex.Message);

            }
        }
Exemple #3
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            Auths a = new Auths();
            if (TextBox1.Text ==string.Empty || TextBox2.Text==string.Empty)
            {
                TextBox1.Text = "";
                TextBox2.Text = "";
                Label1.Visible = true;
                Response.Redirect(Request.Url.AbsoluteUri);
            }
            string uname= a.getAuthen(TextBox1.Text, TextBox2.Text);
            if (uname != null && uname != string.Empty)
            {
                Session["username"] = uname;

                bool stat = a.getIsAdmin(TextBox1.Text, TextBox2.Text);
                if (stat)
                {
                    Session["admin"] = "true";
                }
                else
                {
                    Session["admin"] = "false";
                }
                Response.Redirect("ViewEmployee.aspx");

            }
            else
            {
                TextBox1.Text = "";
                TextBox2.Text = "";
                Label1.Visible = true;
            }
        }
Exemple #4
0
 public decimal calcuSalary(int Eid, int month)
 {
     Auths aa = new Auths();
     int daysAttended=aa.getNoofDaysAttendedMonth(Eid,month);
     decimal i = getSalaryPerHour(Eid);
       //  int j = getSalaryForDays(Eid, month);
     decimal TotalSal = i * 8 * daysAttended;
     return TotalSal;
 }
Exemple #5
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;
            }
        }
Exemple #6
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     Auths aa = new Auths();
     int j = aa.changePassword(Convert.ToInt32(Session["username"]),TextBox1.Text,TextBox2.Text);
     if (j == 2)
     {
         Label1.Visible = true;
     }
     else
     {
         Label1.Text = "Failed to change";
         Label1.Visible = true;
     }
     TextBox1.Text = "";
     TextBox2.Text = "";
 }
Exemple #7
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;
            }
        }