/// <summary> /// hàm thực hiện xóa thông tin của hiếu nhập chi tiết /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmdXoaPhieuNhap_Click(object sender, EventArgs e) { Utility.SetMsg(uiStatusBar2.Panels["MSG"], "", false); int IdPhieu = Utility.Int32Dbnull(grdList.GetValue(TPhieuNhapxuatthuoc.Columns.IdPhieu), -1); if (!InValiUpdateXoa()) { return; } if (Utility.AcceptQuestion(string.Format("Bạn có muốn xóa phiếu trả thuốc từ khoa nội trú về kho với mã phiếu {0}\n hay không?", IdPhieu), "Thông báo", true)) { ActionResult actionResult = new THUOC_NHAPKHO().XoaPhieuNhapKho(IdPhieu); switch (actionResult) { case ActionResult.Success: grdList.CurrentRow.Delete(); grdList.UpdateData(); m_dtDataNhapKho.AcceptChanges(); Utility.SetMsg(uiStatusBar2.Panels["MSG"], "Bạn xóa thông tin phiếu trả thuốc từ khoa nội trú về kho thành công", false); break; case ActionResult.Error: break; } } ModifyCommand(); }
/// <summary> /// hàm thực hiện xóa thông tin của hiếu nhập chi tiết /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmdXoaPhieuNhap_Click(object sender, EventArgs e) { int IdPhieu = Utility.Int32Dbnull(grdList.GetValue(TPhieuNhapxuatthuoc.Columns.IdPhieu), -1); string khoxuat = Utility.sDbnull(grdList.CurrentRow.Cells["ten_khoxuat"].Value, ""); string khonhap = Utility.sDbnull(grdList.CurrentRow.Cells["ten_khonhap"].Value, ""); if (!IsValid4UpdateDelete()) { return; } if (Utility.AcceptQuestion(string.Format("Bạn có chắc chắn muốn xóa thông tin phiếu chuyển kho với mã phiếu {0} hay không?", IdPhieu), "Thông báo", true)) { ActionResult actionResult = new THUOC_NHAPKHO().XoaPhieuNhapKho(IdPhieu); switch (actionResult) { case ActionResult.Success: grdList.CurrentRow.Delete(); grdList.UpdateData(); m_dtDataNhapKho.AcceptChanges(); THU_VIEN_CHUNG.Log(this.Name, globalVariables.UserName, string.Format( "Xóa phiếu chuyển kho tuyến huyện với số phiếu là :{0} - Từ kho {1} đến kho {2}", id_PhieuNhap, khoxuat, khonhap), action.Delete); Utility.ShowMsg("Bạn xóa thông tin phiếu chuyển kho thành công", "Thông báo", MessageBoxIcon.Information); break; case ActionResult.Error: break; } } ModifyCommand(); }
/// <summary> /// hàm thực hiện xóa thông tin của hiếu nhập chi tiết /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmdXoaPhieuNhap_Click(object sender, EventArgs e) { int IdPhieu = Utility.Int32Dbnull(grdList.GetValue(TPhieuNhapxuatthuoc.Columns.IdPhieu), -1); if (!InValiUpdateXoa()) { return; } if (Utility.AcceptQuestion(string.Format("Bạn có muốn xóa thông tin phiếu trả nhà cung cấp với Id: {0}?", IdPhieu), "Thông báo", true)) { Utility.SetMsg(uiStatusBar2.Panels["MSG"], "", true); ActionResult actionResult = new THUOC_NHAPKHO().XoaPhieuNhapKho(IdPhieu); switch (actionResult) { case ActionResult.Success: grdList.CurrentRow.Delete(); grdList.UpdateData(); m_dtDataNhapKho.AcceptChanges(); Utility.SetMsg(uiStatusBar2.Panels["MSG"], "Bạn xóa phiếu trả thành công", false); break; case ActionResult.Error: Utility.ShowMsg("Lỗi trong quá trình xóa thông tin của phiếu trả nhà cung cấp", "Thông báo lỗi", MessageBoxIcon.Error); break; } } ModifyCommand(); }
/// <summary> /// hàm thực hiện xóa thông tin của hiếu nhập chi tiết /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmdXoaPhieuNhap_Click(object sender, EventArgs e) { int IdPhieu = Utility.Int32Dbnull(grdList.GetValue(TPhieuNhapxuatthuoc.Columns.IdPhieu), -1); if (!IsValid4UpdateDelete()) { return; } if (Utility.AcceptQuestion(string.Format("Bạn có chắc chắn muốn xóa thông tin phiếu chuyển kho với mã phiếu {0} hay không?", IdPhieu), "Thông báo", true)) { ActionResult actionResult = new THUOC_NHAPKHO().XoaPhieuNhapKho(IdPhieu); switch (actionResult) { case ActionResult.Success: grdList.CurrentRow.Delete(); grdList.UpdateData(); m_dtDataNhapKho.AcceptChanges(); Utility.ShowMsg("Bạn xóa thông tin phiếu chuyển kho thành công", "Thông báo", MessageBoxIcon.Information); break; case ActionResult.Error: break; } } ModifyCommand(); }
public static void InphieuNhapkho(int IDPhieuNhap, string sTitleReport, DateTime NgayIn) { DataTable m_dtReport = new THUOC_NHAPKHO().Laythongtininphieunhapkhothuoc(IDPhieuNhap); if (m_dtReport.Rows.Count <= 0) { Utility.ShowMsg("Không tìm thấy thông tin ", "Thông báo", MessageBoxIcon.Warning); return; } THU_VIEN_CHUNG.CreateXML(m_dtReport, "thuoc_phieu_nhapkho.xml"); MoneyByLetter _moneyByLetter = new MoneyByLetter(); string tinhtong = TinhTong(m_dtReport, TPhieuNhapxuatthuocChitiet.ThanhTienColumn.ColumnName); string tieude = "", reportname = ""; var crpt = Utility.GetReport("thuoc_phieunhapkho", ref tieude, ref reportname); // VNS.HIS.UI.BaoCao.PhieuNhapKho.CRPT_PHIEU_NHAPKHO crpt =new CRPT_PHIEU_NHAPKHO(); var objForm = new frmPrintPreview(sTitleReport, crpt, true, m_dtReport.Rows.Count <= 0 ? false : true); Utility.UpdateLogotoDatatable(ref m_dtReport); try { m_dtReport.AcceptChanges(); crpt.SetDataSource(m_dtReport); ////crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + " PHÒNG TIẾP ĐÓN ".Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34); objForm.mv_sReportFileName = Path.GetFileName(reportname); objForm.mv_sReportCode = "thuoc_phieunhapkho"; Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name); Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name); Utility.SetParameterValue(crpt, "sMoneyLetter", _moneyByLetter.sMoneyToLetter(tinhtong)); Utility.SetParameterValue(crpt, "sCurrentDate", Utility.FormatDateTimeWithThanhPho(NgayIn)); Utility.SetParameterValue(crpt, "sTitleReport", tieude); Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition()); Utility.SetParameterValue(crpt, "txtTrinhky", Utility.getTrinhky(objForm.mv_sReportFileName, globalVariables.SysDate)); objForm.crptViewer.ReportSource = crpt; objForm.ShowDialog(); // Utility.DefaultNow(this); } catch (Exception ex) { if (globalVariables.IsAdmin) { Utility.ShowMsg(ex.ToString()); } } }