public void Update(long Id,short IdBacsi,int IdThuoc,int SoLuong,string SoluongDung,string SolanDung,string CachDung,string ChidanThem)
        {
            DmucChidanKedonthuoc item = new DmucChidanKedonthuoc();
            item.MarkOld();
            item.IsLoaded = true;

            item.Id = Id;

            item.IdBacsi = IdBacsi;

            item.IdThuoc = IdThuoc;

            item.SoLuong = SoLuong;

            item.SoluongDung = SoluongDung;

            item.SolanDung = SolanDung;

            item.CachDung = CachDung;

            item.ChidanThem = ChidanThem;

            item.Save(UserName);
        }
        public void Insert(short IdBacsi,int IdThuoc,int SoLuong,string SoluongDung,string SolanDung,string CachDung,string ChidanThem)
        {
            DmucChidanKedonthuoc item = new DmucChidanKedonthuoc();

            item.IdBacsi = IdBacsi;

            item.IdThuoc = IdThuoc;

            item.SoLuong = SoLuong;

            item.SoluongDung = SoluongDung;

            item.SolanDung = SolanDung;

            item.CachDung = CachDung;

            item.ChidanThem = ChidanThem;

            item.Save(UserName);
        }
        void cmdLuuchidan_Click(object sender, EventArgs e)
        {
            Utility.SetMsg(lblMsg, "", false);
            if (txtdrug.MyCode == "-1")
            {
                Utility.SetMsg(lblMsg, "Bạn cần chọn thuốc trước khi lưu chỉ dẫn dùng thuốc", true);
                txtdrug.Focus();
                return;
            }
            try
            {
                DmucChidanKedonthuoc objChidan = new Select().From(DmucChidanKedonthuoc.Schema).Where(DmucChidanKedonthuoc.Columns.IdThuoc).IsEqualTo(txtDrugID.Text)
                    .And(DmucChidanKedonthuoc.Columns.IdBacsi).IsEqualTo(globalVariables.gv_intIDNhanvien).ExecuteSingle<DmucChidanKedonthuoc>();
                if (objChidan == null)
                {

                    objChidan = new DmucChidanKedonthuoc();
                    objChidan.IsNew = true;
                }
                else
                {
                    objChidan.IsNew = false;
                    objChidan.MarkOld();
                }
                objChidan.IdBacsi = globalVariables.gv_intIDNhanvien;
                objChidan.IdThuoc = Utility.Int32Dbnull(txtdrug.MyID,-1);
                objChidan.SolanDung =Utility.DoTrim( txtSolan.Text);
                objChidan.SoluongDung = Utility.DoTrim(txtSoLuongDung.Text);
                objChidan.SoLuong = Utility.Int32Dbnull(Utility.DecimaltoDbnull(this.txtSoluong.Text, 0));
                objChidan.ChidanThem = Utility.DoTrim(txtChiDanThem.Text);
                objChidan.CachDung = Utility.DoTrim(txtCachDung.Text);
                objChidan.Save();
            }
            catch (Exception ex)
            {
                Utility.CatchException(ex);
            }
        }