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 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); } } }
private void metroTile1_Click(object sender, EventArgs e) { SignInEmp ae = new SignInEmp(); AddEmp2 ae1 = new AddEmp2(); if (metroTextBox1.Text == "" || metroTextBox2.Text == "") { MetroFramework.MetroMessageBox.Show(this, "Please Fillup All The Fields", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { ae.id1 = Convert.ToChar(metroTextBox3.Text); ae.id2 = metroTextBox1.Text; ae.Pass = metroTextBox2.Text; try { ae1.getDB(); } catch { MetroFramework.MetroMessageBox.Show(this, "Please Enter ID & Password Correctly", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } //Form1.Hide(); }
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 metroTile1_Click(object sender, EventArgs e) { try { if (metroRadioButton1.Checked == false) { SalGr sg = new SalGr(); AddEmp2 ae = new AddEmp2(); sg.SLG = metroComboBox1.SelectedItem.ToString(); sg.HAL = Convert.ToInt32(metroTextBox2.Text); sg.Heal = Convert.ToInt32(metroTextBox3.Text); //sg.HAL2 = Convert.ToInt32(metroTextBox2.Text); //sg.Heal2 = Convert.ToInt32(metroTextBox3.Text); sg.SAL = Convert.ToInt32(metroTextBox1.Text); sg.Dl = Convert.ToInt32(metroTextBox5.Text); int s = ae.salgE(); if (s == 0) { MetroFramework.MetroMessageBox.Show(this, "Successfully Changed", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MetroFramework.MetroMessageBox.Show(this, "There Is An Error", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { SalGr sg = new SalGr(); AddEmp2 ae = new AddEmp2(); sg.SLG = metroComboBox1.SelectedItem.ToString(); sg.HAL = Convert.ToInt32(metroTextBox2.Text); sg.Heal = Convert.ToInt32(metroTextBox3.Text); //sg.HAL2 = Convert.ToInt32(metroTextBox2.Text); //sg.Heal2 = Convert.ToInt32(metroTextBox3.Text); sg.SAL = Convert.ToInt32(metroTextBox1.Text); sg.Dl = Convert.ToInt32(metroTextBox5.Text); string bon = metroComboBox2.SelectedItem.ToString(); sg.BON = Convert.ToInt32(bon); int s = ae.salgE(); if (s == 0) { MetroFramework.MetroMessageBox.Show(this, "Successfully Changed", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); metroRadioButton1.Checked = false; } else { MetroFramework.MetroMessageBox.Show(this, "There Is An Error", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } catch { MetroFramework.MetroMessageBox.Show(this, "Please Fill Up All the fields", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
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); }
private void metroTile1_Click(object sender, EventArgs e) { ae1.Pass = metroTextBox4.Text; ae1.PNumber = metroTextBox1.Text; ae1.EAddress = metroTextBox2.Text; ae1.HAddress = metroTextBox3.Text; AddEmp2 aem = new AddEmp2(); aem.editp(); metroTextBox4.Text = ""; MessageBox.Show("Successful", "Successful"); }
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); } }
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); } }
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"); } }
private void metroTile1_Click(object sender, EventArgs e) { if (si.Pass == metroTextBox3.Text && metroTextBox1.Text == metroTextBox2.Text) { AddEmp2 ae = new AddEmp2(); string s = metroTextBox1.Text; ae.changeP(s); si.Pass = metroTextBox1.Text; MessageBox.Show("SUCCESSFUL", "SUCCESSFULLY UPDATED"); metroTextBox1.Text = ""; metroTextBox2.Text = ""; metroTextBox3.Text = ""; } else { MessageBox.Show("ERROR", "Please Enter the New & Old Passwords Properly"); } }
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 metroButton1_Click(object sender, EventArgs e) { SalGr sg = new SalGr(); AddEmp2 ae = new AddEmp2(); sg.SLG = metroComboBox1.SelectedItem.ToString(); int s = ae.salgF(); if (s == 1) { MetroFramework.MetroMessageBox.Show(this, "Error", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MetroFramework.MetroMessageBox.Show(this, "The values Are Retrived.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); metroTextBox2.Text = Convert.ToString(sg.HAL); metroTextBox1.Text = Convert.ToString(sg.SAL); metroTextBox3.Text = Convert.ToString(sg.Heal); metroTextBox5.Text = Convert.ToString(sg.Dl); } }
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 metroButton1_Click(object sender, EventArgs e) { 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(); AddEmp2 ae1 = new AddEmp2(); SaveS ss = new SaveS(); if (ss.CO <= 1) { ae1.fSA(); } Form2 f3 = new Form2(); Form1 f2 = new Form1(f3); f3.change(); }
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"); } }
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); } }