コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnUpdateConfig_Click(object sender, DirectEventArgs e)
        {
            try
            {
                if (txtSystemMail.Text.Contains("@gmail.com") == false && !string.IsNullOrEmpty(txtSystemMail.Text))
                {
                    X.MessageBox.Alert("Thông báo", "Hệ thống chỉ chấp nhận định dạng gmail").Show();
                    return;
                }

                //SystemController htController = new SystemController();
                var htController = new SystemConfigController();
                var departments  = string.Join(",", _userModel.Departments.Select(d => d.Id));

                // tab thông tin chung
                htController.CreateOrSave(SystemConfigParameter.EMAIL, txtSystemMail.Text.Trim(), departments);
                htController.CreateOrSave(SystemConfigParameter.PASSWORD_EMAIL, txtPassword.Text.Trim(), departments);
                htController.CreateOrSave(SystemConfigParameter.MENU_TYPE, cbMenuType.SelectedItem.Value, departments);
                htController.CreateOrSave(SystemConfigParameter.COMPANY_NAME, txtCompanyName.Text.Trim(), departments);
                htController.CreateOrSave(SystemConfigParameter.CITY, txtCity.Text.Trim(), departments);
                htController.CreateOrSave(SystemConfigParameter.PREFIX, txtTienTo.Text.Trim(), departments);
                htController.CreateOrSave(SystemConfigParameter.NUMBER_OF_CHARACTER, txtSoLuong.Text.Trim(), departments);
                htController.CreateOrSave(SystemConfigParameter.COMPANY_ADDRESS, txt_DiaChi.Text.Trim(), departments);
                htController.CreateOrSave(SystemConfigParameter.COMPANY_MASOTHUE, txt_MaSoThue.Text.Trim(), departments);
                htController.CreateOrSave(SystemConfigParameter.COMPANY_DIENTHOAI, txt_DienThoai.Text.Trim(), departments);
                htController.CreateOrSave(SystemConfigParameter.COMPANY_FAX, txt_Fax.Text.Trim(), departments);
                htController.CreateOrSave(SystemConfigParameter.COMPANY_EMAIL, txt_Email.Text.Trim(), departments);
                htController.CreateOrSave(SystemConfigParameter.MNG_COMPANY_NAME, txtManagementCompanyName.Text.Trim(), departments);

                // tab sinh mã, số quyết định
                htController.CreateOrSave(SystemConfigParameter.SUFFIX_SOHOPDONG, txtSoHopDong.Text.Trim(), departments);
                htController.CreateOrSave(SystemConfigParameter.SUFFIX_SOQDLUONG, txtSoQuyetDinhLuong.Text.Trim(), departments);
                htController.CreateOrSave(SystemConfigParameter.SUFFIX_SOQDKHENTHUONG, txtSoQDKhenThuong.Text.Trim(), departments);
                htController.CreateOrSave(SystemConfigParameter.SUFFIX_SOQDKYLUAT, txtSoQDKyLuat.Text.Trim(), departments);
                htController.CreateOrSave(SystemConfigParameter.SUFFIX_SOQDCONGTAC, txtSoQDCongTac.Text.Trim(), departments);
                htController.CreateOrSave(SystemConfigParameter.SUFFIX_SOQDDIEUCHUYEN, txtSoQĐieuChuyen.Text.Trim(), departments);

                // tab cấu hình chữ ký báo cáo
                htController.CreateOrSave(SystemConfigParameter.SuDungTenDangNhap, chknguoidangnhap.Checked.ToString(), departments);
                htController.CreateOrSave(SystemConfigParameter.chuky1, txtnguoiky1.Text.Trim(), departments);
                htController.CreateOrSave(SystemConfigParameter.chuky2, txtnguoiky2.Text.Trim(), departments);
                htController.CreateOrSave(SystemConfigParameter.chuky3, txtnguoiky3.Text.Trim(), departments);
                htController.CreateOrSave(SystemConfigParameter.chuky4, txtnguoiky4.Text.Trim(), departments);

                wdWindow.Hide();
            }
            catch (Exception ex)
            {
                X.MessageBox.Alert("Thông báo", ex.Message).Show();
            }
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnUpdateConfig_Click(object sender, DirectEventArgs e)
        {
            try
            {
                var controller  = new SystemConfigController();
                var departments = string.Join(",", CurrentUser.Departments.Select(d => d.Id));
                // department
                var arrDepartment = departments.Split(new[] { ',' }, StringSplitOptions.None);
                for (var i = 0; i < arrDepartment.Length; i++)
                {
                    arrDepartment[i] = "{0}".FormatWith(arrDepartment[i]);
                }

                controller.CreateOrSave(SystemConfigParameter.QDL_LUONGCUNG, chkLuongCung.Checked.ToString(),
                                        string.Join(",", arrDepartment));
                controller.CreateOrSave(SystemConfigParameter.QDL_HESOLUONG, chkHeSoLuong.Checked.ToString(),
                                        string.Join(",", arrDepartment));
                controller.CreateOrSave(SystemConfigParameter.QDL_PHANTRAMHL, chkPercentageSalary.Checked.ToString(),
                                        string.Join(",", arrDepartment));
                controller.CreateOrSave(SystemConfigParameter.QDL_LUONGDONGBHXH, chkLuongDongBHXH.Checked.ToString(),
                                        string.Join(",", arrDepartment));
                controller.CreateOrSave(SystemConfigParameter.QDL_BACLUONG, chkBacLuong.Checked.ToString(),
                                        string.Join(",", arrDepartment));
                controller.CreateOrSave(SystemConfigParameter.QDL_BACLUONGNB, chkBacLuongNB.Checked.ToString(),
                                        string.Join(",", arrDepartment));
                controller.CreateOrSave(SystemConfigParameter.QDL_NGAYHL, chkNgayHL.Checked.ToString(),
                                        string.Join(",", arrDepartment));
                controller.CreateOrSave(SystemConfigParameter.QDL_NGAYHLNB, chkNgayHLNB.Checked.ToString(),
                                        string.Join(",", arrDepartment));
                controller.CreateOrSave(SystemConfigParameter.QDL_SOQD, chkSoQD.Checked.ToString(),
                                        string.Join(",", arrDepartment));
                controller.CreateOrSave(SystemConfigParameter.QDL_NGAYQD, chkNgayQD.Checked.ToString(),
                                        string.Join(",", arrDepartment));
                controller.CreateOrSave(SystemConfigParameter.QDL_NGAYHIEULUC, chkNgayHieuLuc.Checked.ToString(),
                                        string.Join(",", arrDepartment));
                controller.CreateOrSave(SystemConfigParameter.QDL_NGAYHETHIEULUC, chkNgayHetHieuLuc.Checked.ToString(),
                                        string.Join(",", arrDepartment));
                controller.CreateOrSave(SystemConfigParameter.QDL_NGUOIQD, chkNguoiQD.Checked.ToString(),
                                        string.Join(",", arrDepartment));

                Dialog.ShowNotification("Đã lưu cấu hình");
                wdConfigGridPanel.Hide();
                Response.Redirect(Request.RawUrl);
            }
            catch (Exception ex)
            {
                ExtNet.Msg.Alert("Thông báo từ hệ thống", "Có lỗi xảy ra: " + ex.Message).Show();
            }
        }