Exemple #1
0
        protected void BandedView_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e)
        {
            BandedGridView bandedView = (BandedGridView)MainView;

            //Hiển thị lương theo nhóm ca
            int focusedRowHandle = e.RowHandle;

            if (focusedRowHandle >= 0)
            {
                HREmployeePayRollsInfo objEmployeePayRollsInfo = bandedView.GetRow(focusedRowHandle) as HREmployeePayRollsInfo;
                if (objEmployeePayRollsInfo != null)
                {
                    foreach (var item in WorkingShiftGroupsList)
                    {
                        if (item.ADWorkingShiftGroupID > 0)
                        {
                            if (e.Column.FieldName == item.ADWorkingShiftGroupID.ToString())
                            {
                                decimal total = (decimal)objEmployeePayRollsInfo.HREmployeePayrollDetailsList.
                                                Where(o => o.HREmployeeTimeSheetOTDetailName == item.ADWorkingShiftGroupID.ToString() &&
                                                      !o.IsOT).
                                                Sum(o => o.HREmployeePayrollHours);

                                e.DisplayText = total.ToString("n4");
                            }
                            else if (e.Column.FieldName == "L" + item.ADWorkingShiftGroupID.ToString())
                            {
                                decimal total = (decimal)objEmployeePayRollsInfo.HREmployeePayrollDetailsList.
                                                Where(o => o.HREmployeeTimeSheetOTDetailName == item.ADWorkingShiftGroupID.ToString() &&
                                                      !o.IsOT).
                                                Sum(o => o.HREmployeePayrollSalaryFactor);

                                e.DisplayText = total.ToString("n0");
                            }
                        }
                    }

                    foreach (var item in OTFactorlist)
                    {
                        if (e.Column.FieldName == string.Format("TC{0}", item.ADOTFactorID.ToString()))
                        {
                            decimal total = (decimal)objEmployeePayRollsInfo.HREmployeePayrollDetailsList.
                                            Where(o => o.HREmployeeTimeSheetOTDetailName == item.ADOTFactorID.ToString() &&
                                                  o.IsOT).
                                            Sum(o => o.HREmployeePayrollHourFactor);
                            e.DisplayText = total.ToString("n5");
                        }
                        else if (e.Column.FieldName == string.Format("LTC{0}", item.ADOTFactorID.ToString()))
                        {
                            decimal total = (decimal)objEmployeePayRollsInfo.HREmployeePayrollDetailsList.
                                            Where(o => o.HREmployeeTimeSheetOTDetailName == item.ADOTFactorID.ToString() &&
                                                  o.IsOT).
                                            Sum(o => o.HREmployeePayrollSalaryFactor);

                            e.DisplayText = total.ToString("n0");
                        }
                    }
                }
            }
        }
Exemple #2
0
        protected void BandedView_CellValueChanged(object sender, CellValueChangedEventArgs e)
        {
            PayRollEntities entity     = (PayRollEntities)((BaseModuleERP)Screen.Module).CurrentModuleEntity;
            BandedGridView  bandedView = (BandedGridView)MainView;

            if (bandedView.FocusedRowHandle >= 0)
            {
                HREmployeePayRollsInfo objEmployeePayRollsInfo = (HREmployeePayRollsInfo)bandedView.GetRow(bandedView.FocusedRowHandle);
                ((PayRollModule)Screen.Module).CalculatePayRollTotalAmounts(objEmployeePayRollsInfo);
            }
        }
Exemple #3
0
        public override IList GetListFromDataSet(DataSet ds)
        {
            List <HREmployeePayRollsInfo> list = new List <HREmployeePayRollsInfo>();

            if (ds.Tables.Count > 0)
            {
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    HREmployeePayRollsInfo obj = (HREmployeePayRollsInfo)GetObjectFromDataRow(row);
                    list.Add(obj);
                }
            }
            return(list);
        }
Exemple #4
0
 public void SetDefaultValuesFromEmployee(HREmployeePayRollsInfo objEmployeePayRollsInfo, HREmployeesInfo objEmployeesInfo)
 {
 }