/// <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();
            }
        }
        /// <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";
            }
        }
Esempio n. 3
0
        /// <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";
            }
        }
Esempio n. 4
0
        /// <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";
            }
        }
Esempio n. 5
0
        /// <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";
            }
        }
Esempio n. 6
0
        /// <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";
            }
        }
Esempio n. 7
0
        /// <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";
            }
        }
Esempio n. 9
0
        /// <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;
            }
        }