本文整理汇总了C#中Janus.EndEdit方法的典型用法代码示例。如果您正苦于以下问题:C# Janus.EndEdit方法的具体用法?C# Janus.EndEdit怎么用?C# Janus.EndEdit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Janus
的用法示例。
在下文中一共展示了Janus.EndEdit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddDetail
private void AddDetail(Janus.Windows.GridEX.GridEXRow gridExRow)
{
try
{
string manhacungcap = "";
string NgayHethan = "";
DateTime dtmNgayHethan = DateTime.Now;
DateTime NgayNhap = DateTime.Now;
string solo = "";
int id_thuoc = -1;
decimal dongia = 0m;
decimal Giaban = 0m;
decimal GiaBhyt = 0m;
Int32 soluongchuyen = 0;
decimal vat = 0m;
int isHetHan = 0;
long IdThuockho = 0;
int soluongthat = 0;
int tongsoluongchuyen = 0;
tongsoluongchuyen = 0;
int soluongao = Utility.Int32Dbnull(gridExRow.Cells["sLuongAo"].Value,0);
soluongthat = Utility.Int32Dbnull(gridExRow.Cells["SO_LUONG_THAT"].Value);
soluongchuyen = Utility.Int32Dbnull(gridExRow.Cells["SO_LUONG_CHUYEN"].Value, 0);
if (soluongchuyen > 0)
{
NgayHethan = Utility.sDbnull(gridExRow.Cells["NGAY_HET_HAN"].Value);
dtmNgayHethan = Convert.ToDateTime(gridExRow.Cells[TPhieuNhapxuatthuocChitiet.Columns.NgayHethan].Value).Date;
NgayNhap = Convert.ToDateTime(gridExRow.Cells[TPhieuNhapxuatthuocChitiet.Columns.NgayNhap].Value).Date;
solo = Utility.sDbnull(gridExRow.Cells[TPhieuNhapxuatthuocChitiet.Columns.SoLo].Value);
id_thuoc = Utility.Int32Dbnull(gridExRow.Cells[TThuockho.Columns.IdThuoc].Value, -1);
dongia = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.GiaNhap].Value, 0);
Giaban = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.GiaBan].Value, 0);
GiaBhyt = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.GiaBhyt].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);
IdThuockho = Utility.Int32Dbnull(gridExRow.Cells[TThuockho.Columns.IdThuockho].Value, -1);
DataRow[] arrDr = m_dtDataPhieuChiTiet.Select(TPhieuNhapxuatthuocChitiet.Columns.IdChuyen + "=" + IdThuockho.ToString());
if (arrDr.Length <= 0)
{
DataRow drv = m_dtDataPhieuChiTiet.NewRow();
drv[TPhieuNhapxuatthuocChitiet.Columns.MotaThem] = String.Empty;
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.GiaPhuthuDungtuyen] = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.PhuthuDungtuyen].Value, 0);
drv[TPhieuNhapxuatthuocChitiet.Columns.GiaPhuthuTraituyen] = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.PhuthuTraituyen].Value, 0);
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.IdChuyen] = IdThuockho;
drv[TPhieuNhapxuatthuocChitiet.Columns.SoLuong] = soluongchuyen;
drv[TPhieuNhapxuatthuocChitiet.Columns.ThanhTien] = dongia * soluongchuyen;
drv[TPhieuNhapxuatthuocChitiet.Columns.ChietKhau] = 0;
drv[TPhieuNhapxuatthuocChitiet.Columns.SluongChia] = Utility.Int32Dbnull(gridExRow.Cells[DmucThuoc.Columns.SluongChia].Value, 0);
drv["NGAY_HET_HAN"] = NgayHethan;
drv[TPhieuNhapxuatthuocChitiet.Columns.NgayHethan] = dtmNgayHethan;
drv[TPhieuNhapxuatthuocChitiet.Columns.IdPhieu] = -1;
tongsoluongchuyen = soluongchuyen;
m_dtDataPhieuChiTiet.Rows.Add(drv);
}
else
{
arrDr[0]["SO_LUONG"] = Utility.Int32Dbnull(arrDr[0]["SO_LUONG"]) + soluongchuyen;
tongsoluongchuyen = Utility.Int32Dbnull(arrDr[0]["SO_LUONG"]);
m_dtDataPhieuChiTiet.AcceptChanges();
}
//Update lại dữ liệu từ kho xuất
gridExRow.BeginEdit();
gridExRow.Cells["SO_LUONG"].Value = soluongthat - tongsoluongchuyen - soluongao;
gridExRow.Cells["SO_LUONG_CHUYEN"].Value = 0;
gridExRow.IsChecked = false;
gridExRow.EndEdit();
}
grdKhoXuat.UpdateData();
m_dtDataThuocKho.AcceptChanges();
//UpdateWhenChanged();
//.........这里部分代码省略.........