Ejemplo n.º 1
0
        /// <summary>
        /// Ẩn cột
        /// </summary>
        private void HideColumn()
        {
            try
            {
                var departments = string.Join(",", CurrentUser.Departments.Select(d => d.Id));
                var list        = SystemConfigController.GetAllByNameAndDepartment(NameCondition, departments);
                var columnList  = new List <string>();
                foreach (var item in list)
                {
                    if (string.IsNullOrEmpty(item.Value) || (!string.IsNullOrEmpty(item.Value) && bool.Parse(item.Value)))
                    {
                        columnList.Add(item.Name);
                    }
                }

                foreach (var item in gridDecisionSalaryEnterprise.ColumnModel.Columns)
                {
                    if (columnList.Contains(item.ColumnID))
                    {
                        item.Hidden = true;
                    }
                }
            }
            catch (Exception ex)
            {
                X.Msg.Alert("Thông báo từ hệ thống", "Có lỗi xảy ra: " + ex.Message).Show();
            }
        }
Ejemplo n.º 2
0
        public void LoadConfigGridPanel()
        {
            try
            {
                var departments = string.Join(",", CurrentUser.Departments.Select(d => d.Id));
                var list        = SystemConfigController.GetAllByNameAndDepartment(NameCondition, departments);
                foreach (var item in list)
                {
                    switch (item.Name)
                    {
                    case SystemConfigParameter.QDL_LUONGCUNG:
                        chkLuongCung.Checked = bool.Parse(item.Value);
                        break;

                    case SystemConfigParameter.QDL_HESOLUONG:
                        chkHeSoLuong.Checked = bool.Parse(item.Value);
                        break;

                    case SystemConfigParameter.QDL_PHANTRAMHL:
                        chkPercentageSalary.Checked = bool.Parse(item.Value);
                        break;

                    case SystemConfigParameter.QDL_LUONGDONGBHXH:
                        chkLuongDongBHXH.Checked = bool.Parse(item.Value);
                        break;

                    case SystemConfigParameter.QDL_BACLUONG:
                        chkBacLuong.Checked = bool.Parse(item.Value);
                        break;

                    case SystemConfigParameter.QDL_BACLUONGNB:
                        chkBacLuongNB.Checked = bool.Parse(item.Value);
                        break;

                    case SystemConfigParameter.QDL_NGAYHL:
                        chkNgayHL.Checked = bool.Parse(item.Value);
                        break;

                    case SystemConfigParameter.QDL_NGAYHLNB:
                        chkNgayHLNB.Checked = bool.Parse(item.Value);
                        break;

                    case SystemConfigParameter.QDL_SOQD:
                        chkSoQD.Checked = bool.Parse(item.Value);
                        break;

                    case SystemConfigParameter.QDL_NGAYQD:
                        chkNgayQD.Checked = bool.Parse(item.Value);
                        break;

                    case SystemConfigParameter.QDL_NGAYHIEULUC:
                        chkNgayHieuLuc.Checked = bool.Parse(item.Value);
                        break;

                    case SystemConfigParameter.QDL_NGAYHETHIEULUC:
                        chkNgayHetHieuLuc.Checked = bool.Parse(item.Value);
                        break;

                    case SystemConfigParameter.QDL_NGUOIQD:
                        chkNguoiQD.Checked = bool.Parse(item.Value);
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                X.Msg.Alert("Thông báo từ hệ thống", "Có lỗi xảy ra: " + ex.Message).Show();
            }
        }