Ejemplo n.º 1
0
    protected void btnCapNhatCauHinh_Click(object sender, DirectEventArgs e)
    {
        try
        {
            string            maDV       = Session["MaDonVi"].ToString();
            HeThongController controller = new HeThongController();

            controller.CreateOrSave(SystemConfigParameter.DSC_GIOVAO, chkGioVao.Checked.ToString(), CurrentUser.ID, maDV);
            controller.CreateOrSave(SystemConfigParameter.DSC_GIORA, chkGioRa.Checked.ToString(), CurrentUser.ID, maDV);
            controller.CreateOrSave(SystemConfigParameter.DSC_SOGIOLAM, chkSoGioLam.Checked.ToString(), CurrentUser.ID, maDV);
            controller.CreateOrSave(SystemConfigParameter.DSC_CHOPHEPDIMUON, chkChoPhepDiMuon.Checked.ToString(), CurrentUser.ID, maDV);
            controller.CreateOrSave(SystemConfigParameter.DSC_CHOPHEPVESOM, chkChoPhepVeSom.Checked.ToString(), CurrentUser.ID, maDV);
            //   controller.CreateOrSave(SystemConfigParameter.DSC_BATDAUTINHLAMTHEMDAUGIO, chkBatDauTinhLamThemDauGio.Checked.ToString(), CurrentUser.ID, maDV);
            //   controller.CreateOrSave(SystemConfigParameter.DSC_BATDAULAMTHEMCUOIGIO, chkBatDauTinhLamThemCuoiGio.Checked.ToString(), CurrentUser.ID, maDV);
            controller.CreateOrSave(SystemConfigParameter.DSC_APDUNGTUNGAY, chkApDungTuNgay.Checked.ToString(), CurrentUser.ID, maDV);
            controller.CreateOrSave(SystemConfigParameter.DSC_APDUNGDENNGAY, chkApDungDenNgay.Checked.ToString(), CurrentUser.ID, maDV);

            controller.CreateOrSave(SystemConfigParameter.DSC_QUETTHEDAUCA, chkQuetTheDauCa.Checked.ToString(), CurrentUser.ID, maDV);
            controller.CreateOrSave(SystemConfigParameter.DSC_QUETTHENGHIDAUCA, chkQuetTheNghiDauCa.Checked.ToString(), CurrentUser.ID, maDV);
            controller.CreateOrSave(SystemConfigParameter.DSC_QUETTHEVAOCASAU, chkQuetTheVaoCaSau.Checked.ToString(), CurrentUser.ID, maDV);
            controller.CreateOrSave(SystemConfigParameter.DSC_QUETTHECUOICA, chkQuetTheCuoiCa.Checked.ToString(), CurrentUser.ID, maDV);
            controller.CreateOrSave(SystemConfigParameter.DSC_PHUCAPCA, chkPhuCapCa.Checked.ToString(), CurrentUser.ID, maDV);
            controller.CreateOrSave(SystemConfigParameter.DSC_MUCLUONGCA, chkMucLuongCa.Checked.ToString(), CurrentUser.ID, maDV);
            controller.CreateOrSave(SystemConfigParameter.DSC_NGAYAPDUNG, chkNgayApDung.Checked.ToString(), CurrentUser.ID, maDV);
            controller.CreateOrSave(SystemConfigParameter.DSC_NGAYTAO, chkNgayTao.Checked.ToString(), CurrentUser.ID, maDV);
            controller.CreateOrSave(SystemConfigParameter.DSC_LOAICA, chkLoaiCa.Checked.ToString(), CurrentUser.ID, maDV);

            Dialog.ShowNotification("Đã lưu cấu hình");
            wdConfigGridPanel.Hide();
            Response.Redirect(Request.RawUrl);
        }
        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
    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;
            //}
            string            maDonVi      = Session["MaDonVi"].ToString();
            HeThongController htController = new HeThongController();
            // tab thông tin chung
            htController.CreateOrSave(SystemConfigParameter.EMAIL, txtSystemMail.Text.Trim(), CurrentUser.ID, maDonVi);
            htController.CreateOrSave(SystemConfigParameter.PASSWORD_EMAIL, txtPassword.Text.Trim(), CurrentUser.ID, maDonVi);
            htController.CreateOrSave(SystemConfigParameter.MENU_TYPE, cbMenuType.SelectedItem.Value, CurrentUser.ID, maDonVi);
            htController.CreateOrSave(SystemConfigParameter.COMPANY_NAME, txtCompanyName.Text.Trim(), CurrentUser.ID, maDonVi);
            htController.CreateOrSave(SystemConfigParameter.CITY, txtCity.Text.Trim(), CurrentUser.ID, maDonVi);
            // htController.CreateOrSave(SystemConfigParameter.LUONG_CB, txtLuongCB.Text.Trim(), CurrentUser.ID, maDonVi);
            htController.CreateOrSave(SystemConfigParameter.PREFIX, txtTienTo.Text.Trim(), CurrentUser.ID, maDonVi);
            htController.CreateOrSave(SystemConfigParameter.NUMBER_OF_CHARACTER, txtSoLuong.Text.Trim(), CurrentUser.ID, maDonVi);
            htController.CreateOrSave(SystemConfigParameter.COMPANY_ADDRESS, txt_DiaChi.Text.Trim(), CurrentUser.ID, maDonVi);
            htController.CreateOrSave(SystemConfigParameter.COMPANY_MASOTHUE, txt_MaSoThue.Text.Trim(), CurrentUser.ID, maDonVi);
            htController.CreateOrSave(SystemConfigParameter.COMPANY_DIENTHOAI, txt_DienThoai.Text.Trim(), CurrentUser.ID, maDonVi);
            htController.CreateOrSave(SystemConfigParameter.COMPANY_FAX, txt_Fax.Text.Trim(), CurrentUser.ID, maDonVi);
            htController.CreateOrSave(SystemConfigParameter.COMPANY_EMAIL, txt_Email.Text.Trim(), CurrentUser.ID, maDonVi);
            //   htController.CreateOrSave(SystemConfigParameter.BAO_HET_HAN_HOP_DONG, txtNotification.Text.Trim(), CurrentUser.ID, maDonVi);

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

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

            wdWindow.Hide();
        }
        catch (Exception ex)
        {
            X.MessageBox.Alert("Thông báo", ex.Message).Show();
        }
    }