示例#1
0
        void gridView_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            GridView view     = sender as GridView;
            GridView gridView = (GridView)MainView;
            ManagerTimeKeeperEntities entity = (ManagerTimeKeeperEntities)((BaseModuleERP)Screen.Module).CurrentModuleEntity;

            if (e.RowHandle >= 0)
            {
                HRTimeKeeperCompletesInfo objTimeKeeperCompletesInfo = (HRTimeKeeperCompletesInfo)gridView.GetRow(e.RowHandle);
                ((ManagerTimeKeeperModule)Screen.Module).AddBackupList(objTimeKeeperCompletesInfo);

                if (e.Column.FieldName == "HRTimeKeeperCompleteTimeCheck")
                {
                    //1.CheckSameTime
                    ((ManagerTimeKeeperModule)Screen.Module).CheckSameTime(objTimeKeeperCompletesInfo, entity.TimeKeeperCompletesList.ToList());
                    //2.CheckNotInOverTime
                    ((ManagerTimeKeeperModule)Screen.Module).CheckNotInOverTime(objTimeKeeperCompletesInfo, 60, true);
                    //2.CheckNotInOverTime
                    ((ManagerTimeKeeperModule)Screen.Module).CheckOverTimeAbsence(objTimeKeeperCompletesInfo, 60, true);
                }
                if (e.Column.FieldName == "HRTimeKeeperCompleteDate")
                {
                    ((ManagerTimeKeeperModule)Screen.Module).ChangeCompleteDate(objTimeKeeperCompletesInfo);
                }
            }
        }
示例#2
0
        void gridView_RowStyle(object sender, RowStyleEventArgs e)
        {
            GridView view = sender as GridView;
            ManagerTimeKeeperEntities entity = (ManagerTimeKeeperEntities)((BaseModuleERP)Screen.Module).CurrentModuleEntity;
            GridView gridView = (GridView)MainView;

            if (e.RowHandle >= 0)
            {
                if (e.RowHandle == gridView.FocusedRowHandle)
                {
                    e.Appearance.ForeColor = Color.Black;
                    e.Appearance.Font      = new Font(e.Appearance.Font, FontStyle.Bold);
                }


                HRTimeKeeperCompletesInfo objTimeKeeperCompletesInfo = (HRTimeKeeperCompletesInfo)gridView.GetRow(e.RowHandle);
                if (objTimeKeeperCompletesInfo != null)
                {
                    bool isSameTime = ((ManagerTimeKeeperModule)Screen.Module).CheckSameTime(objTimeKeeperCompletesInfo, entity.TimeKeeperCompletesList.ToList());
                    if (isSameTime)
                    {
                        e.Appearance.BackColor2             = Color.Pink;
                        e.Appearance.BackColor              = Color.Pink;
                        objTimeKeeperCompletesInfo.RowColor = Color.Pink.ToArgb();
                    }

                    if (objTimeKeeperCompletesInfo.NotInOverTime == "False")
                    {
                        e.Appearance.BackColor2             = Color.Orange;
                        e.Appearance.BackColor              = Color.Orange;
                        objTimeKeeperCompletesInfo.RowColor = Color.Orange.ToArgb();
                    }
                    if (objTimeKeeperCompletesInfo.OverTimeAbsence == "False")
                    {
                        e.Appearance.BackColor2             = Color.Green;
                        e.Appearance.BackColor              = Color.Green;
                        objTimeKeeperCompletesInfo.RowColor = Color.Green.ToArgb();
                    }
                    if (objTimeKeeperCompletesInfo.NotInWorkingShift == "False")
                    {
                        e.Appearance.BackColor2             = Color.Blue;
                        e.Appearance.BackColor              = Color.Blue;
                        objTimeKeeperCompletesInfo.RowColor = Color.Blue.ToArgb();
                    }
                    if (objTimeKeeperCompletesInfo.LateForWork == "False")
                    {
                        e.Appearance.BackColor2             = Color.Orange;
                        e.Appearance.BackColor              = Color.Orange;
                        objTimeKeeperCompletesInfo.RowColor = Color.Orange.ToArgb();
                    }
                    if (objTimeKeeperCompletesInfo.GoEarly == "False")
                    {
                        e.Appearance.BackColor2             = Color.Yellow;
                        e.Appearance.BackColor              = Color.Yellow;
                        objTimeKeeperCompletesInfo.RowColor = Color.Yellow.ToArgb();
                    }
                }
            }
        }
示例#3
0
        public override void InitGridControlDataSource()
        {
            ManagerTimeKeeperEntities entity = (ManagerTimeKeeperEntities)((BaseModuleERP)Screen.Module).CurrentModuleEntity;
            BindingSource             bds    = new BindingSource();

            bds.DataSource  = entity.TimeKeepersList;
            this.DataSource = bds;
        }
示例#4
0
        void rep_Click(object sender, EventArgs e)
        {
            GridView gridView = (GridView)MainView;
            HRTimeKeepersController   objTimeKeepersController = new HRTimeKeepersController();
            ManagerTimeKeeperEntities entity = (ManagerTimeKeeperEntities)((BaseModuleERP)Screen.Module).CurrentModuleEntity;

            if (gridView.FocusedRowHandle >= 0)
            {
                HRTimeKeeperCompletesInfo item = (HRTimeKeeperCompletesInfo)gridView.GetRow(gridView.FocusedRowHandle);
                entity.SaveHistory("HRTimeKeeperCompletes", item, item, "Cancel");
                gridView.DeleteRow(gridView.FocusedRowHandle);
            }
        }
示例#5
0
        void gridView_RowStyle(object sender, RowStyleEventArgs e)
        {
            ManagerTimeKeeperEntities entity = (ManagerTimeKeeperEntities)((BaseModuleERP)Screen.Module).CurrentModuleEntity;
            GridView view     = sender as GridView;
            GridView gridView = (GridView)MainView;

            if (e.RowHandle >= 0)
            {
                if (e.RowHandle == gridView.FocusedRowHandle)
                {
                    e.Appearance.ForeColor = Color.Black;
                    e.Appearance.Font      = new Font(e.Appearance.Font, FontStyle.Bold);
                }
            }
        }
示例#6
0
        void gridView_RowStyle(object sender, RowStyleEventArgs e)
        {
            ManagerTimeKeeperEntities entity = (ManagerTimeKeeperEntities)((BaseModuleERP)Screen.Module).CurrentModuleEntity;
            GridView view     = sender as GridView;
            GridView gridView = (GridView)MainView;

            if (e.RowHandle >= 0)
            {
                if (e.RowHandle == gridView.FocusedRowHandle)
                {
                    e.Appearance.ForeColor = Color.Black;
                    e.Appearance.Font      = new Font(e.Appearance.Font, FontStyle.Bold);
                }


                HRTimeKeeperCompletesInfo objTimeKeeperCompletesInfo = (HRTimeKeeperCompletesInfo)gridView.GetRow(e.RowHandle);
                if (objTimeKeeperCompletesInfo != null)
                {
                    bool isSameTime = ((ManagerTimeKeeperModule)Screen.Module).CheckSameTime(objTimeKeeperCompletesInfo, entity.TimeKeeperCompleteListView);
                }
            }
        }