Exemple #1
0
        public List <string> GetColumnFieldNameByTypeEndOfWeek()
        {
            ArrangementShiftEntities entity = (ArrangementShiftEntities)CurrentModuleEntity;
            HRArrangementShiftsInfo  objArrangementShiftsInfo = (HRArrangementShiftsInfo)entity.MainObject;
            List <string>            list = new List <string>();
            int numDays = NumOfDayInMonth();

            for (int i = 1; i <= numDays; i++)
            {
                DateTime dt          = objArrangementShiftsInfo.HRArrangementShiftFromDate.Date.AddDays(i - 1);
                bool     isDayOfWeek = (VinaApp.IsEndOfWeek(objArrangementShiftsInfo.HRArrangementShiftFromDate.Date.AddDays(i - 1).DayOfWeek));
                if (isDayOfWeek)
                {
                    string columnName = String.Format("{0}{1}", "HREmployeeArrangementShiftDate", i.ToString());
                    list.Add(columnName);
                }
            }
            return(list);
        }
Exemple #2
0
        protected override void AddColumnsToGridView(string strTableName, DevExpress.XtraGrid.Views.Grid.GridView gridView)
        {
            base.AddColumnsToGridView(strTableName, gridView);
            GridColumn column = new GridColumn();

            column.Caption   = "Mã nhân viên";
            column.FieldName = "HREmployeeNo";
            gridView.Columns.Add(column);

            column           = new GridColumn();
            column.Caption   = "Mã ID";
            column.FieldName = "HREmployeeCardNumber";
            gridView.Columns.Add(column);

            column           = new GridColumn();
            column.Caption   = "Chi nhánh";
            column.FieldName = "BRBranchName";
            gridView.Columns.Add(column);

            column           = new GridColumn();
            column.Caption   = "Bộ phận";
            column.FieldName = "HRDepartmentRoomName";
            gridView.Columns.Add(column);

            column           = new GridColumn();
            column.Caption   = "Phòng ban";
            column.FieldName = "HRDepartmentName";
            gridView.Columns.Add(column);

            column           = new GridColumn();
            column.Caption   = "Tên nhân viên";
            column.FieldName = "HREmployeeName";
            gridView.Columns.Add(column);

            column           = new GridColumn();
            column.Caption   = "Tổ";
            column.FieldName = "HRDepartmentRoomGroupItemName";
            gridView.Columns.Add(column);

            int numDays = ((TimeSheetModule)Screen.Module).NumOfDayInMonth();
            TimeSheetEntities entity            = (TimeSheetEntities)((BaseModuleERP)Screen.Module).CurrentModuleEntity;
            HRTimeSheetsInfo  objTimeSheetsInfo = (HRTimeSheetsInfo)entity.MainObject;

            for (int i = 1; i <= numDays; i++)
            {
                GridColumn columnDays = new GridColumn();
                DateTime   dt         = objTimeSheetsInfo.HRTimeSheetFromDate.Date.AddDays(i - 1);
                columnDays.Caption = dt.ToString("dd/MM");
                bool isDayOfWeek = (VinaApp.IsEndOfWeek(dt.DayOfWeek));
                if (isDayOfWeek)
                {
                    columnDays.Caption = "CN (" + dt.ToString("dd/MM") + ")";
                }
                columnDays.FieldName = String.Format("{0}{1}", "HREmployeeTimeSheetDate", i.ToString());
                gridView.Columns.Add(columnDays);
            }
            HRTimeSheetParamsController  objTimeSheetParamsController = new HRTimeSheetParamsController();
            List <HRTimeSheetParamsInfo> OTFactorlist = objTimeSheetParamsController.GetDistinctOTTimeSheetParamsList();

            foreach (var item in OTFactorlist)
            {
                column           = new GridColumn();
                column.Caption   = "TC HS " + item.HRTimeSheetParamValue2.ToString();
                column.FieldName = item.HRTimeSheetParamValue2.ToString();
                column.Tag       = item.HRTimeSheetParamValue2;
                gridView.Columns.Add(column);
            }

            if (WorkingShiftList != null)
            {
                WorkingShiftList.ForEach(o =>
                {
                    column           = new GridColumn();
                    column.Caption   = "Công " + o.ADWorkingShiftName;
                    column.FieldName = "CONG" + o.ADWorkingShiftID.ToString();
                    column.Tag       = "CONG" + o.ADWorkingShiftID.ToString();
                    gridView.Columns.Add(column);
                });
            }
        }