本文整理汇总了C#中Janus.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# Janus.Delete方法的具体用法?C# Janus.Delete怎么用?C# Janus.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Janus
的用法示例。
在下文中一共展示了Janus.Delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveDetail
private void RemoveDetail(Janus.Windows.GridEX.GridEXRow gridExRow)
{
try
{
string manhacungcap = "";
string NgayHethan = "";
DateTime dtmNgayHethan = DateTime.Now;
string solo = "";
int id_thuoc = -1;
decimal dongia = 0m;
decimal Giaban = 0m;
decimal GiaBhyt = 0m;
Int32 soluong = 0;
decimal vat = 0m;
int isHetHan = 0;
long IdThuockho = 0;
DateTime NgayNhap = DateTime.Now;
NgayNhap = Convert.ToDateTime(gridExRow.Cells[TPhieuNhapxuatthuocChitiet.Columns.NgayNhap].Value).Date;
dtmNgayHethan = Convert.ToDateTime(gridExRow.Cells[TPhieuNhapxuatthuocChitiet.Columns.NgayHethan].Value).Date;
NgayHethan = Utility.sDbnull(gridExRow.Cells["NGAY_HET_HAN"].Value);
solo = Utility.sDbnull(gridExRow.Cells[TPhieuNhapxuatthuocChitiet.Columns.SoLo].Value);
id_thuoc = Utility.Int32Dbnull(gridExRow.Cells[TThuockho.Columns.IdThuoc].Value, -1);
IdThuockho = Utility.Int32Dbnull(gridExRow.Cells[TThuockho.Columns.IdChuyen].Value, -1);
dongia = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.GiaNhap].Value, 0);
GiaBhyt = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.GiaBhyt].Value, 0);
Giaban = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.GiaBan].Value, 0);
soluong = Utility.Int32Dbnull(gridExRow.Cells["SO_LUONG"].Value, 0);
vat = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.Vat].Value, 0);
isHetHan = Utility.Int32Dbnull(gridExRow.Cells["IsHetHan"].Value, 0);
manhacungcap = Utility.sDbnull(gridExRow.Cells[TThuockho.Columns.MaNhacungcap].Value, 0);
DataRow[] arrDr = m_dtDataThuocKho.Select(TPhieuNhapxuatthuocChitiet.Columns.IdThuockho + "=" + IdThuockho.ToString());
if (arrDr.Length <= 0)
{
DataRow drv = m_dtDataThuocKho.NewRow();
drv[TPhieuNhapxuatthuocChitiet.Columns.IdThuoc] = id_thuoc;
drv["ten_donvitinh"] = Utility.sDbnull(gridExRow.Cells["ten_donvitinh"].Value);
drv["IsHetHan"] = isHetHan;
DmucThuoc objLDrug = DmucThuoc.FetchByID(id_thuoc);
if (objLDrug != null)
{
drv[DmucThuoc.Columns.TenThuoc] = Utility.sDbnull(objLDrug.TenThuoc);
drv[DmucThuoc.Columns.HamLuong] = Utility.sDbnull(objLDrug.HamLuong);
drv[DmucThuoc.Columns.HoatChat] = Utility.sDbnull(objLDrug.HoatChat);
drv[DmucThuoc.Columns.NuocSanxuat] = Utility.sDbnull(objLDrug.NuocSanxuat);
drv[DmucThuoc.Columns.HangSanxuat] = Utility.sDbnull(objLDrug.HangSanxuat);
}
drv[TPhieuNhapxuatthuocChitiet.Columns.Vat] = vat;
drv[TPhieuNhapxuatthuocChitiet.Columns.GiaBhyt] = GiaBhyt;
drv[TPhieuNhapxuatthuocChitiet.Columns.NgayNhap] = NgayNhap;
drv[TPhieuNhapxuatthuocChitiet.Columns.GiaNhap] = dongia;
drv[TPhieuNhapxuatthuocChitiet.Columns.DonGia] = dongia;
drv[TPhieuNhapxuatthuocChitiet.Columns.MaNhacungcap] = manhacungcap;
drv[TPhieuNhapxuatthuocChitiet.Columns.SoLo] = solo;
drv[TPhieuNhapxuatthuocChitiet.Columns.SoDky] = Utility.sDbnull(gridExRow.Cells[TPhieuNhapxuatthuocChitiet.Columns.SoDky].Value);
drv[TPhieuNhapxuatthuocChitiet.Columns.SoQdinhthau] = Utility.sDbnull(gridExRow.Cells[TPhieuNhapxuatthuocChitiet.Columns.SoQdinhthau].Value);
drv[TPhieuNhapxuatthuocChitiet.Columns.IdThuockho] = IdThuockho;
drv[TPhieuNhapxuatthuocChitiet.Columns.GiaBan] = Giaban;
drv[TPhieuNhapxuatthuocChitiet.Columns.SluongChia] = Utility.Int32Dbnull(gridExRow.Cells[DmucThuoc.Columns.SluongChia].Value, 0); ;
drv[TPhieuNhapxuatthuocChitiet.Columns.SoLuong] = soluong;
drv[TPhieuNhapxuatthuocChitiet.Columns.ThanhTien] = dongia * soluong;
drv[TPhieuNhapxuatthuocChitiet.Columns.ChietKhau] = 0;
drv["NGAY_HET_HAN"] = NgayHethan;
drv[TPhieuNhapxuatthuocChitiet.Columns.NgayHethan] = dtmNgayHethan;
drv[TPhieuNhapxuatthuocChitiet.Columns.IdPhieu] = -1;
m_dtDataThuocKho.Rows.Add(drv);
}
else
{
arrDr[0]["SO_LUONG"] = Utility.Int32Dbnull(arrDr[0]["SO_LUONG"]) + soluong;
//arrDr[0]["SO_LUONG_THAT"] = Utility.Int32Dbnull(arrDr[0]["SO_LUONG"],0) + Utility.Int32Dbnull(arrDr[0]["sLuongAo"], 0);
m_dtDataThuocKho.AcceptChanges();
}
gridExRow.Delete();
grdPhieuXuatChiTiet.UpdateData();
grdPhieuXuatChiTiet.Refresh();
m_dtDataPhieuChiTiet.AcceptChanges();
m_dtDataThuocKho.AcceptChanges();
ModifyCommand();
}
catch (Exception ex)
{
Utility.ShowMsg("Lỗi khi hủy chuyển thuốc:\n" + ex.Message);
}
}
示例2: RemoveDetail
private void RemoveDetail(Janus.Windows.GridEX.GridEXRow gridExRow)
{
try
{
gridExRow.Delete();
grdPhieuXuatChiTiet.UpdateData();
grdPhieuXuatChiTiet.Refresh();
m_dtDataPhieuChiTiet.AcceptChanges();
ModifyCommand();
}
catch (Exception ex)
{
Utility.ShowMsg("Lỗi khi trả trả thuốc:\n" + ex.Message);
}
}