예제 #1
0
 /// <summary>
 /// Lay du lieu tu control dieu khien dua vao object
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="banghi"></param>
 /// <param name="nghiepvu"></param>
 void LayDuLieu(ref Presentation.Process.DanhMucServiceRef.DM_TINH_TP obj, BusinessConstant.TrangThaiBanGhi banghi, BusinessConstant.TrangThaiNghiepVu nghiepvu)
 {
     obj.MA_TINHTP    = txtMaSo.Text;
     obj.TEN_TINHTP   = txtTenDayDu.Text;
     obj.TEN_TAT      = txtTenTat.Text;
     obj.ID_VUNG_MIEN = int.Parse(IdVung);
     obj.NGAY_NHAP    = LDateTime.GetCurrentDate(ApplicationConstant.defaultDateTimeFormat);
     obj.MA_DVI_QLY   = ClientInformation.MaDonVi;
     obj.MA_DVI_TAO   = ClientInformation.MaDonVi;
     obj.NGUOI_NHAP   = ClientInformation.TenDangNhap;
     obj.TTHAI_BGHI   = BusinessConstant.layGiaTri(banghi);
     obj.TTHAI_NVU    = BusinessConstant.layGiaTri(nghiepvu);
 }
예제 #2
0
        /// <summary>
        /// Luu du lieu
        /// </summary>
        /// <param name="banghi"></param>
        /// <param name="nghiepvu"></param>
        void Luu(BusinessConstant.TrangThaiBanGhi banghi, BusinessConstant.TrangThaiNghiepVu nghiepvu)
        {
            if (Vadidate())
            {
                DanhMucProcess danhmucProcess = new DanhMucProcess();
                try
                {
                    Presentation.Process.DanhMucServiceRef.DM_TINH_TP objTTP = new Presentation.Process.DanhMucServiceRef.DM_TINH_TP();
                    LayDuLieu(ref objTTP, banghi, nghiepvu);
                    int iResutl = 0;

                    //if (LstChiTiet == null)
                    //    iResutl = danhmucProcess.ThemTinhTP(objTTP);
                    //else
                    //{
                    //    objTTP.ID = int.Parse(LstChiTiet[1].ToString());
                    //    iResutl = danhmucProcess.updateTinhTP(objTTP);
                    //}

                    if (iResutl > 0)
                    {
                        LMessage.ShowMessage("M.DanhMuc.ucQuocGiaCT.LuuDuLieuThanhCong", LMessage.MessageBoxType.Information);
                        if (OnSavingComleted != null)
                        {
                            OnSavingComleted(null, EventArgs.Empty);
                        }
                        if (cbMultiAdd.IsChecked == true)
                        {
                            ClearForm();
                        }
                        else
                        {
                            PresentationWPF.CustomControl.CommonFunction.CloseUserControl(this);
                        }
                    }
                    else
                    {
                        LMessage.ShowMessage("M.DanhMuc.ucQuocGiaCT.LoiLuuDuLieu", LMessage.MessageBoxType.Error);
                    }
                }
                catch (Exception ex)
                {
                    LMessage.ShowMessage("M.DanhMuc.ucQuocGiaCT.LoiLuuDuLieu", LMessage.MessageBoxType.Error);
                    LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
                }
            }
        }