Esempio n. 1
0
        protected void BandedView_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e)
        {
            BandedGridView bandedView = (BandedGridView)MainView;

            if (!bandedView.IsValidRowHandle(e.RowHandle))
            {
                return;
            }
            int focusedRowHandle = e.RowHandle;

            if (focusedRowHandle >= 0)
            {
                HREmployeeTimeSheetsInfo objEmployeeTimeSheetsInfo = bandedView.GetRow(focusedRowHandle) as HREmployeeTimeSheetsInfo;
                if (objEmployeeTimeSheetsInfo != null)
                {
                    if (objEmployeeTimeSheetsInfo.HREmployeeTimeSheetOTDetailsList != null)
                    {
                        foreach (var item in objEmployeeTimeSheetsInfo.HREmployeeTimeSheetOTDetailsList)
                        {
                            if (e.Column.FieldName == item.HREmployeeTimeSheetOTDetailName)
                            {
                                e.DisplayText = item.HREmployeeTimeSheetOTDetailHours.ToString();
                                e.CellValue   = item.HREmployeeTimeSheetOTDetailHours;
                            }
                        }
                    }
                    if (objEmployeeTimeSheetsInfo.HRTimeSheetEntrysList != null)
                    {
                        objEmployeeTimeSheetsInfo.HRTimeSheetEntrysList.ForEach(o =>
                        {
                            if (e.Column.FieldName == "CONG" + o.FK_ADWorkingShiftID.ToString())
                            {
                                decimal total = (decimal)objEmployeeTimeSheetsInfo.HRTimeSheetEntrysList.
                                                Where(x => x.FK_ADWorkingShiftID == o.FK_ADWorkingShiftID &&
                                                      !x.IsCommonParam)
                                                .Sum(x => x.HRTimeSheetEntryWorkingQty);

                                e.DisplayText = total.ToString("n5");
                            }
                        });
                    }
                }
            }
        }
Esempio n. 2
0
        //private void rep_QueryPopUp(object sender, System.ComponentModel.CancelEventArgs e)
        //{
        //    GridView gridView = (GridView)MainView;
        //    if (gridView.FocusedRowHandle >= 0)
        //    {
        //        HREmployeeArrangementShiftsInfo objEmployeeArrangementShiftsInfo = (HREmployeeArrangementShiftsInfo)gridview.GetRow(gridview.FocusedRowHandle);
        //        HRWorkingShiftsController obj = new HRWorkingShiftsController();
        //        GridLookUpEdit lookUpEdit = (GridLookUpEdit)sender;
        //        ADWorkingShiftsController obj = new ADWorkingShiftsController();
        //        List<ADWorkingShiftsInfo> list = new List<ADWorkingShiftsInfo>();
        //        lookUpEdit.Properties.DataSource = ;
        //        lookUpEdit.Properties.DisplayMember = "ADWorkingShiftName";
        //        lookUpEdit.Properties.ValueMember = "ADWorkingShiftName";
        //        lookUpEdit.Properties.PopupFormSize = new System.Drawing.Size(50, 70);
        //    }
        //}

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

            if (!bandedView.IsValidRowHandle(e.RowHandle))
            {
                return;
            }
            // fill column if holiday
            List <string> columnFieldNameList = ((ArrangementShiftModule)Screen.Module).GetColumnFieldNameByTypeEndOfWeek();

            if (columnFieldNameList.Count > 0)
            {
                for (int i = 0; i < columnFieldNameList.Count; i++)
                {
                    if (e.Column.FieldName.Equals(columnFieldNameList[i]))
                    {
                        e.Appearance.BackColor = Color.Red;
                    }
                }
            }
        }
Esempio n. 3
0
        protected void BandedView_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e)
        {
            BandedGridView bandedView = (BandedGridView)MainView;

            if (!bandedView.IsValidRowHandle(e.RowHandle))
            {
                return;
            }
            int parent = bandedView.GetParentRowHandle(e.RowHandle);

            if (bandedView.IsGroupRow(parent))
            {
                for (int i = 0; i < bandedView.GetChildRowCount(parent); i++)
                {
                    if (bandedView.GetChildRowHandle(parent, i) == e.RowHandle)
                    {
                        e.Appearance.BackColor = i % 2 == 0 ? Color.White : Color.WhiteSmoke;
                    }
                }
            }
            else
            {
                e.Appearance.BackColor = e.RowHandle % 2 == 0 ? Color.White : Color.WhiteSmoke;
            }
            e.Appearance.ForeColor = Color.Black;

            // fill column if holiday
            //List<string> columnFieldNameList = ((LeaveDayModule)Screen.Module).GetColumnFieldNameByTypeEndOfWeek();
            //if (columnFieldNameList.Count > 0)
            //{
            //    for (int i = 0; i < columnFieldNameList.Count; i++)
            //    {
            //        if (e.Column.FieldName.Equals(columnFieldNameList[i]))
            //        {
            //            e.Appearance.BackColor = Color.Red;
            //        }
            //    }
            //}
        }