Exemplo n.º 1
0
 private void Luu()
 {
     try
     {
         PSDotChuanDoan dot = new PSDotChuanDoan();
         dot.RowIDBNCanTheoDoi = long.Parse(this.txtRowIDBenhNhanNguyCo.Text.Trim());
         dot.MaBenhNhan        = "";
         dot.MaKhachHang       = "";
         dot.NgayChanDoan      = DateTime.Now;
         dot.ChanDoan          = this.txtChanDoan.Text;
         dot.GhiChu            = this.txtGhiChu.Text;
         dot.KetQua            = this.txtKetQua.Text;
         dot.rowIDDotChanDoan  = string.IsNullOrEmpty(this.txtRowIDDotKham.Text) == true ? 0 : long.Parse(this.txtRowIDDotKham.Text);
         var result = BioNet_Bus.InsertDotChanDoan(dot);
         if (result.Result)
         {
             MessageBox.Show("Lưu thành công!", "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             this.btnLuu.Enabled = false;
             this.Reset();
             this.btnMoi.Enabled = true;
             this.LoadListTreeView();
             this.LoadGCKQChiTiet(); this.LoadGCKQChiTietCu();
         }
         else
         {
             MessageBox.Show("Lưu không thành công! \r\n Lỗi chi tiết : " + result.StringError, "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }catch (Exception ex)
     {
         MessageBox.Show("Lỗi khi lưu! \r\n Lỗi chi tiết : " + ex.ToString(), "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Exemplo n.º 2
0
        public static PsReponse UpdateDotChuanDoan(PSDotChuanDoan dcd)
        {
            PsReponse res = new PsReponse();

            try
            {
                ProcessDataSync cn = new ProcessDataSync();
                db = cn.db;
                db.Connection.Open();
                db.Transaction = db.Connection.BeginTransaction();
                var dv = db.PSDotChuanDoans.FirstOrDefault(p => p.MaBenhNhan == dcd.MaBenhNhan && p.MaKhachHang == dcd.MaKhachHang);
                if (dv != null)
                {
                    dv.isDongBo = true;
                    db.SubmitChanges();
                }
                db.Transaction.Commit();
                db.Connection.Close();
                res.Result = true;
            }
            catch (Exception ex)
            {
                db.Transaction.Rollback();
                db.Connection.Close();
                res.Result      = false;
                res.StringError = ex.ToString();
            }
            return(res);
        }