Esempio n. 1
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);
            }
        }
Esempio n. 2
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();
        }
Esempio n. 3
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 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;
        }
Esempio n. 5
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);
        }
Esempio n. 6
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();
            }
        }
Esempio n. 7
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);
        }
Esempio n. 8
0
 partial void DeleteLoans_Leave(Loans_Leave instance);
Esempio n. 9
0
 partial void UpdateLoans_Leave(Loans_Leave instance);
Esempio n. 10
0
 partial void InsertLoans_Leave(Loans_Leave instance);