Exemple #1
0
 public int salgE()
 {
     try
     {
         SalGr sg = new SalGr();
         if (sg.SAL == 0 || sg.Heal == 0 || sg.HAL == 0 || sg.Dl == 0)
         {
             return(1);
         }
         else
         {
             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.SalaryGs
                       select a;
             SalaryG p = str.Where(obj => obj.SalaryGrade == sg.SLG).First();
             p.Salary    = sg.SAL;
             p.HealthAl  = sg.Heal;
             p.HomeAl    = sg.HAL;
             p.HealthAlp = sg.Heal2;
             p.HomeAlp   = sg.HAL2;
             p.DayAl     = sg.Dl;
             p.Bonus     = sg.BON;
             cntx.SubmitChanges();
             return(0);
         }
     }
     catch { return(1); }
 }
        private void metroButton3_Click(object sender, EventArgs e)
        {
            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.taxAndSals
                      where a.Id2 == ae.id2
                      select a;
            taxAndSal p = str.First();

            p.Count      = 1;
            p.PendingTax = (Convert.ToInt32(metroLabel2.Text) * 2) / 100;
            cntx.SubmitChanges();
            SaveS ss = new SaveS();

            ss.CO = Convert.ToInt32(p.Count);
            AddEmp2 ae2 = new AddEmp2();

            ae2.FSA();
            if (metroTextBox2.Text == "")
            {
                metroTextBox2.Text = "0";
            }
            SaveS sa = new SaveS();
            int   k  = Convert.ToInt32(metroLabel7.Text);

            if (k == 0)
            {
                metroTextBox1.Text    = "0";
                metroTextBox1.Enabled = false;
                MetroFramework.MetroMessageBox.Show(this, "Checking Successful", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                if (metroTextBox1.Text == "")
                {
                    if (Convert.ToInt32(metroLabel7.Text) <= sa.PA)
                    {
                        metroTextBox1.Text = metroLabel7.Text;
                        sa.TL = 0;
                        sa.PA = 0;
                        sa.LA = 0;
                        MetroFramework.MetroMessageBox.Show(this, "Checking Successful", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        metroTextBox1.Text = Convert.ToString(sa.PA);
                        sa.LA = sa.LA - sa.PA;
                        MetroFramework.MetroMessageBox.Show(this, "Checking Successful", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                else if (Convert.ToInt32(metroTextBox1.Text) > (sa.PA + 100))
                {
                    MetroFramework.MetroMessageBox.Show(this, "Cant Pay That Much Together", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            metroButton3.Enabled = false;
            metroButton1.Enabled = true;
            metroLabel18.Text    = Convert.ToString(Convert.ToInt32(metroLabel2.Text) + Convert.ToInt32(metroLabel4.Text) + Convert.ToInt32(metroLabel5.Text) - Convert.ToInt32(metroLabel12.Text) - Convert.ToInt32(metroTextBox1.Text) - Convert.ToInt32(metroTextBox2.Text));
        }
        private void metroButton1_Click(object sender, EventArgs e)
        {
            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.EmpInformations
                      join b in cntx.CheckIns
                      on a.Id2 equals b.Id2
                      select new { Id1 = a.Id1, Id2 = a.Id2, Name = a.Name, Rank = a.Rank, SalaryGrade = a.SalaryGrade, EmailAddress = a.EmailAddress, PreviousMonthCheckInMark = b.PCheckInMark, RunningMonthCheckInMark = b.CheckinMark };

            metroGrid1.DataSource = str;
        }
Exemple #4
0
        public void getDB()
        {
            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.EmpInformations
                      select a;
            EmpInformation p = str.Where(obj => obj.Id1 == ae.id1 && obj.Id2 == ae.id2 && obj.Password == ae.Pass).First();

            if (ae.id1 == 'A')
            {
                Form1 f  = new Form1();
                Form2 f2 = new Form2(f);

                ae.NName   = p.Name;
                ae.PNumber = p.PhoneNumber;
                ae.Pass    = p.Password;
                //ae.DOB = p.DateofBirth;
                //p.Picture = ae1.Pict;
                ae.SalGrade = p.SalaryGrade;
                ae.HAddress = p.HomeAddress;
                ae.id1      = p.Id1;
                ae.id2      = p.Id2;
                ae.RRank    = p.Rank;
                ae.EAddress = p.EmailAddress;
                f2.S        = 1;
                f.change();
            }
            else
            {
                Form1 f  = new Form1();
                Form2 f2 = new Form2(f);

                /*EmpInfoLinqDataContext cntx1 = new EmpInfoLinqDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\Project Salary Manager\SalaryManager\SalaryManager\EmpployeeInfo.mdf;Integrated Security=True;Connect Timeout=30");
                 * var str1 = from a in cntx1.EmpInformations
                 *    select a;
                 * EmpInformation p1 = str1.Where(obj1 => obj1.Id2 == ae.id2).First();*/
                ae.NName   = p.Name;
                ae.PNumber = p.PhoneNumber;
                ae.Pass    = p.Password;
                //p.Picture = ae1.Pict;
                ae.SalGrade = p.SalaryGrade;
                ae.HAddress = p.HomeAddress;
                ae.id1      = p.Id1;
                ae.id2      = p.Id2;
                ae.RRank    = p.Rank;
                ae.EAddress = p.EmailAddress;
                ae.Under    = p.Under;
                //ae.Pict = p1.Division;
                f2.S = 2;
                f.change();
            }
            cntx.SubmitChanges();
        }
Exemple #5
0
        public void changeP(string pa)
        {
            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.EmpInformations
                      where a.Id2 == ae.id2
                      select a;
            EmpInformation p = str.First();

            p.Password = pa;
            //ae.Pass = pa;
            cntx.SubmitChanges();
        }
Exemple #6
0
        public void editp()
        {
            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.EmpInformations
                      where a.Password == ae.Pass
                      select a;
            EmpInformation p = str.First();

            p.PhoneNumber  = ae.PNumber;
            p.EmailAddress = ae.EAddress;
            p.HomeAddress  = ae.HAddress;
            cntx.SubmitChanges();
        }
Exemple #7
0
        public int addToDB()
        {
            try
            {
                AddEmp1 ae1 = new AddEmp1();
                EmpInfoLinqDataContext cntx = new EmpInfoLinqDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\Project Salary Manager\SalaryManager\SalaryManager\EmpployeeInfo.mdf;Integrated Security=True;Connect Timeout=30");

                Loans_Leave lo = new Loans_Leave();
                lo.Id2            = ae1.id2;
                lo.LeaveDays      = 100;
                lo.SavingsAccount = 10000;
                lo.LoanAmount     = 0;
                lo.PayAmount      = 0;
                lo.Year           = Convert.ToInt32(DateTime.Now.ToString("yyyy"));
                taxAndSal trs = new taxAndSal();
                trs.Id2        = ae1.id2;
                trs.PendingTax = 0;

                /*CheckIn ci = new CheckIn();
                 * ci.Id2 = ae1.id2; ;
                 * ci.CheckinMark = 0;
                 * ci.PCheckInMark = 0;
                 * ci.CheckInCounter = "0";
                 * ci.Password = ae1.Pass;*/

                EmpInformation emp = new EmpInformation();

                emp.Id1          = ae1.id1;
                emp.Id2          = ae1.id2;
                emp.Name         = ae1.NName;
                emp.Password     = ae1.Pass;
                emp.PhoneNumber  = ae1.PNumber;
                emp.Rank         = ae1.RRank;
                emp.SalaryGrade  = ae1.SalGrade;
                emp.HomeAddress  = ae1.HAddress;
                emp.EmailAddress = ae1.EAddress;
                emp.Under        = ae.id1 + ae.id2;
                cntx.EmpInformations.InsertOnSubmit(emp);
                cntx.Loans_Leaves.InsertOnSubmit(lo);
                cntx.taxAndSals.InsertOnSubmit(trs);
                //cntx.CheckIns.InsertOnSubmit(ci);
                cntx.SubmitChanges();
                return(0);
            }
            catch
            {
                return(1);
            }
        }
Exemple #8
0
        /*public void tcs()
         * {
         *  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.Travels
         *            select a;
         *  Travel p = str.Where(obj => obj.Id2 == ae.id2).First();
         *  TravelC tc = new TravelC();
         *  p.Cause = tc.Cau;
         *  p.Division = tc.Div;
         *  p.From = tc.Frm;
         *  p.To = tc.Too;
         *  p.TicketPrice = tc.TP;
         *  p.TravelledBy = tc.TrvB;
         *  cntx.SubmitChanges();
         *
         * }*/
        public void TPayment()
        {
            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.SalaryGs
                      select a;
            SalaryG  p  = str.Where(obj => obj.SalaryGrade == ae.SalGrade).First();
            FPayment fp = new FPayment();

            fp.Bas  = Convert.ToInt32(p.Salary);
            fp.Hoal = Convert.ToInt32(p.HomeAlp);
            fp.Heal = Convert.ToInt32(p.HealthAlp);
            fp.BON  = Convert.ToInt32(p.Bonus);
            //taxC(fp.Bas);
        }
Exemple #9
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();
        }
Exemple #10
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();
        }
        private void button2_Click(object sender, EventArgs e)
        {
            metroLabel16.Text = Convert.ToString(Convert.ToInt32(metroTextBox1.Text) * 2);
            SignInEmp si = new SignInEmp();
            EmpInfoLinqDataContext cntx1 = new EmpInfoLinqDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\Project Salary Manager\SalaryManager\SalaryManager\EmpployeeInfo.mdf;Integrated Security=True;Connect Timeout=30");
            var str1 = from a in cntx1.SalaryGs
                       select a;
            SalaryG  p1  = str1.Where(obj => obj.SalaryGrade == si.SalGrade).First();
            DateTime ds1 = metroDateTime1.Value.Date;
            DateTime ds2 = metroDateTime2.Value.Date;
            TimeSpan ts  = ds2 - ds1;
            int      i   = ts.Days;

            metroLabel13.Text = Convert.ToString(p1.DayAl * i);
        }
        private void metroTile2_Click(object sender, EventArgs e)
        {
            SignInEmp si = new SignInEmp();

            EmpInfoLinqDataContext cntx3 = new EmpInfoLinqDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\Project Salary Manager\SalaryManager\SalaryManager\EmpployeeInfo.mdf;Integrated Security=True;Connect Timeout=30");
            var str3 = from a in cntx3.CheckIns
                       select a;
            CheckIn p3 = str3.Where(obj => obj.Id2 == metroTextBox4.Text).First();

            //EmpInformation em = str.First();
            cntx3.CheckIns.DeleteOnSubmit(p3);
            cntx3.SubmitChanges();

            EmpInfoLinqDataContext cntx1 = new EmpInfoLinqDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\Project Salary Manager\SalaryManager\SalaryManager\EmpployeeInfo.mdf;Integrated Security=True;Connect Timeout=30");
            var str1 = from a in cntx1.taxAndSals
                       select a;
            taxAndSal p1 = str1.Where(obj => obj.Id2 == metroTextBox4.Text).First();

            //EmpInformation em = str.First();
            cntx1.taxAndSals.DeleteOnSubmit(p1);
            cntx1.SubmitChanges();

            EmpInfoLinqDataContext cntx2 = new EmpInfoLinqDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\Project Salary Manager\SalaryManager\SalaryManager\EmpployeeInfo.mdf;Integrated Security=True;Connect Timeout=30");
            var str2 = from a in cntx2.Loans_Leaves
                       select a;
            Loans_Leave p2 = str2.Where(obj => obj.Id2 == metroTextBox4.Text).First();

            //EmpInformation em = str.First();
            cntx2.Loans_Leaves.DeleteOnSubmit(p2);
            cntx2.SubmitChanges();

            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.EmpInformations
                      select a;
            EmpInformation p = str.Where(obj => obj.Id2 == metroTextBox4.Text).First();

            //EmpInformation em = str.First();
            cntx.EmpInformations.DeleteOnSubmit(p);
            cntx.SubmitChanges();

            MetroFramework.MetroMessageBox.Show(this, " Deleted", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            EmpInfoLinqDataContext cntx5 = new EmpInfoLinqDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\Project Salary Manager\SalaryManager\SalaryManager\EmpployeeInfo.mdf;Integrated Security=True;Connect Timeout=30");
            var str5 = from a in cntx5.EmpInformations
                       where a.Id1 == si.id1 + 1
                       select new { Id1 = a.Id1, Id2 = a.Id2, Name = a.Name };

            metroGrid1.DataSource = str5;
        }
Exemple #13
0
        public void FSA()
        {
            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.Where(obj => obj.Id2 == ae.id2).First();
            SaveS       sa = new SaveS();

            // sa.SA = Convert.ToInt32(p.SavingsAccount);
            sa.TL = Convert.ToInt32(p.TotalLoan);
            sa.PA = Convert.ToInt32(p.PayAmount);
            sa.LA = Convert.ToInt32(p.LoanAmount);
            sa.LP = Convert.ToInt32(p.LPay);
        }
 private void metroTile1_Click(object sender, EventArgs e)
 {
     if (metroTextBox1.Text != "" && metroTextBox2.Text != "" && metroTextBox3.Text != "" && metroTextBox4.Text != "" && metroTextBox5.Text != "" && metroTextBox6.Text != "" && metroTextBox7.Text != "" && metroTextBox5.Text == metroTextBox6.Text)
     {
         SignInEmp si  = new SignInEmp();
         AddEmp1   ae1 = new AddEmp1();
         ae1.id1      = Convert.ToChar(metroLabel5.Text);
         ae1.id2      = metroTextBox4.Text;
         ae1.NName    = metroTextBox7.Text;
         ae1.RRank    = metroLabel6.Text;
         ae1.SalGrade = metroLabel9.Text;
         ae1.PNumber  = metroTextBox1.Text;
         ae1.HAddress = metroTextBox3.Text;
         ae1.EAddress = metroTextBox2.Text;
         ae1.Pass     = metroTextBox5.Text;
         //ae1.DOB = this.metroDateTime1.Text;
         //ae1.Pict = filename;
         AddEmp2 ae2 = new AddEmp2();
         int     c   = ae2.addToDB();
         if (c == 1)
         {
             MetroFramework.MetroMessageBox.Show(this, " Error", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else
         {
             MetroFramework.MetroMessageBox.Show(this, " Successful", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
             metroTextBox1.Text = "";
             metroTextBox2.Text = "";
             metroTextBox3.Text = "";
             metroTextBox4.Text = "";
             metroTextBox5.Text = "";
             metroTextBox6.Text = "";
             metroTextBox7.Text = "";
             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.EmpInformations
                       where a.Under == si.id1 + si.id2
                       select new { Id1 = a.Id1, Id2 = a.Id2, Name = a.Name };
             metroGrid1.DataSource = str;
         }
     }
     else
     {
         MessageBox.Show("Error Ditected", "Please Fillup all the Boxes");
     }
 }
Exemple #15
0
        public int salgF()
        {
            SalGr sg = new SalGr();

            try
            {
                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.SalaryGs
                          select a;
                SalaryG p = str.Where(obj => obj.SalaryGrade == sg.SLG).First();
                sg.SAL  = Convert.ToInt32(p.Salary);
                sg.Heal = Convert.ToInt32(p.HealthAl);
                sg.HAL  = Convert.ToInt32(p.HomeAl);
                sg.Dl   = Convert.ToInt32(p.DayAl);
                return(0);
            }
            catch { return(1); }
        }
Exemple #16
0
        private void GeneralEmployeePanel_Load(object sender, EventArgs e)
        {
            if (ae1.id1 == 'F')
            {
                metroTile2.Enabled = false;
            }
            metroLabel10.Text = ae1.NName;
            metroLabel9.Text  = ae1.id1 + ae1.id2;
            metroLabel8.Text  = ae1.RRank;
            //metroLabel16.Text = ae1.DOB;
            metroLabel13.Text = ae1.Under;
            metroLabel7.Text  = ae1.PNumber;
            metroLabel6.Text  = ae1.EAddress;
            metroLabel11.Text = ae1.HAddress;
            // pictureBox1.Image = Image.FromFile(ae1.Pict);
            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();

            if (Convert.ToInt32(DateTime.Now.ToString("yyyy")) > p.Year)
            {
                p.LeaveDays = p.LeaveDays + 100;
                p.Year      = Convert.ToInt32(DateTime.Now.ToString("yyyy"));
                cntx.SubmitChanges();
            }
            //SignInEmp ae = new SignInEmp();
            EmpInfoLinqDataContext cntx1 = new EmpInfoLinqDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\Project Salary Manager\SalaryManager\SalaryManager\EmpployeeInfo.mdf;Integrated Security=True;Connect Timeout=30");
            var str1 = from a in cntx1.taxAndSals
                       select a;
            taxAndSal p1 = str1.Where(obj => obj.Id2 == ae.id2).First();

            if (p1.Count == 1 && Convert.ToInt32(DateTime.Now.ToString("dd")) > 1)
            {
                metroTile5.Enabled = false;
            }
            if (p1.Count == 1 && Convert.ToInt32(DateTime.Now.ToString("dd")) == 1)
            {
                metroTile5.Enabled = true;
                p1.Count           = 0;
                cntx.SubmitChanges();
            }
        }
 private void metroButton2_Click(object sender, EventArgs e)
 {
     try
     {
         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.EmpInformations
                   where a.Id2 == metroTextBox4.Text
                   select a;
         EmpInformation em = str.First();
         metroTextBox7.Text = em.Name;
         metroTextBox1.Text = em.PhoneNumber;
         metroTextBox2.Text = em.EmailAddress;
         metroTextBox3.Text = em.HomeAddress;
         metroLabel6.Text   = em.Rank;
         metroLabel9.Text   = em.SalaryGrade;
     }
     catch {
         MetroFramework.MetroMessageBox.Show(this, "Error", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #18
0
        private void metroButton14_Click(object sender, EventArgs e)
        {
            SignInEmp si = new SignInEmp();
            EmpInfoLinqDataContext cntx1 = new EmpInfoLinqDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\Project Salary Manager\SalaryManager\SalaryManager\EmpployeeInfo.mdf;Integrated Security=True;Connect Timeout=30");
            var str1 = from a in cntx1.taxAndSals
                       where a.Id2 == si.id2
                       select a;
            taxAndSal tt = str1.First();

            tt.PendingTax = tt.PendingTax - Convert.ToInt32(metroTextBox1.Text);
            cntx1.SubmitChanges();

            Form2    f = new Form2();
            Graphics g = f.CreateGraphics();

            bmp = new Bitmap(f.Size.Width, f.Size.Height, g);
            Graphics mg = Graphics.FromImage(bmp);

            mg.CopyFromScreen(f.Location.X, f.Location.Y, 0, 0, f.Size);
            printPreviewDialog1.ShowDialog();
        }
Exemple #19
0
        private void QueryTax_Load(object sender, EventArgs e)
        {
            SignInEmp si = new SignInEmp();
            TaxIn     ti = new TaxIn();
            AddEmp2   ae = new AddEmp2();
            FPayment  fp = new FPayment();
            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 == si.id2
                      select a;
            Loans_Leave tsl = str.First();

            metroLabel2.Text  = DateTime.Now.ToString("yyyy");
            metroLabel32.Text = Convert.ToString(tsl.SavingsAccount);
            ae.TPayment();
            EmpInfoLinqDataContext cntx1 = new EmpInfoLinqDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\Project Salary Manager\SalaryManager\SalaryManager\EmpployeeInfo.mdf;Integrated Security=True;Connect Timeout=30");
            var str1 = from a in cntx1.taxAndSals
                       where a.Id2 == si.id2
                       select a;
            taxAndSal tt = str1.First();

            metroLabel30.Text = Convert.ToString(tt.PendingTax);
        }
        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);
        }
        private void AddEmployee_Load_1(object sender, EventArgs e)
        {
            SignInEmp si = new SignInEmp();

            metroLabel5.Text = Convert.ToString(Convert.ToChar(si.id1 + 1));
            if (si.id1 == 'A')
            {
                metroLabel6.Text = "Junior Manager";
                metroLabel9.Text = "Grade 1";
            }
            else if (si.id1 == 'B')
            {
                metroLabel6.Text = "Exicutive Officer";
                metroLabel9.Text = "Grade 2";
            }
            if (si.id1 == 'C')
            {
                metroLabel6.Text = "Senior Engineer";
                metroLabel9.Text = "Grade 3";
            }
            if (si.id1 == 'D')
            {
                metroLabel6.Text = "Assitant Senior Engineer";
                metroLabel9.Text = "Grade 4";
            }
            if (si.id1 == 'E')
            {
                metroLabel6.Text = "Assistant Engineer";
                metroLabel9.Text = "Grade 5";
            }
            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.EmpInformations
                      where a.Under == si.id1 + si.id2
                      select new { Id1 = a.Id1, Id2 = a.Id2, Name = a.Name };

            metroGrid1.DataSource = str;
        }