예제 #1
0
        public async Task <IActionResult> Details(string id)
        {
            var response = await _payrollService.GetPayrollDetails(id);

            return(View(response));
        }
예제 #2
0
        void GetEmpDetails(int employeeId)
        {
            if (employeeId > 0)
            {
                emp = empSvc.Employee_SelectById(employeeId);

                if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + "\\EmpPics\\ProfilePic\\" + employeeId + "\\" + emp.EmployeeBasicInfo.PicName) == true)
                {
                    picEmployee.Image = Image.FromFile(AppDomain.CurrentDomain.BaseDirectory + "\\EmpPics\\ProfilePic\\" + employeeId + "\\" + emp.EmployeeBasicInfo.PicName, true);
                }

                try
                {
                    lblDesignation.Text = emp.EmployeeEmpInfo.Designation;
                    lblDepartment.Text  = emp.EmployeeEmpInfo.DepartmentName;
                    lblRate.Text        = emp.EmployeeEmpInfo.BasicPay.ToString("#,####.00");
                    lblPayOption.Text   = emp.EmployeeEmpInfo.BasicRateOption;

                    var dtr = dsvc.DTR_GetDetailsForPayroll(emp.EmployeeId, (int)cmbPayrollPeriod.SelectedValue);
                    if (dtr != null)
                    {
                        lblTotalLate.Text      = dtr.TotalLate.ToString(".00");
                        lblTotalUndertime.Text = dtr.TotalUndertime.ToString(".00");
                        lblTotDaysWork.Text    = dtr.TotalDaysWork.ToString(".00");
                        label2.Visible         = false;
                        HAS_DTR = true;

                        if (employeeId > 0 && (int)cmbPayrollPeriod.SelectedValue > 0)
                        {
                            var model = _payrollService.GetPayrollDetails(employeeId, (int)cmbPayrollPeriod.SelectedValue);
                            if (model != null)
                            {
                                //lblTotDaysWork.Text = model.TotalDaysWork.ToString("0.00");
                                //lblTotalLate.Text = model.MinsLate.ToString("0.00");
                                //lblTotalUndertime.Text = model.UnderTime.ToString("0.00");
                                txtCottageRental.Text = model.Cottage_Rental.ToString("#,####.00");
                                lblGrossEarning.Text  = model.GrossAmount.ToString("#,####.00");
                                //HDMF_Tax.Text = model.Tax.ToString("#,####.00");
                                txtHDMF.Text          = model.HDMF_Premiums.ToString("#,####.00");
                                txtHDMF_Calamity.Text = model.HDMF_Calamity.ToString("#,####.00");
                                lblNetAmount.Text     = model.NetAmount.ToString("#,####.00");
                                lblLateAmount.Text    = model.LateAmtDeduction.ToString("#,####.00");
                                lblUnderTime.Text     = model.UnderTimeAmtDeduction.ToString("#,####.00");
                            }
                        }
                    }
                    else
                    {
                        label2.Visible         = true;
                        lblTotalLate.Text      = "";
                        lblTotalUndertime.Text = "";
                        lblTotDaysWork.Text    = "";
                        HAS_DTR = false;
                    }
                }
                catch (Exception ex)
                {
                    lblTotalLate.Text      = "";
                    lblTotalUndertime.Text = "";
                    lblTotDaysWork.Text    = "";
                    HAS_DTR = false;
                }
            }
            else
            {
                ClearAll();
            }
        }