private void button1_Click(object sender, EventArgs e) { int TotalAmount = 0; int ConvanceAll = 0; int MedicalAll = 0; int Houserent = 0; try { Calculate.Salary(int.Parse(BasicSalarytextBox.Text), ref ConvanceAll, ref Houserent, ref MedicalAll); TotalAmount = int.Parse(BasicSalarytextBox.Text); TotalAmount += int.Parse(AmounttextBox.Text); TotalAmount += ConvanceAll; TotalAmount += MedicalAll; TotalAmount += Houserent; if (AttendanceAllowancetb.Text == "Yes") { TotalAmount += 1000; } ConvenceAllLBL.Text = "" + ConvanceAll; HouseRentLbl.Text = "" + Houserent; MedicalLBL.Text = "" + MedicalAll; Amountlabel.Text = "Total Amount : " + TotalAmount.ToString(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void CLCMethod() { try { calculateDecAmount(); } catch (Exception) { } int ConvanceAll = 0; int MedicalAll = 0; int Houserent = 0; try { Calculate.Salary(int.Parse(BasicSalarytextBox.Text), ref ConvanceAll, ref Houserent, ref MedicalAll); TotalAmount = int.Parse(BasicSalarytextBox.Text); TotalAmount += ConvanceAll; TotalAmount += MedicalAll; TotalAmount += Houserent; //if (AttendanceAllowancetb.Text == "Yes") //{ // TotalAmount += 1000; //} Amountlabel.Text = "Total Salary : " + TotalAmount.ToString(); DeductionSalaryTb.Text = "Salary After Deduction : " + (TotalAmount - DecAmount); } catch (Exception) { // MessageBox.Show(ex.Message); } }
private void GetDataMethod(String ID) { String ConnString = ConfigurationManager.ConnectionStrings["PayrollConn"].ConnectionString; SqlConnection conn = new SqlConnection(ConnString); SqlDataReader reader; String sql; using (conn) { //Statuslabel sql = "SP_SearchEmployee"; SqlCommand cmd1 = new SqlCommand(sql, conn); cmd1.CommandType = CommandType.StoredProcedure; cmd1.Parameters.Add("@id", SqlDbType.VarChar).Value = ID; conn.Open(); reader = cmd1.ExecuteReader(); reader.Read(); if (reader.HasRows) { // MessageBox.Show(reader[12].ToString());+ IDTB.Text = reader[0].ToString(); FirstNameTB.Text = reader[1].ToString(); LastNametextBox.Text = reader[2].ToString(); //DateOfBirthTB.Text = reader[3].ToString(); //GenderTB.Text = reader[4].ToString(); //ContacttextBox.Text = reader[5].ToString(); //NICtextBox.Text = reader[6].ToString(); //HouseNOtextBox.Text = reader[7].ToString(); //AddLine1Tb.Text = reader[8].ToString(); //AddLine2tb.Text = reader[9].ToString(); //postCodetextBox.Text = reader[10].ToString(); DepartmentTextBoc.Text = reader[11].ToString(); designationtextBox.Text = reader[12].ToString(); // StatuscomboBox.Text = "" + reader[13]; // DateOfHired.Text = reader[14].ToString(); BasicSalarytextBox.Text = reader[15].ToString(); // JobTitletextBox.Text = reader[16].ToString(); ////PassTb.Text = reader[17].ToString(); // dateTimePicker1.Value = DateTime.Now; AddedAllowanceTB.Clear(); DeductedAmountTB.Clear(); NetSalaryTB.Clear(); MonthYear.Enabled = true; } else { MessageBox.Show("It Does Not Exist", "Emply", MessageBoxButtons.OK, MessageBoxIcon.Error); } } try { int ConvanceAll = 0; int MedicalAll = 0; int Houserent = 0; Calculate.Salary(int.Parse(BasicSalarytextBox.Text), ref ConvanceAll, ref Houserent, ref MedicalAll); TotalAmount = int.Parse(BasicSalarytextBox.Text); TotalAmount += ConvanceAll; TotalAmount += MedicalAll; TotalAmount += Houserent; ConvancetextBox.Text = "" + ConvanceAll; HouseRentTextBoc.Text = "" + Houserent; MedicalAlltextBox.Text = "" + MedicalAll; TotalAmounttextBox.Text = "" + TotalAmount.ToString(); if (Calculate.IncomeText(int.Parse(BasicSalarytextBox.Text)) == 0) { IncomeTextextBox.Text = "No Tex Applied"; } else { IncomeTextextBox.Text = "" + Calculate.IncomeText(int.Parse(BasicSalarytextBox.Text)); incomeTex = Calculate.IncomeText(int.Parse(BasicSalarytextBox.Text)); } } catch (Exception) { } }