/// <summary> /// Handles the Click event of the btnLogin control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> /// <remarks></remarks> private void btnLogin_Click(object sender, EventArgs e) { try { if (txtUserid.Text.Trim() == string.Empty) { errorProvider1.SetError(txtUserid, "Enter UserId"); txtUserid.Focus(); } else { errorProvider1.Clear(); } if (txtPassword.Text.Trim() == string.Empty) { errorProvider1.SetError(txtPassword, "Enter Password"); } else { errorProvider1.Clear(); } if (txtUserid.Text.Trim() != "" && txtPassword.Text.Trim() != "") { //dslogin = GC.ExcelConnectivity("Select * from [User$] where [Emp No] ='" + txtUserid.Text.Trim() + "' and Password='******' ", "OleDbConnString_UserLoginVisakhapatnam"); dslogin = GC.ExcelConnectivity("Select * from [Sheet1$] where [Emp No] ='" + txtUserid.Text.Trim() + "' and Password='******' ", "OleDbConnString_UserLogin_" + "" + locationType + ""); // checking the credentials of auser if (dslogin.Tables[0].Rows.Count > 0) { this.Close(); Member_Account objMA = new Member_Account(dslogin.Tables[0].Rows[0]["Emp No"].ToString(), dslogin.Tables[0].Rows[0]["Employee Name"].ToString(), locationType); // redirecting to Member Account objMA.Show(); } else { lblerror.Text = "The UserId or Password you entered is incorrect."; txtUserid.Text = ""; txtPassword.Text = ""; txtUserid.Focus(); } } } catch (Exception ex) { GC.ErrorLoging(ex.ToString()); lblRelogin.Text = "Please Relogin"; txtUserid.Text = ""; txtPassword.Text = ""; txtUserid.Focus(); } }
private void SelectYearMonth() { GeneralClass GC = new GeneralClass(); DataSet dsOT = new DataSet(); dsOT = null; //dsLOP.DataSource = null; label2.Text = String.Empty; if (cmbYear.SelectedIndex == 0) { pnlLOP.Visible = false; label2.Text = "Please Select Year"; return; } else if (cmb_Selectmnth.SelectedIndex == 0) { label2.Text = "Please Select Month"; } else if (cmbYear.SelectedIndex != 0 && cmb_Selectmnth.SelectedIndex != 0) { try { //Query for Geting Data form Excel sheet dsLOP = GC.ExcelConnectivityforLOP("Select * FROM [Sheet1$] where [Emp No]=" + LocalEmpId + "", "OleDbConnString_LossOfPay", cmb_Selectmnth.SelectedIndex.ToString(), cmbYear.SelectedItem.ToString()); if (dsLOP.Tables[0].Rows.Count > 0) { pnlLOP.Visible = true; dgvLOP.Visible = true; dgvLOP.AutoGenerateColumns = true; bindingSource1.DataSource = dsLOP.Tables[0]; dgvLOP.DataSource = bindingSource1; } else { pnlLOP.Visible = false; dgvLOP.Visible = false; label2.Visible = true; label2.Text = "No Details Available"; } } catch (Exception ex) { GC.ErrorLoging(ex.ToString()); pnlLOP.Visible = false; dgvLOP.Visible = false; label2.Visible = true; label2.Text = "No Details Available"; } } }
/// <summary> /// Initializes a new instance of the <see cref="LIC_Policies"/> class. /// </summary> /// <param name="EmpId">The emp id.</param> /// <param name="EmpName">Name of the emp.</param> /// <remarks></remarks> public LIC_Policies(string EmpId, string EmpName, string locallocationType) { InitializeComponent(); localEmpId = EmpId; localEmpName = EmpName; lblExName.Text = EmpName; locationType = locallocationType; // lblDt.Text = DateTime.Now.ToString("dd-MM-yyyy"); lblDt.Text = ConfigurationManager.AppSettings["LastUpdatedDate"]; try { _am.WarningMinutes = Convert.ToDouble(ConfigurationManager.AppSettings["WarningMinutes"]); _am.MaxMinutesIdle = Convert.ToDouble(ConfigurationManager.AppSettings["MaxMinutesIdle"]); _am.Idle += new EventHandler(am_Idle); activityMonitorBindingSource.DataSource = _am; } catch { MessageBox.Show("Entered into wrong data"); } try { //Query for Geting Data form Excel sheet dsLIC = GC.ExcelConnectivity("select * from [Sheet1$] where [Emp No] = " + EmpId + "", "OleDbConnString_LIC_Policies"); if (dsLIC.Tables[0].Rows.Count > 0) { dgvLIC.AutoGenerateColumns = true; bindingSource1.DataSource = dsLIC.Tables[0]; dgvLIC.DataSource = bindingSource1; } else { lblError.Visible = true; lblError.Text = "No Details Available"; } } catch (Exception ex) { GC.ErrorLoging(ex.ToString()); this.Close(); Employee_Lgn ObjEL = new Employee_Lgn(locationType); ObjEL.Show(); lblError.Visible = true; lblError.Text = "No Details Available"; } }
/// <summary> /// Initializes a new instance of the <see cref="Leave_Summary"/> class. /// </summary> /// <param name="EmpId">The emp id.</param> /// <param name="EmpName">Name of the emp.</param> /// <param name="ViewDetails">The view details.</param> /// <remarks></remarks> public Leave_Summary(string EmpId, string EmpName, string ViewDetails, string locallocationType) { InitializeComponent(); localEmpId = EmpId; lblExName.Text = EmpName; localEmpName = EmpName; localLeaveDetails = ViewDetails; locationtype = locallocationType; // lblUpdatedDate.Text = DateTime.Now.ToString("dd-MM-yyyy"); lblUpdatedDate.Text = ConfigurationManager.AppSettings["LastUpdatedDate"]; try { _am.WarningMinutes = Convert.ToDouble(ConfigurationManager.AppSettings["WarningMinutes"]); _am.MaxMinutesIdle = Convert.ToDouble(ConfigurationManager.AppSettings["MaxMinutesIdle"]); _am.Idle += new EventHandler(am_Idle); activityMonitorBindingSource.DataSource = _am; } catch { } try { dsTotalLeaves = GC.ExcelConnectivity("select * from [Sheet1$] where [Emp No]=" + EmpId + " and [Leave Type]='" + ViewDetails + "'", "OleDbConnString_LeaveRecords_" + "" + locationtype + ""); if (dsTotalLeaves.Tables[0].Rows.Count > 0) { dGVLeaveSummary.AutoGenerateColumns = true; bindingSource1.DataSource = dsTotalLeaves.Tables[0]; dGVLeaveSummary.DataSource = bindingSource1; LblLeaveType.Visible = true; LblLeaveType.Text = ViewDetails; } else { pnlLeaveSummary.Visible = false; lblLeaveREC.Visible = true; lblLeaveREC.Text = "No Details Available"; } } catch (Exception ex) { GC.ErrorLoging(ex.ToString()); pnlLeaveSummary.Visible = false; lblLeaveREC.Visible = true; lblLeaveREC.Text = "No Details Available"; } }
/// <summary> /// Initializes a new instance of the <see cref="Total_Leaves_Per_Month"/> class. /// </summary> /// <param name="EmpId">The emp id.</param> /// <param name="EmpName">Name of the emp.</param> /// <remarks></remarks> public Total_Leaves_Per_Month(string EmpId, string EmpName, string locallocationtype) { InitializeComponent(); localEmpId = EmpId; lblExName.Text = EmpName; localEmpName = EmpName; locationtype = locallocationtype; // lbl_Date.Text = DateTime.Now.ToString("dd-MM-yyyy"); lbl_Date.Text = ConfigurationManager.AppSettings["LastUpdatedDate"]; try { _am.WarningMinutes = Convert.ToDouble(ConfigurationManager.AppSettings["WarningMinutes"]); _am.MaxMinutesIdle = Convert.ToDouble(ConfigurationManager.AppSettings["MaxMinutesIdle"]); _am.Idle += new EventHandler(am_Idle); activityMonitorBindingSource.DataSource = _am; } catch { } try { /*emp details sheet connection */ dsTotalLeaves = GC.ExcelConnectivity("Select * from [Sheet1$] where [Emp No]=" + EmpId + "", "OleDbConnString_TotalLeaves_" + "" + locationtype + ""); if (dsTotalLeaves.Tables[0].Rows.Count > 0) { /* binding data from empdetails to get user name*/ GrdvwTotalLeaveRecords.AutoGenerateColumns = true; bindingSource1.DataSource = dsTotalLeaves.Tables[0]; GrdvwTotalLeaveRecords.DataSource = bindingSource1; } else { pnlTotalLeave.Visible = false; lbl_Error.Visible = true; lbl_Error.Text = "No Details Available"; } } catch (Exception ex) { GC.ErrorLoging(ex.ToString()); lbl_Error.Visible = true; lbl_Error.Text = "No Details Available"; } }
/// <summary> /// Initializes a new instance of the <see cref="Loss_Of_Pay_Summary"/> class. /// </summary> /// <param name="EmpId">The emp id.</param> /// <param name="EmpName">Name of the emp.</param> /// <remarks></remarks> public Loss_Of_Pay_Summary(string EmpId, string EmpName, string LOPMonth, string locallocationtype) { InitializeComponent(); LocalEmpId = EmpId; LocalEmpName = EmpName; lblExName.Text = EmpName; LocalLOPMonth = LOPMonth; locationtype = locallocationtype; // lblupdateddate.Text = DateTime.Now.ToString("dd-MM-yyyy"); lblupdateddate.Text = ConfigurationManager.AppSettings["LastUpdatedDate"]; try { _am.WarningMinutes = Convert.ToDouble(ConfigurationManager.AppSettings["WarningMinutes"]); _am.MaxMinutesIdle = Convert.ToDouble(ConfigurationManager.AppSettings["MaxMinutesIdle"]); _am.Idle += new EventHandler(am_Idle); activityMonitorBindingSource.DataSource = _am; } catch { } try { /*Query For Geting Data from Excel Sheet */ dsLOPS = GC.ExcelConnectivity("select [ LOP Dates] from [LOP_Summary$] where [Emp No]='" + EmpId + "' and [Month]='" + LOPMonth + "'", "OleDbConnString_LossOfPay_" + "" + locationtype + ""); if (dsLOPS.Tables[0].Rows.Count > 0) { dataGridView1.AutoGenerateColumns = true; bindingSource1.DataSource = dsLOPS.Tables[0]; dataGridView1.DataSource = bindingSource1; } else { lbl_Error.Visible = true; lbl_Error.Text = "No Details Available"; } } catch (Exception ex) { GC.ErrorLoging(ex.ToString()); lbl_Error.Text = "No Details Available"; } }
private void btnSubmit_click(object sender, EventArgs e) { try { //String pwd = txtCp.Text; if (txnewCp.Text == txtCnfrmCp.Text) { status = GC.ExcelConnectivityforUpdate("update [Sheet1$] set [Password]= '" + txtCnfrmCp.Text + "' where [Emp No] ='" + localEmpId + "' and Password='******'", "OleDbConnString_UserLogin_" + "" + locallocationType + ""); if (status == 1) { lblerror.Visible = true; lblerror.Text = "Password Changed Successfully."; } else { lblerror.Visible = true; lblerror.Text = "Please Try Again!"; } } else { lblerror.Visible = true; lblerror.Text = "The New Password and Confirm password doesn't match."; txnewCp.Text = ""; txtCnfrmCp.Text = ""; txtCnfrmCp.Focus(); } } catch (Exception ex) { GC.ErrorLoging(ex.ToString()); lblerror.Visible = true; lblerror.Text = "Please Relogin"; txnewCp.Text = ""; txtCnfrmCp.Text = ""; txnewCp.Focus(); } }
/// <summary> /// Initializes a new instance of the <see cref="Loan_Statement"/> class. /// </summary> /// <param name="EmpId">The emp id.</param> /// <param name="EmpName">Name of the emp.</param> /// <param name="LoanType">Type of the loan.</param> /// <remarks></remarks> public Loan_Statement(string EmpId, string EmpName, string LoanType, string locallocationType) { InitializeComponent(); locationType = locallocationType; localEmpId = EmpId; localEmpName = EmpName; lblEname.Text = EmpName; localLoanType = LoanType; if (LoanType == "9HLA") { lblLoantype.Text = "HOUSING LOAN"; } else if (LoanType == "9PFN") { lblLoantype.Text = "PF LOAN"; } else if (LoanType == "9VEH") { lblLoantype.Text = "VEHICLE LOAN"; } else if (LoanType == "9FES") { lblLoantype.Text = "FESTIVE ADVANCE"; } else if (LoanType == "9SAD") { lblLoantype.Text = "SALARY ADVANCE"; } else { lblLoantype.Text = "BENEVOLENT LOAN"; } //lblDate.Text = DateTime.Now.ToString("dd-MM-yyyy"); lblDate.Text = ConfigurationManager.AppSettings["LastUpdatedDate"]; try { _am.WarningMinutes = Convert.ToDouble(ConfigurationManager.AppSettings["WarningMinutes"]); _am.MaxMinutesIdle = Convert.ToDouble(ConfigurationManager.AppSettings["MaxMinutesIdle"]); _am.Idle += new EventHandler(am_Idle); activityMonitorBindingSource.DataSource = _am; } catch { } try { // dsLoanStmt = GC.ExcelConnectivity("Select * from [LoanFullDetails$] where [Emp No] ='" + EmpId + "' and [Loan Type] = '" + localLoanType + "'", "OleDbConnString_Loan_FullDetails"); dsLoanStmt = GC.ExcelConnectivity("Select * from [Sheet1$] where [Emp No] =" + EmpId + " and [Wage Type] = '" + LoanType + "'", "OleDbConnString_LoanDetails"); //retrieving data from LoanFull Details sheet if (dsLoanStmt.Tables[0].Rows.Count > 0) { lblOpeningBal.Text = dsLoanStmt.Tables[0].Rows[0]["Loan Amount"].ToString(); lblLoanRecieved.Text = (Convert.ToDouble(dsLoanStmt.Tables[0].Rows[0]["Loan Amount"]) - Convert.ToDouble(dsLoanStmt.Tables[0].Rows[0]["Loan Balance"])).ToString(); lblClosingBal.Text = dsLoanStmt.Tables[0].Rows[0]["Loan Balance"].ToString(); } else { lblerror.Visible = true; panelloanstmt.Hide(); lblerror.Text = "No Loans Availed"; } } catch (Exception ex) { GC.ErrorLoging(ex.ToString()); lblerror.Text = "No Loans Availed"; } }
/// <summary> /// Initializes a new instance of the <see cref="Loan_Balance"/> class. /// </summary> /// <param name="EmpId">The emp id.</param> /// <param name="EmpName">Name of the emp.</param> /// <param name="LoanType">Type of the loan.</param> /// <remarks></remarks> public Loan_Balance(string EmpId, string EmpName, string LoanType, string locallocationtype) { InitializeComponent(); localEmpId = EmpId; localEmpName = EmpName; lblEmpName.Text = EmpName; localLoan = LoanType; if (LoanType == "9HLA") { lblloanType.Text = "HOUSING LOAN"; } else if (LoanType == "9PFN") { lblloanType.Text = "PF LOAN"; } else if (LoanType == "9VEH") { lblloanType.Text = "VEHICLE LOAN"; } else if (LoanType == "9FES") { lblloanType.Text = "FESTIVE ADVANCE"; } else if (LoanType == "9SAD") { lblloanType.Text = "SALARY ADVANCE"; } else { lblloanType.Text = "BENEVOLENT LOAN"; } locationtype = locallocationtype; // lblDate.Text = DateTime.Now.ToString("dd-MM-yyyy"); lblDate.Text = ConfigurationManager.AppSettings.Get("LastUpdatedDate"); try { _am.WarningMinutes = Convert.ToDouble(ConfigurationManager.AppSettings["WarningMinutes"]); _am.MaxMinutesIdle = Convert.ToDouble(ConfigurationManager.AppSettings["MaxMinutesIdle"]); _am.Idle += new EventHandler(am_Idle); activityMonitorBindingSource.DataSource = _am; } catch { } try { // dsClosingbal = GC.ExcelConnectivity("select * from [LoanFullDetails$] where [Emp No] = '" + EmpId + "' and [Loan Type]= '" + LoanType + "'", "OleDbConnString_Loan_FullDetails"); dsClosingbal = GC.ExcelConnectivity("Select * from [Sheet1$] where [Emp No]= " + localEmpId + " and [Wage Type] = '" + localLoan + "'", "OleDbConnString_LoanDetails"); //retrieving closing amount from LoanFullDetails sheet if (dsClosingbal.Tables[0].Rows.Count > 0) { // lblAmtClosingDate.Text = System.DateTime.Now.ToShortDateString(); lblLoanBalance.Text = "Your Loan Balance as on date " + ConfigurationManager.AppSettings.Get("LastUpdatedDate") + " is " + dsClosingbal.Tables[0].Rows[0]["Loan Balance"].ToString() + ""; } else { lblLoanBalance.Visible = false; lblerror.Visible = true; lblerror.Text = "No Loans Availed"; } } catch (Exception ex) { GC.ErrorLoging(ex.ToString()); lblerror.Text = "No Loans Availed"; } }
/// <summary> /// Initializes a new instance of the <see cref="LoanDetails_Brief"/> class. /// </summary> /// <param name="EmpId">The emp id.</param> /// <param name="EmpName">Name of the emp.</param> /// <param name="LoanType">Type of the loan.</param> /// <remarks></remarks> public LoanDetails_Brief(string EmpId, string EmpName, string LoanType, string locallocationType) { InitializeComponent(); locationType = locallocationType; LocalEmpId = EmpId; localEmpName = EmpName; lblEmpName.Text = EmpName; localLoanType = LoanType; if (LoanType == "9HLA") { lblLoanType.Text = "HOUSING LOAN"; } else if (LoanType == "9PFN") { lblLoanType.Text = "PF LOAN"; } else if (LoanType == "9VEH") { lblLoanType.Text = "VEHICLE LOAN"; } else if (LoanType == "9FES") { lblLoanType.Text = "FESTIVE ADVANCE"; } else if (LoanType == "9SAD") { lblLoanType.Text = "SALARY ADVANCE"; } else { lblLoanType.Text = "BENEVOLENT LOAN"; } // lblDt.Text = DateTime.Now.ToString("dd-MM-yyyy"); lblDt.Text = ConfigurationManager.AppSettings["LastUpdatedDate"]; try { _am.WarningMinutes = Convert.ToDouble(ConfigurationManager.AppSettings["WarningMinutes"]); _am.MaxMinutesIdle = Convert.ToDouble(ConfigurationManager.AppSettings["MaxMinutesIdle"]); _am.Idle += new EventHandler(am_Idle); activityMonitorBindingSource.DataSource = _am; } catch { } try { dsLoanDetails = GC.ExcelConnectivity("Select * from [Sheet1$] where [Emp No] =" + EmpId + " and [Wage Type] = '" + localLoanType + "'", "OleDbConnString_LoanDetails"); //retrieving data from LoanDetails sheet if (dsLoanDetails.Tables[0].Rows.Count > 0) { pnlLOP.Visible = true; dgvLoan.Visible = true; dgvLoan.AutoGenerateColumns = true; bindingSource1.DataSource = dsLoanDetails.Tables[0]; dgvLoan.DataSource = bindingSource1; // lblLoanTknAmt.Text = Convert.ToDateTime( dsLoanDetails.Tables[0].Rows[0]["Loan Taken Date"].ToString()).ToShortDateString(); // lblLoanAmt.Text = dsLoanDetails.Tables[0].Rows[0]["Loan Amount"].ToString(); //lblInterest.Text = dsLoanDetails.Tables[0].Rows[0]["Interest Percent"].ToString(); //// lblNoofInstnts.Text = dsLoanDetails.Tables[0].Rows[0]["No of Installments"].ToString(); //appending data to the controls // lblMonthlyEmi.Text = dsLoanDetails.Tables[0].Rows[0]["Monthly EMI"].ToString(); //// lblLoanRecovry.Text = dsLoanDetails.Tables[0].Rows[0]["Loan Recovery"].ToString(); } else { pnlLOP.Visible = false; dgvLoan.Visible = false; lblerror.Visible = true; lblerror.Text = "No Loans Availed"; } } catch (Exception ex) { GC.ErrorLoging(ex.ToString()); pnlLOP.Visible = false; dgvLoan.Visible = false; lblerror.Visible = true; lblerror.Text = "No Loans Availed"; } }
/// <summary> /// Initializes a new instance of the <see cref="Medical_Expences"/> class. /// </summary> /// <param name="EmpId">The emp id.</param> /// <param name="EmpName">Name of the emp.</param> /// <remarks></remarks> public Medical_Expences(string EmpId, string EmpName, string locallocationType) { InitializeComponent(); LocalEmpId = EmpId; lblExName.Text = EmpName; localEmpName = EmpName; locationType = locallocationType; int i; double BalanceSum = 0; // lblUpdatedDate.Text = DateTime.Now.ToString("dd-MM-yyyy"); lblUpdatedDate.Text = ConfigurationManager.AppSettings["LastUpdatedDate"]; try { _am.WarningMinutes = Convert.ToDouble(ConfigurationManager.AppSettings["WarningMinutes"]); _am.MaxMinutesIdle = Convert.ToDouble(ConfigurationManager.AppSettings["MaxMinutesIdle"]); _am.Idle += new EventHandler(am_Idle); activityMonitorBindingSource.DataSource = _am; } catch { } try { dsMedicalExp = GC.ExcelConnectivity("select * from [Sheet1$] where [Emp No]='" + EmpId + "'", "OleDbConnString_Medical_Expences_" + "" + locationType + ""); if (dsMedicalExp.Tables[0].Rows.Count > 0) { dGVMedicalExpences.AutoGenerateColumns = true; lblTotalEligibleAmount.Text = dsMedicalExp.Tables[0].Rows[0]["Eligible Amount"].ToString() + " as on " + dsMedicalExp.Tables[0].Rows[0]["Eligible Amount Date"].ToString(); lblAvailbleBalance.Text = dsMedicalExp.Tables[0].Rows[0]["Balance"].ToString(); bindingSource1.DataSource = dsMedicalExp.Tables[0]; dGVMedicalExpences.DataSource = bindingSource1; this.dGVMedicalExpences.Columns["Eligible Amount"].Visible = false; this.dGVMedicalExpences.Columns["Eligible Amount Date"].Visible = false; this.dGVMedicalExpences.Columns["Balance"].Visible = false; this.dGVMedicalExpences.Columns["Emp No"].Visible = false; this.dGVMedicalExpences.Columns["Payroll Area"].Visible = false; } else { pnlMedicalExp.Visible = false; lblError.Visible = true; lblError.Text = "No Data Available"; lblAvailBal.Visible = false; lblAvailbleBalance.Visible = false; lblTotalEligibleAmount.Visible = false; lblTotEligibleAmt.Visible = false; } } catch (Exception ex) { GC.ErrorLoging(ex.ToString()); pnlMedicalExp.Visible = false; lblError.Visible = true; lblError.Text = "No Data Available"; lblAvailBal.Visible = false; lblAvailbleBalance.Visible = false; lblTotalEligibleAmount.Visible = false; lblTotEligibleAmt.Visible = false; } }
/// <summary> /// Redirecting to Welcome Screen form /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.Forms.LinkLabelLinkClickedEventArgs"/> instance containing the event data.</param> /// <remarks></remarks> private void SelectYearMonth() { GeneralClass GC = new GeneralClass(); DataSet dsOT = new DataSet(); dsOT = null; dgvOT.DataSource = null; lblErrorMsg.Text = String.Empty; if (cmbSelectYear.SelectedIndex == 0 && cmbSelectMonth.SelectedIndex == 0) { pnlOT.Visible = false; lblcomboxerror.Text = "Please Select Year And Month "; return; } else if (cmbSelectYear.SelectedIndex == 0) { pnlOT.Visible = false; lblcomboxerror.Text = "Please Select Year "; return; } else if (cmbSelectMonth.SelectedIndex == 0) { pnlOT.Visible = false; lblcomboxerror.Text = "Please Select Month "; return; } else if (cmbSelectYear.SelectedIndex != 0 && cmbSelectMonth.SelectedIndex != 0) { try { // Query for Geting Data form Excel sheet dsOT = GC.ExcelConnectivityforOT("Select * FROM [Sheet1$] where [Emp No]=" + localEmpId + "", cmbSelectMonth.SelectedIndex.ToString(), cmbSelectYear.SelectedItem.ToString(), locationType); if (dsOT.Tables[0].Rows.Count > 0) { pnlOT.Visible = true; dgvOT.AutoGenerateColumns = true; bindingSource1.DataSource = dsOT.Tables[0]; dgvOT.DataSource = bindingSource1; this.dgvOT.Columns["Emp No"].Visible = false; this.dgvOT.Columns["Payroll Area"].Visible = false; dgvOT.Visible = true; } else { pnlOT.Visible = false; lblErrorMsg.Visible = true; lblErrorMsg.Text = "No Details Available"; } } catch (Exception ex) { GC.ErrorLoging(ex.ToString()); pnlOT.Visible = false; lblErrorMsg.Visible = true; lblErrorMsg.Text = "No Details Available"; } } lblcomboxerror.Text = string.Empty; }
public View_Pay_slip(string EmpId, string EmpName, string year, string month, string locallocationType) { InitializeComponent(); localEmpId = EmpId; localEmpName = EmpName; locationType = locallocationType; try { _am.WarningMinutes = Convert.ToDouble(ConfigurationManager.AppSettings["WarningMinutes"]); _am.MaxMinutesIdle = Convert.ToDouble(ConfigurationManager.AppSettings["MaxMinutesIdle"]); _am.Idle += new EventHandler(am_Idle); activityMonitorBindingSource.DataSource = _am; } catch { } try { dsPayslip = GC.ExcelConnectivityforPayslip("Select * from [Sheet1$] where [Emp No]='" + EmpId + "'", "OleDbConnString_Payslip", month, year, locallocationType); //retrieving data from payslip_part_Empdetails sheet if (dsPayslip.Tables[0].Rows.Count > 0) { // Personal Info start lbl_Address.Text = "Beach Road,Kakinada,533003"; lblHelfDesk.Text = "*****@*****.**"; panel1.Visible = true; lblpayslipdate.Text = dsPayslip.Tables[0].Rows[0]["Month"].ToString() + "," + year; if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Emp No"]) != 0) { lblEmpNo.Text = dsPayslip.Tables[0].Rows[0]["Emp No"].ToString(); } else { lblEmpNo.Visible = false; label2.Visible = false; } lblEmpName.Text = dsPayslip.Tables[0].Rows[0]["Employee Name"].ToString(); lblDesignation.Text = dsPayslip.Tables[0].Rows[0]["Designation"].ToString(); lblDivision.Text = dsPayslip.Tables[0].Rows[0]["Cost Center Desc"].ToString(); lblDepartment.Text = dsPayslip.Tables[0].Rows[0]["Department"].ToString(); //lbl_Address.Text = dsPayslip.Tables[0].Rows[0]["Address"].ToString(); // lblLocation.Text = dsPayslip.Tables[0].Rows[0]["Location"].ToString(); //lblFather_HusbandName.Text = dsPayslip.Tables[0].Rows[0]["Father/Husband Name"].ToString(); lblGrade.Text = dsPayslip.Tables[0].Rows[0]["Grade"].ToString(); //lblHelfDesk.Text = dsPayslip.Tables[0].Rows[0]["Help Desk"].ToString(); lblPaymentType.Text = dsPayslip.Tables[0].Rows[0]["Payment Method"].ToString(); //lblDOB.Text = Convert.ToDateTime(dsPayslip.Tables[0].Rows[0]["Date of Birth"].ToString()).ToShortDateString(); lblDateofJoining.Text = dsPayslip.Tables[0].Rows[0]["D O J"].ToString(); if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["DaysWorked"]) != 0) { lblDaysPresent.Text = dsPayslip.Tables[0].Rows[0]["DaysWorked"].ToString(); } else { lblDaysPresent.Visible = false; label37.Visible = false; } //lblDaysPresent.Text = dsPayslip.Tables[0].Rows[0]["Emp_No"].ToString(); //lblBankName.Text = dsPayslip.Tables[0].Rows[0]["Bank Name"].ToString(); //lblPanNo.Text = dsPayslip.Tables[0].Rows[0]["PAN No"].ToString(); //if (Convert.ToInt64(dsPayslip.Tables[0].Rows[0]["Bank Account No"]) != 0) //{ // lblBankAccNo.Text = dsPayslip.Tables[0].Rows[0]["Bank Account No"].ToString(); //} //else //{ //lblBankAccNo.Visible = false; //label12.Visible = false; //} //if (Convert.ToInt64(dsPayslip.Tables[0].Rows[0]["ESI No"]) != 0) //{ // lblESINo.Text = dsPayslip.Tables[0].Rows[0]["ESI No"].ToString(); //} //else //{ //lblESINo.Visible = false; //label34.Visible = false; //} //if (Convert.ToInt64(dsPayslip.Tables[0].Rows[0]["PF No"]) != 0) //{ // lblPFNo.Text = dsPayslip.Tables[0].Rows[0]["PF No"].ToString(); //} //else //{ // lblPFNo.Visible = false; // label62.Visible = false; //} // Personal Info end // Earning if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Basic"]) != 0) { lblBasic.Text = dsPayslip.Tables[0].Rows[0]["Basic"].ToString(); } else { lblBasic.Visible = false; label15.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Special Pay"]) != 0) { lblPerPay.Text = dsPayslip.Tables[0].Rows[0]["Special Pay"].ToString(); } else { lblPerPay.Visible = false; label24.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Variable DA"]) != 0) { lblVDA.Text = dsPayslip.Tables[0].Rows[0]["Variable DA"].ToString(); } else { lblVDA.Visible = false; label23.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Education Allowance"]) != 0) { lblEduAllow.Text = dsPayslip.Tables[0].Rows[0]["Education Allowance"].ToString(); } else { lblEduAllow.Visible = false; label19.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Fixed Local Travel Expens"]) != 0) { lblFLTE.Text = dsPayslip.Tables[0].Rows[0]["Fixed Local Travel Expens"].ToString(); } else { lblFLTE.Visible = false; label76.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Intrest Subsidy kakinada"]) != 0) { lblINTSUB.Text = dsPayslip.Tables[0].Rows[0]["Intrest Subsidy kakinada"].ToString(); } else { lblINTSUB.Visible = false; label95.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["House Rent Allowance"]) != 0) { lblHRA.Text = dsPayslip.Tables[0].Rows[0]["House Rent Allowance"].ToString(); } else { lblHRA.Visible = false; label25.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Personal Allowance"]) != 0) { lblPersonalAllowance.Text = dsPayslip.Tables[0].Rows[0]["Personal Allowance"].ToString(); } else { lblPersonalAllowance.Visible = false; label70.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Washing Allowance"]) != 0) { lblwashAllow.Text = dsPayslip.Tables[0].Rows[0]["Washing Allowance"].ToString(); } else { lblwashAllow.Visible = false; label71.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Leave Encashment"]) != 0) { lblLeaveEncash.Text = dsPayslip.Tables[0].Rows[0]["Leave Encashment"].ToString(); } else { lblLeaveEncash.Visible = false; label72.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Medical Reimbursement"]) != 0) { lblMedRemb.Text = dsPayslip.Tables[0].Rows[0]["Medical Reimbursement"].ToString(); } else { lblMedRemb.Visible = false; label73.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Overtime Kakinada(NMS)"]) != 0) { lblOTHours.Text = dsPayslip.Tables[0].Rows[0]["Overtime Kakinada(NMS)"].ToString(); } else { lblOTHours.Visible = false; label74.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Production Incentive"]) != 0) { lblIncentive.Text = dsPayslip.Tables[0].Rows[0]["Production Incentive"].ToString(); } else { lblIncentive.Visible = false; label75.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Night Shift allowance"]) != 0) { lblSHFTAllow.Text = dsPayslip.Tables[0].Rows[0]["Night Shift allowance"].ToString(); } else { lblSHFTAllow.Visible = false; label27.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Round of Adjustments"]) != 0) { lblRoundAdj.Text = dsPayslip.Tables[0].Rows[0]["Round of Adjustments"].ToString(); } else { lblRoundAdj.Visible = false; label29.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Special Allowance"]) != 0) { lblsplAllow.Text = dsPayslip.Tables[0].Rows[0]["Special Allowance"].ToString(); } else { lblsplAllow.Visible = false; label96.Visible = false; } lblTotalEarnings.Text = dsPayslip.Tables[0].Rows[0]["Gross Salary"].ToString(); //Deductions if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["P Fund"]) != 0) { lblProvFund.Text = dsPayslip.Tables[0].Rows[0]["P Fund"].ToString(); } else { lblProvFund.Visible = false; label62.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["VPF"]) != 0) { lblVpf.Text = dsPayslip.Tables[0].Rows[0]["VPF"].ToString(); } else { lblVpf.Visible = false; label77.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["ProfTax"]) != 0) { lblProfTax.Text = dsPayslip.Tables[0].Rows[0]["ProfTax"].ToString(); } else { lblProfTax.Visible = false; label88.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["T D S"]) != 0) { lblIncomeTax.Text = dsPayslip.Tables[0].Rows[0]["T D S"].ToString(); } else { lblIncomeTax.Visible = false; label89.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Cooperative Society Rec"]) != 0) { lblCoopRec.Text = dsPayslip.Tables[0].Rows[0]["Cooperative Society Rec"].ToString(); } else { lblCoopRec.Visible = false; label90.Visible = false; } //if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Fest.Adv Recovery Repaynt"]) != 0) //{ // lblFesAdv.Text = dsPayslip.Tables[0].Rows[0]["Fest.Adv Recovery Repaynt"].ToString(); //} //else //{ lblFesAdv.Visible = false; label91.Visible = false; //} if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Benevolent Fund Deduction"]) != 0) { lblBenFund.Text = dsPayslip.Tables[0].Rows[0]["Benevolent Fund Deduction"].ToString(); } else { lblBenFund.Visible = false; label65.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Life Insurance Cor india"]) != 0) { lblLIC_SSE.Text = dsPayslip.Tables[0].Rows[0]["Life Insurance Cor india"].ToString(); } else { lblLIC_SSE.Visible = false; label68.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Union Fund Deductions"]) != 0) { lblUnionDed.Text = dsPayslip.Tables[0].Rows[0]["Union Fund Deductions"].ToString(); } else { lblUnionDed.Visible = false; label93.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Super Annuation"]) != 0) { lblSAF.Text = dsPayslip.Tables[0].Rows[0]["Super Annuation"].ToString(); } else { lblSAF.Visible = false; label97.Visible = false; } if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Round of Recovery"]) != 0) { lblRoundDed.Text = dsPayslip.Tables[0].Rows[0]["Round of Recovery"].ToString(); } else { lblRoundDed.Visible = false; label69.Visible = false; } lblTotalDeduction.Text = dsPayslip.Tables[0].Rows[0]["Deduction"].ToString(); //net salary lblNetPay.Text = dsPayslip.Tables[0].Rows[0]["Net Salary"].ToString(); //Estimated Tax // lblConvenyanceAllow.Text = dsPayslip.Tables[0].Rows[0]["Conveyance Allowance"].ToString(); // if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Conveyance Allowance(RP)"]) != 0) // { // lblConAllow.Text = dsPayslip.Tables[0].Rows[0]["Conveyance Allowance(RP)"].ToString(); // } // else // { // lblConAllow.Visible = false; // label26.Visible = false; // } // lblDeduction_SOc.Text = dsPayslip.Tables[0].Rows[0]["Deduction"].ToString(); // lblDeduction_SO.Text = dsPayslip.Tables[0].Rows[0]["Deduction"].ToString(); // if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Death Relief fund"]) != 0) //{ // lblDrf.Text = dsPayslip.Tables[0].Rows[0]["Death Relief fund"].ToString(); //} //else //{ // lblDrf.Visible = false; // label67.Visible = false; //} // if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["LicHflvsp"]) != 0) //{ // lblLIC_SSE.Text = dsPayslip.Tables[0].Rows[0]["LicHflvsp"].ToString(); //} //else //{ // lblLIC_SSE.Visible = false; // label68.Visible = false; //} // if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Round of Recovery"]) != 0) //{ // lblRoundDed.Text = dsPayslip.Tables[0].Rows[0]["Round of Recovery"].ToString(); //} //else //{ // lblRoundDed.Visible = false; // label69.Visible = false; //} //lblTaxScEc.Text=(Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Tax Payable"])) // + (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Surcharge"])) + // (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Education Cess"])).ToString(); // lblTaxPayable.Text = dsPayslip.Tables[0].Rows[0]["Tax Payable"].ToString(); //if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["SPS"]) != 0) //{ // lblSPS.Text = dsPayslip.Tables[0].Rows[0]["SPS"].ToString(); //} //else //{ // lblSPS.Visible = false; // label28.Visible = false; //} //lblProvFund.Text = dsPayslip.Tables[0].Rows[0]["P Fund"].ToString(); //if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["E S I"]) != 0) //{ // lblESI.Text = dsPayslip.Tables[0].Rows[0]["E S I"].ToString(); //} //else //{ // lblESI.Visible = false; // label63.Visible = false; //} //if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["Other Deductions"]) != 0) //{ // lblOtherDed.Text = dsPayslip.Tables[0].Rows[0]["Other Deductions"].ToString(); //} //else //{ // lblOtherDed.Visible = false; // label64.Visible = false; //} // lblPrvEmpOth.Text = dsPayslip.Tables[0].Rows[0]["Prev Employment/Other"].ToString(); //lblHouseRentAllow.Text = dsPayslip.Tables[0].Rows[0]["House Rent Allowance"].ToString(); //lblLeaveTravelAllow.Text = dsPayslip.Tables[0].Rows[0]["Leave Traval Allowance"].ToString(); // lblEmployementTax.Text = dsPayslip.Tables[0].Rows[0]["Employment Tax"].ToString(); // if (Convert.ToInt32(dsPayslip.Tables[0].Rows[0]["LOPDays"]) != 0) //{ // lblLOPDays.Text = dsPayslip.Tables[0].Rows[0]["LOPDays"].ToString(); //} //else //{ // lblLOPDays.Visible = false; // label36.Visible = false; //} // lblWasingAllow.Text = dsPayslip.Tables[0].Rows[0]["Washing Allowance"].ToString(); // lblHousePrprtyDet.Text = dsPayslip.Tables[0].Rows[0]["House Property Details"].ToString(); // lblTaxOnTaxableSalary.Text = dsPayslip.Tables[0].Rows[0]["Tax on Taxable Salary"].ToString(); // lblSurcharge.Text = dsPayslip.Tables[0].Rows[0]["Surcharge"].ToString(); // lblEducationCess.Text = dsPayslip.Tables[0].Rows[0]["Education Allowance"].ToString(); // lblTDSDedSoFar.Text = dsPayslip.Tables[0].Rows[0]["Income Tax Deduction"].ToString(); // lblTaxDedPerMonth.Text = dsPayslip.Tables[0].Rows[0]["T D S"].ToString(); // lblTaxableSalary.Text = dsPayslip.Tables[0].Rows[0]["Net Salary"].ToString(); //lblGrossannualSalary.Text = dsPayslip.Tables[0].Rows[0]["Gross Salary"].ToString(); } else { // MessageBox.Show("No Details Available"); panel1.Visible = false; lblerror.Text = "No Details Available"; } //gross salary // //total deduction } catch (Exception ex) { GC.ErrorLoging(ex.ToString()); panel1.Visible = false; lblerror.Text = "No Details Available"; } }