/// <summary>
 /// On 'Print' button click to take print
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvEmployeeAddressBook.Rows.Count > 0)
         {
             DataSet ds = new DataSet();
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
             List <DataTable>   listObjCompany     = bllCompanyCreation.CompanyViewDataTable(1);
             ds.Tables.Add(listObjCompany[0]);
             EmployeeCreationBll BllEmployeeCreation = new EmployeeCreationBll();
             List <DataTable>    listEmployee        = BllEmployeeCreation.EmployeeViewAllForEmployeeAddressBook(cmbEmployeeCode.Text, txtMobile.Text, txtPhone.Text, txtEmail.Text);
             ds.Tables.Add(listEmployee[0]);
             frmReport frmReportObj = new frmReport();
             frmReportObj.MdiParent = formMDI.MDIObj;
             frmReportObj.EmployeeAddressBookPrinting(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("EMP8 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
예제 #2
0
 /// <summary>
 /// On 'Print' button click to print
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvDailySalary.RowCount > 0)
         {
             DataSet ds = new DataSet();
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll  bllCompanyCreation  = new CompanyCreationBll();
             EmployeeCreationBll BllEmployeeCreation = new EmployeeCreationBll();
             List <DataTable>    listEmployee        = BllEmployeeCreation.EmployeeViewAllForDailySalaryReport(cmbEmployeeCode.Text, cmbDesignation.Text, Convert.ToDateTime(dtpFromDate.Text.ToString()), Convert.ToDateTime(dtpToDate.Text.ToString()), cmbStatus.Text);
             List <DataTable>    listObjCompany      = bllCompanyCreation.CompanyViewDataTable(1);
             ds.Tables.Add(listObjCompany[0]);
             ds.Tables.Add(listEmployee[0]);
             frmReport frmReportObj = new frmReport();
             frmReportObj.MdiParent = formMDI.MDIObj;
             frmReportObj.DailySalaryReport(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("DSR9 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
예제 #3
0
 /// <summary>
 /// Function to fill Datagridview
 /// </summary>
 public void GridFill()
 {
     try
     {
         string strEmployeeStatus = string.Empty;
         if (rbtnAll.Checked)
         {
             strEmployeeStatus = "All";
         }
         else if (rbtnActive.Checked)
         {
             strEmployeeStatus = "Active";
         }
         else if (rbtnInActive.Checked)
         {
             strEmployeeStatus = "InActive";
         }
         if (strEmployeeStatus != string.Empty && cmbDesigantion.SelectedIndex > -1)
         {
             CreateGrid();
             AttendanceBll       BllAttendanceMaster = new AttendanceBll();
             EmployeeCreationBll BllEmployeeCreation = new EmployeeCreationBll();
             List <DataTable>    listEmployee        = new List <DataTable>();
             listEmployee = BllEmployeeCreation.EmployeeViewByDesignationAndStatus(cmbDesigantion.Text, strEmployeeStatus);
             if (listEmployee[0].Rows.Count > 0)
             {
                 for (int i = 0; i < listEmployee[0].Rows.Count; i++)
                 {
                     dgvMonthlyAttendance.Rows.Add();
                     dgvMonthlyAttendance.Rows[i].Cells["employeeId"].Value   = listEmployee[0].Rows[i]["employeeId"].ToString();
                     dgvMonthlyAttendance.Rows[i].Cells["SlNo"].Value         = i + 1;
                     dgvMonthlyAttendance.Rows[i].Cells["employeeName"].Value = listEmployee[0].Rows[i]["employeeName"].ToString();
                     dgvMonthlyAttendance.Rows[i].Cells["employeeCode"].Value = listEmployee[0].Rows[i]["employeeCode"].ToString();
                     List <DataTable> listStatus = BllAttendanceMaster.MonthlyAttendanceReportFill(dtpMonth.Value, Convert.ToDecimal(listEmployee[0].Rows[i]["employeeId"].ToString()));
                     if (listStatus[0].Rows.Count > 0)
                     {
                         for (int j = 0; j < listStatus[0].Rows.Count; j++)
                         {
                             dgvMonthlyAttendance.Rows[i].Cells[DateTime.Parse(listStatus[0].Rows[j]["date"].ToString()).Day.ToString()].Value = listStatus[0].Rows[j]["status"].ToString();
                         }
                     }
                     FindTotal(i);
                 }
             }
             CheckedChange();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("MAR2 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Function to fill Datagridview
 /// </summary>
 public void GridFill()
 {
     try
     {
         EmployeeCreationBll BllEmployeeCreation = new EmployeeCreationBll();
         List <DataTable>    listObj             = BllEmployeeCreation.EmployeeViewAllEmployeeReport(cmbDesigantion.Text, cmbEmployee.Text, cmbStatus.Text);
         dgvEmployee.DataSource = listObj[0];
     }
     catch (Exception ex)
     {
         MessageBox.Show("ER3 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
예제 #5
0
 /// <summary>
 /// Function to fill EmployeeCode Combobox
 /// </summary>
 public void EmployeeCodeComboFill()
 {
     try
     {
         EmployeeCreationBll BllEmployeeCreation = new EmployeeCreationBll();
         List <DataTable>    listEmployeeCode    = new List <DataTable>();
         listEmployeeCode              = BllEmployeeCreation.EmployeeViewAll();
         cmbEmployeeCode.DataSource    = listEmployeeCode[0];
         cmbEmployeeCode.ValueMember   = "employeeId";
         cmbEmployeeCode.DisplayMember = "employeeCode";
     }
     catch (Exception ex)
     {
         MessageBox.Show("BD1:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
예제 #6
0
 /// <summary>
 /// Function to fill EmployeeCode combobox
 /// </summary>
 public void EmployeeCodeComboFill()
 {
     try
     {
         EmployeeCreationBll BllEmployeeCreation = new EmployeeCreationBll();
         List <DataTable>    listEmployee        = BllEmployeeCreation.EmployeeViewAll();
         DataRow             dr = listEmployee[0].NewRow();
         dr[3] = "All";
         listEmployee[0].Rows.InsertAt(dr, 0);
         cmbEmployeeCode.DataSource    = listEmployee[0];
         cmbEmployeeCode.ValueMember   = "employeeId";
         cmbEmployeeCode.DisplayMember = "employeeCode";
     }
     catch (Exception ex)
     {
         MessageBox.Show("MSR:2" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Function to fill Employee combobox
 /// </summary>
 public void FillEmployee()
 {
     try
     {
         List <DataTable>    listObj             = new List <DataTable>();
         EmployeeCreationBll BllEmployeeCreation = new EmployeeCreationBll();
         listObj = BllEmployeeCreation.EmployeeViewForPaySlip();
         DataRow dr = listObj[0].NewRow();
         dr[1] = "--Select--";
         listObj[0].Rows.InsertAt(dr, 0);
         cmbEmployee.DataSource    = listObj[0];
         cmbEmployee.ValueMember   = "employeeId";
         cmbEmployee.DisplayMember = "employeeName";
     }
     catch (Exception ex)
     {
         MessageBox.Show("PS 1: " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Function to fill Salesman combobox
 /// </summary>
 public void SalesmanComboFill()
 {
     try
     {
         List <DataTable>    listSalesmen        = new List <DataTable>();
         EmployeeCreationBll BllEmployeeCreation = new EmployeeCreationBll();
         listSalesmen = BllEmployeeCreation.EmployeeViewSalesman();
         DataRow dr = listSalesmen[0].NewRow();
         dr["employeeId"]   = 0;
         dr["employeeName"] = "All";
         listSalesmen[0].Rows.InsertAt(dr, 0);
         cmbSalesman.DataSource    = listSalesmen[0];
         cmbSalesman.DisplayMember = "employeeName";
         cmbSalesman.ValueMember   = "employeeId";
         cmbSalesman.SelectedValue = 0;
     }
     catch (Exception ex)
     {
         MessageBox.Show("SVRT 8 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Function to fill Datagridview
 /// </summary>
 public void Gridfill()
 {
     try
     {
         List <DataTable>    listObj             = new List <DataTable>();
         EmployeeInfo        infoEmployee        = new EmployeeInfo();
         EmployeeCreationBll BllEmployeeCreation = new EmployeeCreationBll();
         infoEmployee.EmployeeCode      = txtEmployeeCode.Text.Trim();
         infoEmployee.EmployeeName      = txtEmployeeName.Text.Trim();
         infoEmployee.DesignationId     = decimal.Parse(cmbDesignation.SelectedValue.ToString());
         infoEmployee.SalaryType        = cmbsalaryType.SelectedItem.ToString();
         infoEmployee.BankAccountNumber = txtBankAccountNumber.Text.Trim();
         infoEmployee.PassportNo        = txtPassportNumber.Text.Trim();
         infoEmployee.LabourCardNumber  = txtLabourCardNumber.Text.Trim();
         infoEmployee.VisaNumber        = txtVisaNumber.Text.Trim();
         listObj = BllEmployeeCreation.EmployeeSearch(infoEmployee);
         dgvEmployee.DataSource = listObj[0];
     }
     catch (Exception ex)
     {
         MessageBox.Show("ER1:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        /// <summary>
        /// Function for Edit
        /// </summary>
        public void EditFunction()
        {
            try
            {
                MonthlySalaryVoucherBll  BllMonthlySalary         = new MonthlySalaryVoucherBll();
                MonthlySalaryInfo        infoMonthlySalary        = new MonthlySalaryInfo();
                MonthlySalaryVoucherBll  BllMonthlySalaryDetails  = new MonthlySalaryVoucherBll();
                MonthlySalaryDetailsInfo infoMonthlySalaryDetails = new MonthlySalaryDetailsInfo();
                EmployeeCreationBll      BllEmployeeCreation      = new EmployeeCreationBll();
                infoMonthlySalary.SalaryMonth = Convert.ToDateTime(dtpSalaryMonth.Text);
                infoMonthlySalary.Narration   = txtNarration.Text.Trim();
                infoMonthlySalary.Extra1      = string.Empty;
                infoMonthlySalary.Extra2      = string.Empty;
                int RowCount = dgvMonthySalarySettings.RowCount;
                for (int i = 0; i <= RowCount - 1; i++)
                {
                    if (dgvMonthySalarySettings.Rows[i].Cells["dgvtxtMonthlySalaryId"].Value.ToString() != string.Empty)
                    {
                        decMasterIdForEdit = Convert.ToDecimal(dgvMonthySalarySettings.Rows[i].Cells["dgvtxtMonthlySalaryId"].Value.ToString());
                    }
                }
                infoMonthlySalary.MonthlySalaryId = decMasterIdForEdit;
                BllMonthlySalary.MonthlySalarySettingsEdit(infoMonthlySalary);
                infoMonthlySalaryDetails.MonthlySalaryId = decMasterIdForEdit;
                for (int i = 0; i <= RowCount - 1; i++)
                {
                    if (dgvMonthySalarySettings.Rows[i].Cells["dgvtxtMonthlySalaryDetailsId"].Value.ToString() != string.Empty)
                    {
                        string st = dgvMonthySalarySettings.Rows[i].Cells["dgvcmbPackage"].FormattedValue.ToString();
                        if (dgvMonthySalarySettings.Rows[i].Cells["dgvcmbPackage"].FormattedValue.ToString() != "--Select--")
                        {
                            if (dgvMonthySalarySettings.Rows[i].Cells["dgvtxtEmployeeId"].Value != null && dgvMonthySalarySettings.Rows[i].Cells["dgvtxtEmployeeId"].Value.ToString() != string.Empty)
                            {
                                infoMonthlySalaryDetails.EmployeeId = Convert.ToDecimal(dgvMonthySalarySettings.Rows[i].Cells["dgvtxtEmployeeId"].Value.ToString());
                            }
                            if (dgvMonthySalarySettings.Rows[i].Cells["dgvtxtMonthlySalaryDetailsId"].Value != null && dgvMonthySalarySettings.Rows[i].Cells["dgvtxtMonthlySalaryDetailsId"].Value.ToString() != string.Empty)
                            {
                                infoMonthlySalaryDetails.MonthlySalaryDetailsId = Convert.ToDecimal(dgvMonthySalarySettings.Rows[i].Cells["dgvtxtMonthlySalaryDetailsId"].Value.ToString());
                            }
                            if (dgvMonthySalarySettings.Rows[i].Cells["dgvtxtMonthlySalaryId"].Value != null && dgvMonthySalarySettings.Rows[i].Cells["dgvtxtMonthlySalaryId"].Value.ToString() != "0")
                            {
                                infoMonthlySalaryDetails.MonthlySalaryId = Convert.ToDecimal(dgvMonthySalarySettings.Rows[i].Cells["dgvtxtMonthlySalaryId"].Value.ToString());
                            }
                            if (dgvMonthySalarySettings.Rows[i].Cells["dgvcmbPackage"].Value != null && dgvMonthySalarySettings.Rows[i].Cells["dgvcmbPackage"].Value.ToString() != "0")
                            {
                                infoMonthlySalaryDetails.SalaryPackageId = Convert.ToDecimal(dgvMonthySalarySettings.Rows[i].Cells["dgvcmbPackage"].Value.ToString());
                                infoMonthlySalaryDetails.Extra1          = string.Empty;
                                infoMonthlySalaryDetails.Extra2          = string.Empty;
                                BllEmployeeCreation.EmployeePackageEdit(infoMonthlySalaryDetails.EmployeeId, infoMonthlySalaryDetails.SalaryPackageId);
                                BllMonthlySalaryDetails.MonthlySalaryDetailsEditUsingMasterIdAndDetailsId(infoMonthlySalaryDetails);
                            }
                        }
                        else
                        {
                            decimal decMonthlySalaryDetailsId = 0;
                            for (int j = 0; j < RowCount; j++)
                            {
                                if (dgvMonthySalarySettings.Rows[j].Cells["dgvtxtMonthlySalaryDetailsId"].Value != null && dgvMonthySalarySettings.Rows[j].Cells["dgvtxtMonthlySalaryDetailsId"].Value.ToString() != string.Empty)
                                {
                                    if (dgvMonthySalarySettings.Rows[j].Cells["dgvcmbPackage"].FormattedValue.ToString() == "--Select--")
                                    {
                                        decMonthlySalaryDetailsId = Convert.ToDecimal(dgvMonthySalarySettings.Rows[j].Cells["dgvtxtMonthlySalaryDetailsId"].Value.ToString());
                                        BllMonthlySalaryDetails.MonthlySalarySettingsDetailsIdDelete(decMonthlySalaryDetailsId);
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        if (dgvMonthySalarySettings.Rows[i].Cells["dgvtxtEmployeeId"].Value != null && dgvMonthySalarySettings.Rows[i].Cells["dgvtxtEmployeeId"].Value.ToString() != string.Empty)
                        {
                            infoMonthlySalaryDetails.EmployeeId = Convert.ToDecimal(dgvMonthySalarySettings.Rows[i].Cells["dgvtxtEmployeeId"].Value.ToString());

                            if (dgvMonthySalarySettings.Rows[i].Cells["dgvcmbPackage"].Value != null && dgvMonthySalarySettings.Rows[i].Cells["dgvcmbPackage"].Value.ToString() != "0")
                            {
                                infoMonthlySalaryDetails.SalaryPackageId = Convert.ToDecimal(dgvMonthySalarySettings.Rows[i].Cells["dgvcmbPackage"].Value.ToString());
                                infoMonthlySalaryDetails.Extra1          = string.Empty;
                                infoMonthlySalaryDetails.Extra2          = string.Empty;
                                infoMonthlySalaryDetails.MonthlySalaryId = decMasterIdForEdit;
                                BllMonthlySalaryDetails.MonthlySalaryDetailsAddWithMonthlySalaryId(infoMonthlySalaryDetails);
                            }
                        }
                    }
                }
                Messages.UpdatedMessage();
                GridFill();
                dtpSalaryMonth.Focus();
                btnDelete.Enabled = true;
                DeleteButtonEnableDisableChoose();
            }
            catch (Exception ex)
            {
                MessageBox.Show("MSS8" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }