Example #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 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);
        }
Example #3
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);
        }
Example #4
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); }
        }
Example #5
0
 partial void DeleteSalaryG(SalaryG instance);
Example #6
0
 partial void UpdateSalaryG(SalaryG instance);
Example #7
0
 partial void InsertSalaryG(SalaryG instance);