private void lap_phieu() { if (!ControlUtility.ValidateControlEmpty(m_txt_so_phieu, m_dat_ngay_chung_tu, m_sle_khach_hang, m_sle_nhan_vien)) { XtraMessageBox.Show("Hoàn thiện dữ liệu trước", "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (!is_ok_lap_phieu) { XtraMessageBox.Show("Hoàn thiện dữ liệu trước", "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } var phieu_nhan_bh = new GD_PHIEU_NHAN_BAO_HANH() { SO_CHUNG_TU = m_txt_so_phieu.Text, NGAY_CHUNG_TU = m_dat_ngay_chung_tu.DateTime, ID_NHAN_VIEN_LIEN_QUAN = (long)m_sle_nhan_vien.EditValue, NGAY_NHAP_PHAN_MEM = DateTime.Now.Date, LAN_THU = (int)(m_txt_lan_bh.EditValue) + 1 }; BS_MAT_HANG.Instance.LapPhieuNhanBaoHanh(phieu_nhan_bh, m_txt_barcode.Text); var dlg = XtraMessageBox.Show("Lập phiếu thành công! Bạn muốn lập phiếu nhập mới?", "THÔNG BÁO", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (dlg == System.Windows.Forms.DialogResult.OK) { reset_nhan_hang(); reset_phieu_nhan_bao_hanh(); } else { Dispose(); } }
public void LapPhieuNhanBaoHanh(GD_PHIEU_NHAN_BAO_HANH phieu_nhan_bh, string barcode) { using (var uow = new UnitOfWork()) { uow.Repository <GD_PHIEU_NHAN_BAO_HANH>().Insert(phieu_nhan_bh); var entity = uow.Repository <GD_HANG>().GetManyQueryable(x => x.BARCODE == barcode).Single(); entity.ID_TRANG_THAI = Convert.ToInt64(ReadDataConfig.ReadByKey("GUI_BAO_HANH")); entity.SO_LAN_BAO_HANH = entity.SO_LAN_BAO_HANH + 1; uow.Save(); } }
public void LapPhieuNhanBaoHanh(GD_PHIEU_NHAN_BAO_HANH phieu_nhan_bh, string barcode) { using(var uow = new UnitOfWork()) { uow.Repository<GD_PHIEU_NHAN_BAO_HANH>().Insert(phieu_nhan_bh); var entity = uow.Repository<GD_HANG>().GetManyQueryable(x => x.BARCODE == barcode).Single(); entity.ID_TRANG_THAI = Convert.ToInt64(ReadDataConfig.ReadByKey("GUI_BAO_HANH")); entity.SO_LAN_BAO_HANH = entity.SO_LAN_BAO_HANH + 1; uow.Save(); } }
private void lap_phieu() { if(!ControlUtility.ValidateControlEmpty(m_txt_so_phieu, m_dat_ngay_chung_tu, m_sle_khach_hang, m_sle_nhan_vien)) { XtraMessageBox.Show("Hoàn thiện dữ liệu trước", "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if(!is_ok_lap_phieu) { XtraMessageBox.Show("Hoàn thiện dữ liệu trước", "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } var phieu_nhan_bh = new GD_PHIEU_NHAN_BAO_HANH() { SO_CHUNG_TU = m_txt_so_phieu.Text, NGAY_CHUNG_TU = m_dat_ngay_chung_tu.DateTime, ID_NHAN_VIEN_LIEN_QUAN = (long)m_sle_nhan_vien.EditValue, NGAY_NHAP_PHAN_MEM = DateTime.Now.Date, LAN_THU = (int) (m_txt_lan_bh.EditValue) + 1 }; BS_MAT_HANG.Instance.LapPhieuNhanBaoHanh(phieu_nhan_bh, m_txt_barcode.Text); var dlg = XtraMessageBox.Show("Lập phiếu thành công! Bạn muốn lập phiếu nhập mới?", "THÔNG BÁO", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if(dlg == System.Windows.Forms.DialogResult.OK) { reset_nhan_hang(); reset_phieu_nhan_bao_hanh(); } else { Dispose(); } }