private void Loaddata()
 {
     if (frmDMOrderType.isAdd)
     {
         Reset();
         btnDelete.Enabled = false;
     }
     else
     {
         txtMa.Enabled             = false;
         dm                        = DMOrderTypeProvider.GetListDmOrderTypeInfoFromOid(frmDMOrderType.Oid);
         txtMa.Text                = dm.OrderType;
         txtTen.Text               = dm.Name;
         txtMoTa.Text              = dm.GhiChu;
         txtLine.Text              = dm.LineType;
         txtLineKm.Text            = dm.LineKm;
         txtLineCk.Text            = dm.LineCk;
         cbNganhHang.SelectedValue = dm.NganhHang;
         chkSuDung.Checked         = dm.SuDung == 1;
         txtMa.Focus();
     }
     if (frmDMOrderType.IsSync)
     {
         //không cho phép người dùng sửa, xóa các thông tin trên form.
         txtMa.Enabled     = false;
         txtTen.Enabled    = false;
         btnDelete.Enabled = false;
     }
 }
Example #2
0
 private void SetFormInfo(DMDoiTuongInfo doiTuongInfo)
 {
     txtWebSite.Text      = doiTuongInfo.WebSite;
     txtTyLePhat.Text     = Convert.ToString(doiTuongInfo.TyLePhat);
     txtTinh.Text         = doiTuongInfo.Tinh;
     txtThuNhap.Text      = Convert.ToString(doiTuongInfo.ThuNhap);
     txtTenDoiTuong.Text  = doiTuongInfo.TenDoiTuong;
     txtTaiKhoan.Text     = doiTuongInfo.TaiKhoan;
     txtSoLanMuaHang.Text = Convert.ToString(doiTuongInfo.SoLanMuaHang);
     txtSoDKKD.Text       = doiTuongInfo.SoDKKD;
     txtQuocGia.Text      = doiTuongInfo.QuocGia;
     txtPhongBan.Text     = doiTuongInfo.PhongBan;
     //lupOrderType.EditValue = doiTuongInfo.IdOrderType;
     bteOrderType.Tag          = DMOrderTypeProvider.GetListDmOrderTypeInfoFromOid(doiTuongInfo.IdOrderType);
     bteOrderType.Text         = bteOrderType.Tag == null ? String.Empty : ((DMOrderTypeInfor)bteOrderType.Tag).LineType;
     txtNguoiLienLac.Text      = doiTuongInfo.NguoiLienLac;
     txtNgheNghiep.Text        = doiTuongInfo.NgheNghiep;
     deNgaySinh.EditValue      = doiTuongInfo.NgaySinh;
     deNgayCapThe.EditValue    = doiTuongInfo.NgayCapThe;
     txtNganHang.Text          = doiTuongInfo.NganHang;
     txtMaSoThue.Text          = doiTuongInfo.MaSoThue;
     txtMaRieng.Text           = doiTuongInfo.MaRieng;
     txtMaDoiTuong.Text        = doiTuongInfo.MaDoiTuong;
     lupLoaiThe.EditValue      = doiTuongInfo.IdLoaiThe;
     txtKnownFrom.Text         = doiTuongInfo.Biet_Ta_Tu;
     txtHuyen.Text             = doiTuongInfo.Huyen;
     txtHanTra.Text            = Convert.ToString(doiTuongInfo.HanTra);
     txtHanMucTinDung.Text     = Common.Double2Str(doiTuongInfo.HanMucTinDung);
     txtHMTDConLai.Text        = Common.Double2Str(doiTuongInfo.HanMucTDConLai);
     cboGioiTinh.SelectedIndex = doiTuongInfo.GioiTinh > 2 ? 0 : doiTuongInfo.GioiTinh;
     txtGiaTriMuaHang.Text     = Common.Double2Str(doiTuongInfo.GiaTriMuaHang);
     txtFax.Text                   = doiTuongInfo.Fax;
     txtEmailDT.Text               = doiTuongInfo.Email;
     txtEmailCDN.Text              = doiTuongInfo.Email_CDN;
     txtDoTuoi.Text                = Convert.ToString(doiTuongInfo.DoTuoi);
     txtDienThoaiNLL.Text          = doiTuongInfo.DienThoai_NLL;
     txtDienThoaiDT.Text           = doiTuongInfo.DienThoai;
     txtDienThoaiCDN.Text          = doiTuongInfo.DienThoai_CDN;
     txtDiaChi.Text                = doiTuongInfo.DiaChi;
     txtCMTNLL.Text                = doiTuongInfo.CMND_NLL;
     txtCMTDT.Text                 = doiTuongInfo.SoCMND;
     txtCDN.Text                   = doiTuongInfo.ChuDoanhNghiep;
     cboLoaiDoiTuong.SelectedIndex = doiTuongInfo.Type;
     //lupDoiTuongCha.EditValue = doiTuongInfo.IdCha;
     bteDoiTuongCha.Tag        = DmDoiTuongProvider.GetDmDoiTuongInfoFromOid(doiTuongInfo.IdCha);
     bteDoiTuongCha.Text       = bteDoiTuongCha.Tag == null ? String.Empty : ((DMDoiTuongInfo)bteDoiTuongCha.Tag).TenDoiTuong;
     lupNhomDoiTuong.EditValue = doiTuongInfo.IdLoaiDoiTuong;
     txtBillTo.Text            = Convert.ToString(doiTuongInfo.BillTo);
     txtShipTo.Text            = Convert.ToString(doiTuongInfo.ShipTo);
     txtCongNoKhachHang.Text   = Common.Double2Str(doiTuongInfo.CongNoKhachHang);
 }