Example #1
0
        private void metroTile1_Click(object sender, EventArgs e)
        {
            DateTime ds1 = metroDateTime1.Value.Date;
            DateTime ds2 = metroDateTime2.Value.Date;
            TimeSpan ts  = ds2 - ds1;
            int      i   = ts.Days;

            if (i <= 0)
            {
                MetroFramework.MetroMessageBox.Show(this, "There Is An Error", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                SignInEmp  si  = new SignInEmp();
                LoanLeaveC llc = new LoanLeaveC();
                AddEmp2    ae3 = new AddEmp2();
                if (si.Pass == metroTextBox2.Text)
                {
                    llc.LeaveD = llc.LeaveD - i;
                    llc.LF     = this.metroDateTime1.Text;
                    llc.LT     = this.metroDateTime2.Text;

                    ae3.AddLLe();
                    MetroFramework.MetroMessageBox.Show(this, "you have taken leave of " + i + " days/Day", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    metroLabel3.Text = Convert.ToString(llc.LeaveD);
                }
            }
        }
Example #2
0
        private void metroButton1_Click(object sender, EventArgs e)
        {
            AddEmp2    ae  = new AddEmp2();
            LoanLeaveC llc = new LoanLeaveC();

            ae.FindL();
            if (metroTextBox2.Text != null && metroRadioButton2.Checked == true && metroRadioButton1.Checked == false)
            {
                try
                {
                    if (llc.LoanA > 0)
                    {
                        MetroFramework.MetroMessageBox.Show(this, "Please Pay Privious amount", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else if (llc.LoanA == 0 && Convert.ToInt32(metroTextBox2.Text) > llc.SaveA)
                    {
                        MetroFramework.MetroMessageBox.Show(this, "Your current savings Account is " + llc.SaveA + " You cannot borrow more than that.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else if (Convert.ToInt32(metroTextBox2.Text) > 50000)
                    {
                        MetroFramework.MetroMessageBox.Show(this, "You are not Allowed to borrow more than 50000 at once", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    {
                        MetroFramework.MetroMessageBox.Show(this, "All is Ok From The Checking", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                catch { MetroFramework.MetroMessageBox.Show(this, "There Is an ERROR", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error); }
            }
            else if (metroTextBox2.Text != null && metroRadioButton1.Checked == true && metroRadioButton2.Checked == false)
            {
                if (Convert.ToInt32(metroTextBox2.Text) > 40000)
                {
                    MetroFramework.MetroMessageBox.Show(this, "You are not Allowed to borrow more than 40000 at once", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else if (llc.LoanA > 0)
                {
                    MetroFramework.MetroMessageBox.Show(this, "Please Pay Privious amount", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    MetroFramework.MetroMessageBox.Show(this, "All is Ok From The Checking", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else if (metroRadioButton1.Checked == true && metroRadioButton2.Checked == true)
            {
                MetroFramework.MetroMessageBox.Show(this, "There Is an ERROR", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (metroRadioButton1.Checked == false && metroRadioButton2.Checked == false)
            {
                MetroFramework.MetroMessageBox.Show(this, "There Is an ERROR", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                MetroFramework.MetroMessageBox.Show(this, "All is Ok From The Checking", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        private void LoanStatus_Load(object sender, EventArgs e)
        {
            AddEmp2 ae = new AddEmp2();

            ae.FindL();
            LoanLeaveC llc = new LoanLeaveC();

            metroLabel10.Text = Convert.ToString(llc.TPA);
            metroLabel9.Text  = Convert.ToString(llc.PayA);
            metroLabel8.Text  = Convert.ToString(llc.LoanA);
            metroLabel7.Text  = Convert.ToString(llc.LPA);
        }
Example #4
0
        public void FLeave()
        {
            SignInEmp ae = new SignInEmp();
            EmpInfoLinqDataContext cntx = new EmpInfoLinqDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\Project Salary Manager\SalaryManager\SalaryManager\EmpployeeInfo.mdf;Integrated Security=True;Connect Timeout=30");
            var str = from a in cntx.Loans_Leaves
                      select a;
            Loans_Leave p = str.Where(obj => obj.Id2 == ae.id2).First();
            //Loans_Leave p = str.First();
            LoanLeaveC llc = new LoanLeaveC();

            llc.YYear  = Convert.ToInt32(p.Year);
            llc.LeSell = Convert.ToInt32(p.SellLeaveAmount);
            llc.LeaveD = Convert.ToInt32(p.LeaveDays);
            cntx.SubmitChanges();
        }
Example #5
0
        public void AddLe()
        {
            SignInEmp ae = new SignInEmp();
            EmpInfoLinqDataContext cntx = new EmpInfoLinqDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\Project Salary Manager\SalaryManager\SalaryManager\EmpployeeInfo.mdf;Integrated Security=True;Connect Timeout=30");
            var str = from a in cntx.Loans_Leaves
                      where a.Id2 == ae.id2
                      select a;
            Loans_Leave p   = str.First();
            LoanLeaveC  llc = new LoanLeaveC();

            p.LeaveDays       = llc.LeaveD;
            p.Year            = llc.YYear;
            p.SellLeaveAmount = llc.LeSell;
            cntx.SubmitChanges();
        }
Example #6
0
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         AddEmp2 ae = new AddEmp2();
         ae.FLeave();
         LoanLeaveC llc = new LoanLeaveC();
         metroLabel3.Text   = Convert.ToString(llc.LeaveD);
         metroTextBox1.Text = "";
         metroTextBox2.Text = "";
         metroLabel6.Text   = "-----";
         metroLabel6.Text   = "-----";
     }
     catch
     { MetroFramework.MetroMessageBox.Show(this, "Error", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error); }
 }
Example #7
0
        private void metroTile1_Click(object sender, EventArgs e)
        {
            SignInEmp  si  = new SignInEmp();
            LoanLeaveC llc = new LoanLeaveC();
            AddEmp2    ae3 = new AddEmp2();

            if (si.Pass == metroTextBox1.Text)
            {
                llc.LeaveD = llc.LeaveD - Convert.ToInt32(metroTextBox2.Text);


                llc.LeSell       = Convert.ToInt32(metroTextBox2.Text) * 250;
                metroLabel8.Text = Convert.ToString(Convert.ToInt32(metroTextBox2.Text) * 250);
                ae3.AddLe();
                MetroFramework.MetroMessageBox.Show(this, "Error", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Example #8
0
        private void TakeLeave_Load(object sender, EventArgs e)
        {
            AddEmp2 ae = new AddEmp2();

            ae.FLeave();
            LoanLeaveC llc = new LoanLeaveC();

            if (llc.YYear > Convert.ToInt32(DateTime.Now.ToString("yyyy")))
            {
                llc.YYear  = Convert.ToInt32(DateTime.Now.ToString("yyyy"));
                llc.LeaveD = llc.LeaveD + 100;
                //AddEmp2 ae1 = new AddEmp2();
                ae.AddLe();
                metroLabel3.Text = Convert.ToString(llc.LeaveD);
            }
            else
            {
                metroLabel3.Text = Convert.ToString(llc.LeaveD);
            }
        }
        private void TakePayment_Load(object sender, EventArgs e)
        {
            metroButton1.Enabled = false;
            metroButton3.Enabled = false;
            SignInEmp ae = new SignInEmp();

            metroLabel20.Text = DateTime.Now.ToString("dd : MM : yyyy");
            AddEmp2    ae1 = new AddEmp2();
            FPayment   fp  = new FPayment();
            LoanLeaveC llc = new LoanLeaveC();

            ae1.TPayment();
            metroLabel2.Text = Convert.ToString(fp.Bas);
            metroLabel4.Text = Convert.ToString(fp.Hoal);
            metroLabel5.Text = Convert.ToString(fp.Heal);
            SignInEmp si = new SignInEmp();
            EmpInfoLinqDataContext cntx = new EmpInfoLinqDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\Project Salary Manager\SalaryManager\SalaryManager\EmpployeeInfo.mdf;Integrated Security=True;Connect Timeout=30");
            var str = from a in cntx.CheckIns
                      select a;
            CheckIn p = str.Where(obj => obj.Id2 == si.id2).First();

            {
                if (Convert.ToInt32(p.PCheckInMark) > 65)
                {
                    metroLabel13.Text = Convert.ToString(((fp.BON * fp.Bas) / 100) + 5000);
                }
                else
                {
                    metroLabel13.Text = Convert.ToString((fp.BON * fp.Bas) / 100);
                }
            }


            ae1.FindL();

            metroLabel7.Text = Convert.ToString(llc.TPA);
        }
Example #10
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         LoanLeaveC llc = new LoanLeaveC();
         AddEmp2    ae3 = new AddEmp2();
         ae3.FLeave();
         if (llc.LeaveD <= 30)
         {
             MessageBox.Show("Not Enough Leave Days");
         }
         else if ((llc.LeaveD - Convert.ToInt32(metroTextBox2.Text)) <= 30)
         {
             MessageBox.Show("Not Enough Leave Days");
         }
         else
         {
             metroLabel6.Text = Convert.ToString(llc.LeaveD - Convert.ToInt32(metroTextBox2.Text));
             metroLabel8.Text = Convert.ToString(Convert.ToInt32(metroTextBox2.Text) * 250);
         }
     }
     catch
     { MessageBox.Show("Error", "Error"); }
 }
Example #11
0
        private void metroTile2_Click(object sender, EventArgs e)
        {
            AddEmp2    ae  = new AddEmp2();
            LoanLeaveC llc = new LoanLeaveC();

            ae.FindL();
            if (metroTextBox2.Text != null && metroRadioButton2.Checked == true && metroRadioButton1.Checked == false)
            {
                try
                {
                    if (llc.LoanA > 0)
                    {
                        MetroFramework.MetroMessageBox.Show(this, "Please Pay Privious amount", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else if (llc.LoanA == 0 && Convert.ToInt32(metroTextBox2.Text) > llc.SaveA)
                    {
                        MetroFramework.MetroMessageBox.Show(this, "Your current savings Account is " + llc.SaveA + " You cannot borrow more than that.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else if (Convert.ToInt32(metroTextBox2.Text) > 50000)
                    {
                        MetroFramework.MetroMessageBox.Show(this, "You are not Allowed to borrow more than 50000 at once", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    {
                        if (llc.SaveA < Convert.ToInt32(metroTextBox2.Text))
                        {
                            MetroFramework.MetroMessageBox.Show(this, "Not Enough Savings Amount", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                        else
                        {
                            llc.LoanA = Convert.ToInt32(metroTextBox2.Text);
                            llc.PayA  = Convert.ToInt32(metroTextBox3.Text);
                            llc.SaveA = llc.SaveA - Convert.ToInt32(metroTextBox2.Text);
                            llc.TPA   = Convert.ToInt32(metroTextBox2.Text);
                            MetroFramework.MetroMessageBox.Show(this, "Loan Taken,please take PrintOut", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            ae.AddL();
                            metroTile1.Enabled = true;
                            metroTile2.Enabled = false;
                        }
                    }
                }
                catch { MetroFramework.MetroMessageBox.Show(this, "There Is an ERROR", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error); }
            }
            else if (metroTextBox2.Text != null && metroRadioButton1.Checked == true && metroRadioButton2.Checked == false)
            {
                try
                {
                    if (Convert.ToInt32(metroTextBox2.Text) > 40000)
                    {
                        MetroFramework.MetroMessageBox.Show(this, "You are not Allowed to borrow more than 40000 at once", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else if (llc.LoanA > 0)
                    {
                        MetroFramework.MetroMessageBox.Show(this, "Please Pay Privious amount", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    {
                        llc.LoanA = Convert.ToInt32(metroTextBox2.Text);
                        llc.PayA  = Convert.ToInt32(metroTextBox3.Text);
                        ae.AddLL();


                        MetroFramework.MetroMessageBox.Show(this, "Loan Taken,please take Print Out", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        //metroTextBox1.Text = "";
                        metroTextBox2.Text = "";
                        metroTextBox3.Text = "";
                        metroTile1.Enabled = true;
                        metroTile2.Enabled = false;
                    }
                }
                catch
                {
                    MetroFramework.MetroMessageBox.Show(this, "There Is an ERROR", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else if (metroRadioButton1.Checked == true && metroRadioButton2.Checked == true)
            {
                MetroFramework.MetroMessageBox.Show(this, "There Is an ERROR", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (metroRadioButton1.Checked == false && metroRadioButton2.Checked == false)
            {
                MetroFramework.MetroMessageBox.Show(this, "There Is an ERROR", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }