Beispiel #1
0
        private void btn保存_Click(object sender, EventArgs e)
        {
            ColumnView colView = (ColumnView)gridControl1.MainView;

            if (colView != null)
            {
                QueryLevelInput currentItem = (QueryLevelInput)colView.GetFocusedRow();
                if (currentItem != null)
                {
                    currentItem.Save();
                }
                //遍历
                foreach (QueryLevelInput row in currInputRows)
                {
                    if (string.IsNullOrEmpty(row.职务等级))
                    {
                        continue;
                    }

                    row.UpdateCompareResult();
                    //如果完全相同,转为正式
                    if (row.内容不同的字段.Count == 0 && row.另一人已录入)
                    {
                        BecomeEffective(row);
                    }
                }
                MessageBox.Show("保存成功!");
                LoadData();
            }
            MyHelper.WriteLog(LogType.信息, "修改查询权限记录", null);
        }
Beispiel #2
0
        private void gridView1_CellValueChanging(object sender, CellValueChangedEventArgs e)
        {
            QueryLevelInput row = gridView1.GetRow(e.RowHandle) as QueryLevelInput;

            if (row != null)
            {
            }
        }
Beispiel #3
0
        protected void LoadData()
        {
            //清除原来的数据
            currInputRows = QueryLevelInput.GetEditingRows(this.是验证录入);
            currInputRows = currInputRows.OrderBy(a => a.录入时间).ToList();

            gridControl1.DataSource = currInputRows;
            gridControl1.RefreshDataSource();
        }
Beispiel #4
0
        private void gridView1_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e)
        {
            QueryLevelInput row = gridView1.GetRow(e.PrevFocusedRowHandle) as QueryLevelInput;

            if (row != null)
            {
                row.GetModifiyFields();
            }
        }
Beispiel #5
0
        private void gridView1_CellValueChanged(object sender, CellValueChangedEventArgs e)
        {
            QueryLevelInput row = gridView1.GetRow(e.RowHandle) as QueryLevelInput;

            if (row != null)
            {
                row.GetModifiyFields();
            }
        }
Beispiel #6
0
        private void btn添加_Click(object sender, EventArgs e)
        {
            QueryLevelInput item = new QueryLevelInput();

            item.是验证录入 = this.是验证录入;

            item.录入人  = AccessController.CurrentUser.姓名;
            item.录入时间 = DateTime.Now;
            currInputRows.Add(item);
            gridControl1.RefreshDataSource();
            gridView1.FocusedRowHandle = gridView1.RowCount - 1;

            MyHelper.WriteLog(LogType.信息, "新增查询权限录入记录", item.ToString <QueryLevelInput>());
        }
Beispiel #7
0
        private void BecomeEffective(QueryLevelInput input)
        {
            QueryLevel m     = new QueryLevel();
            QueryLevel found = QueryLevel.GetQueryLevel(input.姓名, input.公司编码, input.职务等级);

            if (found != null)
            {
                m = found;
            }
            input.CopyWatchMember(m);

            QueryLevelInput anotherInput = input.另一人录入的记录 as QueryLevelInput;

            m.录入人  = !input.是验证录入 ? input.录入人 : anotherInput.录入人;
            m.录入时间 = !input.是验证录入 ? input.录入时间 : anotherInput.录入时间;
            m.验证人  = input.是验证录入 ? input.录入人 : anotherInput.录入人;
            m.验证时间 = input.是验证录入 ? input.录入时间 : anotherInput.录入时间;
            m.Save();
        }
Beispiel #8
0
        private void gridView1_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e)
        {
            e.Appearance.ForeColor = Color.Black;
            e.Appearance.BackColor = Color.Transparent;

            QueryLevelInput row = gridView1.GetRow(e.RowHandle) as QueryLevelInput;

            if (row != null)
            {
                foreach (ModifyField field in row.内容不同的字段)
                {
                    if (field.称 == e.Column.FieldName)
                    {
                        e.Appearance.ForeColor = Color.Yellow;
                        e.Appearance.BackColor = Color.Red;
                    }
                }
            }
        }
Beispiel #9
0
        private void btn删除_Click(object sender, EventArgs e)
        {
            ColumnView colView = (ColumnView)gridControl1.MainView;

            if (colView != null)
            {
                if (MessageBox.Show("确实删除当前记录吗?", "删除提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2, 0, false) == DialogResult.Yes)
                {
                    QueryLevelInput currentItem = (QueryLevelInput)colView.GetFocusedRow();
                    currInputRows.Remove(currentItem);
                    currentItem.Delete();

                    MyHelper.WriteLog(LogType.信息, "删除查询权限记录", currentItem.ToString <QueryLevelInput>());

                    gridControl1.RefreshDataSource();
                    MessageBox.Show("删除成功。", "删除提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }