Пример #1
0
        public void OnModify(BC_LOAITK obj)
        {
            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                KhaiThacDuLieuProcess       processKTDL = new KhaiThacDuLieuProcess();
                List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>();
                bool ret = false;

                ret = processKTDL.LoaiTK(DatabaseConstant.Action.SUA, ref obj, ref listClientResponseDetail);
                AfterModify(ret, obj, listClientResponseDetail);
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                throw ex;
            }
            finally
            {
                Mouse.OverrideCursor = Cursors.Arrow;
            }
        }
Пример #2
0
        private void SetFormData()
        {
            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                KhaiThacDuLieuProcess       processKTDL = new KhaiThacDuLieuProcess();
                List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>();
                bool ret = false;

                obj    = new BC_LOAITK();
                obj.ID = ID;

                ret = processKTDL.LoaiTK(DatabaseConstant.Action.LOAD, ref obj, ref listClientResponseDetail);
                if (ret == true)
                {
                    ID = obj.ID;

                    #region Thông tin chung
                    lblTrangThai.Content = BusinessConstant.layNgonNguNghiepVu(obj.TTHAI_NVU);

                    cmbLoaiBCTK.SelectedIndex = lstSourceLoaiBCTK.IndexOf(lstSourceLoaiBCTK.FirstOrDefault(i => i.KeywordStrings[1].ToString().Equals(obj.LOAI_BCTK.ToString())));

                    txtMaLoaiTK.Text         = obj.MA_LOAITK;
                    cmbMaDonVi.SelectedIndex = lstSourceDonVi.IndexOf(lstSourceDonVi.FirstOrDefault(i => i.KeywordStrings[0].ToString().Equals(obj.MA_DVI_TAO.ToString())));

                    txtNguonMapping.Text = obj.NGUON_MAPPING;
                    txtTenLoaiTK.Text    = obj.TEN_LOAITK;
                    #endregion

                    #region Thông tin kiểm soát
                    txtTrangThaiBanGhi.Text = BusinessConstant.layNgonNguSuDung(obj.TTHAI_BGHI);
                    raddtNgayLap.Value      = LDateTime.StringToDate(obj.NGAY_NHAP, "yyyyMMdd");
                    txtNguoiLap.Text        = obj.NGUOI_NHAP;
                    if (LDateTime.IsDate(obj.NGAY_CNHAT, "yyyyMMdd") == true)
                    {
                        raddtNgayCapNhat.Value = LDateTime.StringToDate(obj.NGAY_CNHAT, "yyyyMMdd");
                    }
                    else
                    {
                        raddtNgayCapNhat.Value = null;
                    }
                    txtNguoiCapNhat.Text = obj.NGUOI_CNHAT;
                    #endregion

                    #region Lưu thông tin chung
                    TTHAI_BGHI = obj.TTHAI_BGHI;
                    TTHAI_NVU  = obj.TTHAI_NVU;
                    MA_DVI_QLY = obj.MA_DVI_QLY;
                    MA_DVI_TAO = obj.MA_DVI_TAO;
                    NGAY_NHAP  = obj.NGAY_NHAP;
                    NGUOI_NHAP = obj.NGUOI_NHAP;
                    #endregion
                }
                else
                {
                    CommonFunction.ThongBaoKetQua(listClientResponseDetail);
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                throw ex;
            }
            finally
            {
                Mouse.OverrideCursor = Cursors.Arrow;
            }
        }