Пример #1
0
        private VnsMaLoaiKhoan GetObjectFromControl()
        {
            VnsMaLoaiKhoan _tmp = new VnsMaLoaiKhoan();

            _tmp.MaChuong = txtMaChuong.Text;
            _tmp.Ma       = txtMa.Text;
            _tmp.Ten      = txtTenLoaiKhoan.Text;
            VnsMaLoaiKhoan cha = new VnsMaLoaiKhoan();

            cha = (VnsMaLoaiKhoan)ComboHelper.GetSelectData(grlDmLoaiKhoan);
            if (cha == null)
            {
                _tmp.IdCha = new Guid();
                _tmp.MaCha = "";
            }
            else
            {
                _tmp.IdCha = cha.Id;
                _tmp.MaCha = cha.Ma;
            }

            _tmp.MaHang  = txtMaHang.Text;
            _tmp.MoTa    = txtMoTa.Text;
            _tmp.ChiTiet = VnsCheck.IsNullGuid(grlDmLoaiKhoan.EditValue) ? 0 : 1;
            return(_tmp);
        }
Пример #2
0
        private void cboDmDonVi_EditValueChanged(object sender, EventArgs e)
        {
            VnsDmDonVi tmp = (VnsDmDonVi)ComboHelper.GetSelectData(cboDmDonVi);

            if (tmp == null)
            {
                return;
            }

            txtTenDonVi.Text = tmp.TenDonvi;
        }
Пример #3
0
        private VnsDmDonVi GetObjectFromControl()
        {
            VnsDmDonVi _tmp = new VnsDmDonVi();

            _tmp.Ma             = txtMaDonVi.Text;
            _tmp.TenDonvi       = txtTenDonVi.Text;
            _tmp.NganHangId     = (Guid)cboDmNganHang.EditValue;
            _tmp.objDmNganHang  = (VnsDmNganHang)ComboHelper.GetSelectData(cboDmNganHang);
            _tmp.NhomDonviId    = (Guid)cboNhomDonvi.EditValue;
            _tmp.objDmNhomDonVi = (VnsDmNhomDonVi)ComboHelper.GetSelectData(cboNhomDonvi);
            _tmp.MaDvQhns       = txtMaDvQhns.Text;
            _tmp.SoTaiKhoan     = txtSoTaiKhoan.Text;
            _tmp.DiaChi         = txtDiaChi.Text;
            _tmp.MaTkCo         = txtMaTkCo.Text;
            return(_tmp);
        }
Пример #4
0
        private void GetObject()
        {
            if (this.objChungTu == null)
            {
                this.objChungTu = new VnsKhNganSach();
            }

            bool flg = false;

            switch (FormStatus)
            {
            case FormUpdate.Insert:
                flg = true;
                ucCtuSo.Soct(objLoaiChungTu.Id, dteNgayCt.DateTime.Month, dteNgayCt.DateTime.Year);
                ucCtuSo.Text = ucCtuSo.SO_CHUNG_TU;
                //ucCtuSo.Text = "1";
                break;

            case FormUpdate.Update:
                flg = false;
                break;
            }

            this.objChungTu.LoaiCt      = objLoaiChungTu.Id;
            this.objChungTu.MaCt        = objLoaiChungTu.MaLoaiChungTu;
            this.objChungTu.NgayCt      = (DateTime)dteNgayCt.EditValue;
            this.objChungTu.NgayKeHoach = (DateTime)dteNgayCt.EditValue;
            //this.ChungTu.NguoiGiaoDich = txtNguoiNhan.Text;
            this.objChungTu.SoChungTu = ucCtuSo.Text;
            this.objChungTu.NoiDung   = txtNoiDung.Text;
            objChungTu.DonViId        = (Guid)cboDmDonVi.EditValue;
            objChungTu.ObjDmDonVi     = (VnsDmDonVi)ComboHelper.GetSelectData(cboDmDonVi);
            objChungTu.TuDong         = false;

            //VnsChungTuService.SaveChungTu(flg, this.ChungTu, lstGiaoDich, lstDelGiaoDich);
            VnsKhNganSachService.SaveOrUpdate(objChungTu);
            this.IsOk = true;
            this.Close();
        }