void ThuChiModelToThuChi(ThuChiModel nvfrom, ThuChi nvto) { nvto.Id = nvfrom.Id; //nvto.Ma = nvfrom.Ma; //nvto.NgayTao = nvfrom.NgayTao; nvto.NgayGiaoDich = nvfrom.NgayGiaoDich; nvto.LoaiThuChiId = nvfrom.LoaiThuChiId; nvto.DienGiai = nvfrom.DienGiai; nvto.GiaTri = nvfrom.GiaTri; if (nvfrom.NguoiNopId > 0) { nvto.NguoiNopId = nvfrom.NguoiNopId; } else { nvto.NguoiNopId = null; } if (nvfrom.NguoiThuId > 0) { nvto.NguoiThuId = nvfrom.NguoiThuId; } else { nvto.NguoiThuId = null; } //nvto.NguoiTaoId = nvfrom.NguoiTaoId; nvto.isChi = nvfrom.isChi; }
protected void Page_Load(object sender, EventArgs e) { var id = Request["ID"]; var khId = Request["KH_ID"]; var pdvId = Request["PDV_ID"]; using (var con = DAL.con()) { if (string.IsNullOrEmpty(id)) { Item = ThuChiDal.SelectByDraff(con, false); if (khId != null && khId.Length > 36) { khId = khId.Substring(khId.LastIndexOf(',') + 1); var kh = KhachHangDal.SelectById(new Guid(khId), con); Item.P_Ten = kh.Ten; Item.P_ID = kh.ID; } } else { Item = ThuChiDal.SelectById(con, new Guid(id)); } var listLoai = DanhMucDal.SelectByLDMMa(con, "NDTC-CHI"); AddChi.ListLoai = listLoai; AddChi.Item = Item; } }
// POST: ThuChi/Delete/5 public JsonResult Delete(int id) { ThuChi obj = db.ThuChis.Find(id); db.ThuChis.Remove(obj); return(Json(db.SaveChanges())); }
protected void Page_Load(object sender, EventArgs e) { var id = Request["ID"]; var khId = Request["KH_ID"]; var pdvId = Request["PDV_ID"]; using (var con = DAL.con()) { if (string.IsNullOrEmpty(id)) { Item = ThuChiDal.SelectByDraff(con, false); if (khId != null && khId.Length > 36) { khId = khId.Substring(khId.LastIndexOf(',') + 1); var kh = KhachHangDal.SelectById(new Guid(khId), con); Item.P_Ten = kh.Ten; Item.P_ID = kh.ID; } } else { Item = ThuChiDal.SelectById(con, new Guid(id)); } var listLoai = DanhMucDal.SelectByLDMMa(con, "NDTC-CHI"); AddChi.ListLoai = listLoai; AddChi.Item = Item; } }
public ActionResult ThuChiTao(ThuChiModel model, bool continueEditing) { if (this.CheckNoAccessIntoNhaXe(_workContext, _permissionService, StandardPermissionProvider.CVHoatDongBanVe)) { return(AccessDeniedView()); } if (ModelState.IsValid) { //kiem tra loai thu chi if (model.LoaiThuChiId == 0) { if (string.IsNullOrEmpty(model.tenloaithuchi)) { ErrorNotification("Tên loại thu chi không được trống"); return(View(model)); } var ltc = new LoaiThuChi(); ltc.Ten = model.tenloaithuchi; ltc.NhaXeId = _workContext.NhaXeId; _ketoanService.Insert(ltc); model.LoaiThuChiId = ltc.Id; } var item = new ThuChi(); ThuChiModelToThuChi(model, item); item.NgayTao = DateTime.Now; item.NguoiTaoId = _workContext.CurrentNhanVien.Id; item.NhaXeId = _workContext.NhaXeId; _ketoanService.Insert(item); SuccessNotification("Tạo mới thành công"); return(continueEditing ? RedirectToAction("ThuChiSua", new { id = item.Id }) : RedirectToAction("List")); } ThuChiModelPrepare(model); return(View(model)); }
public virtual void Delete(ThuChi _item) { if (_item == null) { throw new ArgumentNullException("ThuChi"); } _thuchiRepository.Delete(_item); }
// PUT api/values/5 public string Put(int id, [FromBody] ThuChi obj) { obj.ID = id; bool res = new ThuChiDAO().Update(obj); if (res) { return("success"); } return("fail"); }
// GET: ThuChi/Edit/5 public ActionResult Edit(int?id) { ThuChi obj = new ThuChi() { State = Notify.INIT }; if (id > 0) { obj = db.ThuChis.Find(id); obj.Thu = obj.MaThuChi.StartsWith("THU_"); obj.MaThuChi = obj.MaThuChi.Remove(0, 4); } ViewBag.IDQuys = db.Quys.Where(q => q.State != Notify.CANCLE).CreateSelectList(q => q.IDQuy, q => q.mName, obj.IDQuy); return(View(obj)); }
public UcThuChi(ThuChi data = null) { InitializeComponent(); ThuChi_NoiDungId.DisplayMember = "Ten"; ThuChi_NoiDungId.ValueMember = "Id"; ThuChi_NoiDungId.DataSource = new BindingSource(CRUD.DbContext.DanhMucs.Where(s => s.Loai == Define.LoaiDanhMucEnum.ThuChi.ToString()).ToList(), null); ThuChi_Loai.DisplayMember = "Value"; ThuChi_Loai.ValueMember = "Key"; ThuChi_Loai.DataSource = new BindingSource(Define.LoaiThuChiDict, null); Init(data); if (data != null) { ThuChi_Loai.SelectedValue = PrimitiveConvert.StringToEnum <Define.LoaiThuChiEnum>(data.Loai); } _domainData = data; }
protected void Page_Load(object sender, EventArgs e) { var id = Request["ID"]; var idNull = string.IsNullOrEmpty(id); using(var con = DAL.con()) { if(idNull) { Item = ThuChiDal.SelectByLastest(con, Security.CqId); } else { Item = ThuChiDal.SelectById(con, Convert.ToInt64(id)); var phoi = PhoiDal.SelectById(Item.PHOI_ID); var xe = XeDal.SelectById(phoi.XE_ID); phoi.Xe = xe; Item.Phoi = phoi; } } ThuCapPhoiAdd.Item = Item; }
protected void Page_Load(object sender, EventArgs e) { var id = Request["ID"]; var idNull = string.IsNullOrEmpty(id); using (var con = DAL.con()) { if (idNull) { Item = ThuChiDal.SelectByLastest(con, Security.CqId); } else { Item = ThuChiDal.SelectById(con, Convert.ToInt64(id)); var phoi = PhoiDal.SelectById(Item.PHOI_ID); var xe = XeDal.SelectById(phoi.XE_ID); phoi.Xe = xe; Item.Phoi = phoi; } } ThuCapPhoiAdd.Item = Item; }
public ActionResult Edit(ThuChi obj) { var chane = (obj.Thu ? 1 : -1) * obj.SoTien; obj.MaThuChi = $"{(obj.Thu ? "THU" : "CHI")}_{obj.MaThuChi}"; if (obj.IDThuChi > 0) { db.Entry(obj).State = EntityState.Modified; } else { obj.CreateBy = Account.IDTaiKhoan; obj.CreateTime = DateTime.Now; obj.State = Notify.INIT; db.ThuChis.Add(obj); } if (db.SaveChanges() > 0) { UpdateQuy(obj.IDQuy ?? 0, chane); } return(RedirectToAction("Index")); }
void ThuChiToThuChiModel(ThuChi nvfrom, ThuChiModel nvto) { nvto.Id = nvfrom.Id; nvto.Ma = nvfrom.Ma; nvto.NgayTao = nvfrom.NgayTao; nvto.NgayGiaoDich = nvfrom.NgayGiaoDich; nvto.ChuyenDiId = nvfrom.ChuyenDiId.GetValueOrDefault(0); nvto.thongtinchuyendi = nvfrom.chuyendi != null?nvfrom.chuyendi.toMoTa() : ""; nvto.NgayDi = nvfrom.chuyendi != null ? nvfrom.chuyendi.NgayDi : DateTime.Now; nvto.LoaiThuChiId = nvfrom.LoaiThuChiId; nvto.tenloaithuchi = nvfrom.loaithuchi.Ten; nvto.DienGiai = nvfrom.DienGiai; nvto.GiaTri = nvfrom.GiaTri; nvto.NguoiNopId = nvfrom.NguoiNopId.GetValueOrDefault(0); nvto.tennguoinop = nvfrom.nguoinop != null ? nvfrom.nguoinop.HoVaTen : ""; nvto.NguoiThuId = nvfrom.NguoiThuId.GetValueOrDefault(0); nvto.tennguoithu = nvfrom.nguoithu != null ? nvfrom.nguoithu.HoVaTen : ""; nvto.NguoiTaoId = nvfrom.NguoiTaoId; nvto.tennguoitao = nvfrom.nguoitao.HoVaTen; nvto.isChi = nvfrom.isChi; nvto.isChiText = nvfrom.isChi ? "Chi" : "Thu"; }
public UcThuChi(long noiDungId, ThuChi data = null) { InitializeComponent(); ThuChi_NoiDungId.DisplayMember = "Ten"; ThuChi_NoiDungId.ValueMember = "Id"; ThuChi_NoiDungId.DataSource = new BindingSource(CRUD.DbContext.DanhMucs.Where(s => s.Loai == Define.LoaiDanhMucEnum.ThuChi.ToString() && s.IsActived).ToList(), null); ThuChi_Loai.DisplayMember = "Value"; ThuChi_Loai.ValueMember = "Key"; ThuChi_Loai.DataSource = new BindingSource(Define.LoaiThuChiDict, null); _domainData = data; if (_domainData == null) { _domainData = new ThuChi(); _domainData.NgayLap = TimeHelper.CurentDateTime(); _domainData.Loai = Define.LoaiThuChiEnum.Thu.ToString(); _domainData.NoiDungId = noiDungId; } Init(_domainData); }
protected void Page_Load(object sender, EventArgs e) { var NDTC_ID = Request["NDTC_ID"]; var CQ_ID = Request["CQ_ID"]; var MaPhieu = Request["MaPhieu"]; var SoPhieu = Request["SoPhieu"]; var SoPhieuAll = Request["SoPhieuAll"]; var SoTien = Request["SoTien"]; var Mota = Request["Mota"]; var NgayTrenPhieu = Request["NgayTrenPhieu"]; var NgayTao = Request["NgayTao"]; var NguoiTao = Request["NguoiTao"]; var NgayCapNhat = Request["NgayCapNhat"]; var NguoiCapNhat = Request["NguoiCapNhat"]; var LoaiQuy = Request["LoaiQuy"]; var LoaiCandoi = Request["LoaiCandoi"]; var isCandoi = Request["isCandoi"]; var Thu = Request["Thu"]; var XN_ID = Request["XN_ID"]; var P_ID = Request["P_ID"]; var PDV_ID = Request["PDV_ID"]; var CTV_ID = Request["CTV_ID"]; var PGV_ID = Request["PGV_ID"]; var PBH_ID = Request["PBH_ID"]; var Xoa = Request["Xoa"]; var XoaAdm = Request["XoaAdm"]; XoaAdm = string.IsNullOrEmpty(XoaAdm) ? "false" : "true"; Xoa = string.IsNullOrEmpty(Xoa) ? "false" : "true"; var logged = Security.IsAuthenticated(); var Id = Request["ID"]; var IdNull = string.IsNullOrEmpty(Id); var refUrl = Request["refUrl"]; if (!string.IsNullOrEmpty(refUrl)) { refUrl = Server.UrlDecode(refUrl); } switch (subAct) { case "save": #region Thêm Thu chi if (logged) { var item = ThuChiDal.SelectById(new Guid(Id)); IdNull = item.ID == Guid.Empty; if (IdNull) { item = new ThuChi { ID = new Guid(Id), NgayTao = DateTime.Now, NguoiTao = Security.UserId, NguoiCapNhat = Security.UserId, NgayCapNhat = DateTime.Now }; } else { item.NgayCapNhat = DateTime.Now; item.NguoiCapNhat = Security.UserId; } item.isCandoi = false; if (!string.IsNullOrEmpty(LoaiQuy)) { item.LoaiQuy = Convert.ToInt32(LoaiQuy); } if (!string.IsNullOrEmpty(NgayTrenPhieu)) { item.NgayTrenPhieu = Convert.ToDateTime(NgayTrenPhieu, new CultureInfo("vi-vn")); } if (!string.IsNullOrEmpty(SoTien)) { item.SoTien = Convert.ToDouble(SoTien); } if (!string.IsNullOrEmpty(P_ID)) { item.P_ID = new Guid(P_ID); } if (!string.IsNullOrEmpty(PDV_ID)) { item.PDV_ID = new Guid(PDV_ID); } if (!string.IsNullOrEmpty(CTV_ID)) { item.CTV_ID = new Guid(CTV_ID); } if (!string.IsNullOrEmpty(PGV_ID)) { item.PGV_ID = new Guid(PGV_ID); } if (!string.IsNullOrEmpty(PBH_ID)) { item.PBH_ID = new Guid(PBH_ID); } if (!string.IsNullOrEmpty(NDTC_ID)) { item.NDTC_ID = new Guid(NDTC_ID); } if (!string.IsNullOrEmpty(SoPhieu)) { item.SoPhieu = Convert.ToInt32(SoPhieu); } item.Thu = Convert.ToBoolean(Thu); item.Mota = Mota; if (IdNull) { item = ThuChiDal.Insert(item); #region log LogDal.log(item, new Log() { Checked = false , Info = string.Format("{1} thêm mới phiếu thu: {0}", item.Ma, Security.Username) , NgayTao = DateTime.Now , Username = Security.Username , PRowId = item.ID , PTen = item.Ma , RequestIp = Request.UserHostAddress , RawUrl = refUrl , LLOG_ID = 1 , Ten = "Thêm" }); #endregion } else { item = ThuChiDal.Update(item); #region log LogDal.log(item, new Log() { Checked = false , Info = string.Format("{1} sửa phiếu thu: {0}", item.Ma, Security.Username) , NgayTao = DateTime.Now , Username = Security.Username , PRowId = item.ID , PTen = item.Ma , RequestIp = Request.UserHostAddress , RawUrl = refUrl , LLOG_ID = 2 , Ten = "Sửa" }); #endregion } //SearchManager.Add(Ten, item.IndexNoiDung, item.IndexContent, Ten, item.ID.ToString(), item.Url, typeof(SuKien).Name); TimKiemDal.Add(item, item.ID); rendertext(item.ID.ToString()); } break; #endregion case "remove": #region Xóa if (Security.IsAuthenticated()) { var item = ThuChiDal.SelectById(new Guid(Id)); if (item.NguoiTao == Security.UserId) { ThuChiDal.DeleteById(new Guid(Id)); //SearchManager.Remove(Id); TimKiemDal.DeleteByPRowId(DAL.con(), item.ID); #region log LogDal.log(item, new Log() { Checked = false , Info = string.Format("{1} xóa thu: {0}", item.Ma, Security.Username) , NgayTao = DateTime.Now , Username = Security.Username , PRowId = item.ID , PTen = item.Ma , RequestIp = Request.UserHostAddress , RawUrl = refUrl , LLOG_ID = 3 , Ten = "Xóa" }); #endregion rendertext("1"); } else { rendertext("0"); } } break; #endregion default: break; } }
protected void Page_Load(object sender, EventArgs e) { var NDTC_ID = Request["NDTC_ID"]; var CQ_ID = Request["CQ_ID"]; var MaPhieu = Request["MaPhieu"]; var SoPhieu = Request["SoPhieu"]; var SoPhieuAll = Request["SoPhieuAll"]; var SoTien = Request["SoTien"]; var Mota = Request["Mota"]; var NgayTrenPhieu = Request["NgayTrenPhieu"]; var NgayTao = Request["NgayTao"]; var NguoiTao = Request["NguoiTao"]; var NgayCapNhat = Request["NgayCapNhat"]; var NguoiCapNhat = Request["NguoiCapNhat"]; var LoaiQuy = Request["LoaiQuy"]; var LoaiCandoi = Request["LoaiCandoi"]; var isCandoi = Request["isCandoi"]; var Thu = Request["Thu"]; var XN_ID = Request["XN_ID"]; var P_ID = Request["P_ID"]; var PDV_ID = Request["PDV_ID"]; var CTV_ID = Request["CTV_ID"]; var PGV_ID = Request["PGV_ID"]; var PBH_ID = Request["PBH_ID"]; var Xoa = Request["Xoa"]; var XoaAdm = Request["XoaAdm"]; XoaAdm = string.IsNullOrEmpty(XoaAdm) ? "false" : "true"; Xoa = string.IsNullOrEmpty(Xoa) ? "false" : "true"; var logged = Security.IsAuthenticated(); var Id = Request["ID"]; var IdNull = string.IsNullOrEmpty(Id); var refUrl = Request["refUrl"]; if (!string.IsNullOrEmpty(refUrl)) refUrl = Server.UrlDecode(refUrl); switch (subAct) { case "save": #region Thêm Thu chi if (logged) { var item = ThuChiDal.SelectById(new Guid(Id)); IdNull = item.ID == Guid.Empty; if (IdNull) { item = new ThuChi { ID = new Guid(Id), NgayTao = DateTime.Now, NguoiTao = Security.UserId, NguoiCapNhat = Security.UserId, NgayCapNhat = DateTime.Now }; } else { item.NgayCapNhat = DateTime.Now; item.NguoiCapNhat = Security.UserId; } item.isCandoi = false; if(!string.IsNullOrEmpty(LoaiQuy)) { item.LoaiQuy = Convert.ToInt32(LoaiQuy); } if (!string.IsNullOrEmpty(NgayTrenPhieu)) { item.NgayTrenPhieu = Convert.ToDateTime(NgayTrenPhieu, new CultureInfo("vi-vn")); } if(!string.IsNullOrEmpty(SoTien)) { item.SoTien = Convert.ToDouble(SoTien); } if (!string.IsNullOrEmpty(P_ID)) { item.P_ID = new Guid(P_ID); } if (!string.IsNullOrEmpty(PDV_ID)) { item.PDV_ID = new Guid(PDV_ID); } if (!string.IsNullOrEmpty(CTV_ID)) { item.CTV_ID = new Guid(CTV_ID); } if (!string.IsNullOrEmpty(PGV_ID)) { item.PGV_ID = new Guid(PGV_ID); } if (!string.IsNullOrEmpty(PBH_ID)) { item.PBH_ID = new Guid(PBH_ID); } if (!string.IsNullOrEmpty(NDTC_ID)) { item.NDTC_ID = new Guid(NDTC_ID); } if (!string.IsNullOrEmpty(SoPhieu)) { item.SoPhieu = Convert.ToInt32(SoPhieu); } item.Thu = Convert.ToBoolean(Thu); item.Mota = Mota; if (IdNull) { item = ThuChiDal.Insert(item); #region log LogDal.log(item, new Log() { Checked = false , Info = string.Format("{1} thêm mới phiếu thu: {0}", item.Ma, Security.Username) , NgayTao = DateTime.Now , Username = Security.Username , PRowId = item.ID , PTen = item.Ma , RequestIp = Request.UserHostAddress , RawUrl = refUrl , LLOG_ID = 1 , Ten = "Thêm" }); #endregion } else { item = ThuChiDal.Update(item); #region log LogDal.log(item, new Log() { Checked = false , Info = string.Format("{1} sửa phiếu thu: {0}", item.Ma, Security.Username) , NgayTao = DateTime.Now , Username = Security.Username , PRowId = item.ID , PTen = item.Ma , RequestIp = Request.UserHostAddress , RawUrl = refUrl , LLOG_ID = 2 , Ten = "Sửa" }); #endregion } //SearchManager.Add(Ten, item.IndexNoiDung, item.IndexContent, Ten, item.ID.ToString(), item.Url, typeof(SuKien).Name); TimKiemDal.Add(item, item.ID); rendertext(item.ID.ToString()); } break; #endregion case "remove": #region Xóa if (Security.IsAuthenticated()) { var item = ThuChiDal.SelectById(new Guid(Id)); if (item.NguoiTao == Security.UserId) { ThuChiDal.DeleteById(new Guid(Id)); //SearchManager.Remove(Id); TimKiemDal.DeleteByPRowId(DAL.con(), item.ID); #region log LogDal.log(item, new Log() { Checked = false , Info = string.Format("{1} xóa thu: {0}", item.Ma, Security.Username) , NgayTao = DateTime.Now , Username = Security.Username , PRowId = item.ID , PTen = item.Ma , RequestIp = Request.UserHostAddress , RawUrl = refUrl , LLOG_ID = 3 , Ten = "Xóa" }); #endregion rendertext("1"); } else { rendertext("0"); } } break; #endregion default: break; } }
protected void Page_Load(object sender, EventArgs e) { var id = Request["ID"]; var khId = Request["KH_ID"]; var pdvId = Request["PDV_ID"]; var ctvId = Request["CTV_ID"]; var pgvId = Request["PGV_ID"]; var pbhId = Request["PBH_ID"]; using (var con = DAL.con()) { if (string.IsNullOrEmpty(id)) { Item = ThuChiDal.SelectByDraff(con, true); Item.NguoiTao = Security.UserId; Item.NguoiTao_Ten = Security.Ten; if (khId!= null && khId.Length >= 36) { khId = khId.Substring(khId.LastIndexOf(',') + 1); var kh = KhachHangDal.SelectById(new Guid(khId), con); Item.P_Ten = kh.Ten; Item.P_ID = kh.ID; } if (pdvId != null && pdvId.Length >= 36) { pdvId = pdvId.Substring(pdvId.LastIndexOf(',') + 1); var pdv = PhieuDichVuDal.SelectById(con, new Guid(pdvId)); Item.PDV_ID = pdv.ID; Item.PDV_Ma = pdv.Ma; var kh = KhachHangDal.SelectById(pdv.KH_ID, con); Item.P_Ten = kh.Ten; Item.P_ID = kh.ID; } if (ctvId != null && ctvId.Length >= 36) { ctvId = ctvId.Substring(ctvId.LastIndexOf(',') + 1); var ctv = ChoThueVayDal.SelectById(con, new Guid(ctvId)); Item.CTV_ID = ctv.ID; Item.CTV_Ma = ctv.Ma; var kh = KhachHangDal.SelectById(ctv.KH_ID, con); Item.P_Ten = kh.Ten; Item.P_ID = kh.ID; } if (pgvId != null && pgvId.Length >= 36) { pgvId = pgvId.Substring(pgvId.LastIndexOf(',') + 1); var pgv = PhieuGiatVayDal.SelectById(con, new Guid(pgvId)); Item.PGV_ID = pgv.ID; Item.PGV_Ma = pgv.Ma; } if (pbhId != null && pbhId.Length >= 36) { pbhId = pbhId.Substring(pgvId.LastIndexOf(',') + 1); var pbh = PhieuBaoHongDal.SelectById(con, new Guid(pbhId)); Item.PBH_ID = pbh.ID; Item.PBH_Ma = pbh.Ma; } } else { Item = ThuChiDal.SelectById(con, new Guid(id)); } var listLoai = DanhMucDal.SelectByLDMMa(con, "NDTC-THU"); AddThu.ListLoai = listLoai; AddThu.Item = Item; } }
// POST api/values /// <summary> /// Them moi du lieu /// </summary> /// <param name="obj">Du lieu can them moi</param> /// <returns></returns> public long Post([FromBody] ThuChi obj) { long res = new ThuChiDAO().Insert(obj); return(res); }
protected void Page_Load(object sender, EventArgs e) { var id = Request["ID"]; var khId = Request["KH_ID"]; var pdvId = Request["PDV_ID"]; var ctvId = Request["CTV_ID"]; var pgvId = Request["PGV_ID"]; var pbhId = Request["PBH_ID"]; using (var con = DAL.con()) { if (string.IsNullOrEmpty(id)) { Item = ThuChiDal.SelectByDraff(con, true); if (khId != null && khId.Length >= 36) { khId = khId.Substring(khId.LastIndexOf(',') + 1); var kh = KhachHangDal.SelectById(new Guid(khId), con); Item.P_Ten = kh.Ten; Item.P_ID = kh.ID; } if (pdvId != null && pdvId.Length >= 36) { pdvId = pdvId.Substring(pdvId.LastIndexOf(',') + 1); var pdv = PhieuDichVuDal.SelectById(con, new Guid(pdvId)); Item.PDV_ID = pdv.ID; Item.PDV_Ma = pdv.Ma; var kh = KhachHangDal.SelectById(pdv.KH_ID, con); Item.P_Ten = kh.Ten; Item.P_ID = kh.ID; } if (ctvId != null && ctvId.Length >= 36) { ctvId = ctvId.Substring(ctvId.LastIndexOf(',') + 1); var ctv = ChoThueVayDal.SelectById(con, new Guid(ctvId)); Item.CTV_ID = ctv.ID; Item.CTV_Ma = ctv.Ma; var kh = KhachHangDal.SelectById(ctv.KH_ID, con); Item.P_Ten = kh.Ten; Item.P_ID = kh.ID; } if (pgvId != null && pgvId.Length >= 36) { pgvId = pgvId.Substring(pgvId.LastIndexOf(',') + 1); var pgv = PhieuGiatVayDal.SelectById(con, new Guid(pgvId)); Item.PGV_ID = pgv.ID; Item.PGV_Ma = pgv.Ma; } if (pbhId != null && pbhId.Length >= 36) { pbhId = pbhId.Substring(pgvId.LastIndexOf(',') + 1); var pbh = PhieuBaoHongDal.SelectById(con, new Guid(pbhId)); Item.PBH_ID = pbh.ID; Item.PBH_Ma = pbh.Ma; } } else { Item = ThuChiDal.SelectById(con, new Guid(id)); } var logoStr = DanhMucDal.SelectByMa("BAOCAO-HEADER-THUCHI", con).Description; InPhieuChi.LogoStr = logoStr; var listLoai = DanhMucDal.SelectByLDMMa(con, "NDTC-CHI"); InPhieuChi.ListLoai = listLoai; InPhieuChi.Item = Item; } }