Beispiel #1
0
        public ActionResult CHOT_CAPPHAT(List <int> lstIDDonthuoc, DateTime Ngay_Chot)
        {
            int          v_intResult;
            ActionResult actResult;

            try
            {
                using (var scope = new TransactionScope())
                {
                    using (var dbscope = new SharedDbConnectionScope())
                    {
                        TLichsuChotthuoc _newItem = new TLichsuChotthuoc();
                        _newItem.NgayChot  = Ngay_Chot;
                        _newItem.NguoiChot = globalVariables.UserName;
                        _newItem.IsNew     = true;
                        _newItem.Save();
                        object obj = TLichsuChotthuoc.CreateQuery().GetMax("ID_CHOT");
                        TPhieuXuatthuocBenhnhanCollection vCollection = new TPhieuXuatthuocBenhnhanCollection();
                        v_intResult = new Update(TPhieuXuatthuocBenhnhan.Schema.TableName).Set(TPhieuXuatthuocBenhnhan.NgayChotColumn).EqualTo(Ngay_Chot)
                                      .Set(TPhieuXuatthuocBenhnhan.IdChotColumn).EqualTo(Utility.Int32Dbnull(obj, -1))
                                      .Where(TPhieuXuatthuocBenhnhan.NgayChotColumn).IsNull()
                                      .And(TPhieuXuatthuocBenhnhan.IdDonthuocColumn).In(lstIDDonthuoc)
                                      .Execute();
                    }
                    scope.Complete();
                    return(ActionResult.Success);
                }
            }
            catch (Exception ex)
            {
                Utility.ShowMsg("Lỗi:\n" + ex.ToString());
                return(ActionResult.Error);
            }
        }
Beispiel #2
0
        public TPhieuXuatthuocBenhnhanCollection FetchByQuery(Query qry)
        {
            TPhieuXuatthuocBenhnhanCollection coll = new TPhieuXuatthuocBenhnhanCollection();

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Beispiel #3
0
 public ActionResult CHOT_CAPPHAT(List<int> lstIDDonthuoc, DateTime Ngay_Chot)
 {
     int v_intResult;
     ActionResult actResult;
     try
     {
         using (var scope = new TransactionScope())
         {
             using (var dbscope = new SharedDbConnectionScope())
             {
                 TLichsuChotthuoc _newItem = new TLichsuChotthuoc();
                 _newItem.NgayChot = Ngay_Chot;
                 _newItem.NguoiChot = globalVariables.UserName;
                 _newItem.IsNew = true;
                 _newItem.Save();
                 object obj = TLichsuChotthuoc.CreateQuery().GetMax("ID_CHOT");
                 TPhieuXuatthuocBenhnhanCollection vCollection = new TPhieuXuatthuocBenhnhanCollection();
                 v_intResult = new Update(TPhieuXuatthuocBenhnhan.Schema.TableName).Set(TPhieuXuatthuocBenhnhan.NgayChotColumn).EqualTo(Ngay_Chot)
                         .Set(TPhieuXuatthuocBenhnhan.IdChotColumn).EqualTo(Utility.Int32Dbnull(obj, -1))
                         .Where(TPhieuXuatthuocBenhnhan.NgayChotColumn).IsNull()
                         .And(TPhieuXuatthuocBenhnhan.IdDonthuocColumn).In(lstIDDonthuoc)
                         .Execute();
             }
             scope.Complete();
             return ActionResult.Success;
         }
     }
     catch (Exception ex)
     {
         Utility.ShowMsg("Lỗi:\n" + ex.ToString());
         return ActionResult.Error;
     }
 }
 public TPhieuXuatthuocBenhnhanCollection FetchAll()
 {
     TPhieuXuatthuocBenhnhanCollection coll = new TPhieuXuatthuocBenhnhanCollection();
     Query qry = new Query(TPhieuXuatthuocBenhnhan.Schema);
     coll.LoadAndCloseReader(qry.ExecuteReader());
     return coll;
 }
Beispiel #5
0
        public TPhieuXuatthuocBenhnhanCollection FetchAll()
        {
            TPhieuXuatthuocBenhnhanCollection coll = new TPhieuXuatthuocBenhnhanCollection();
            Query qry = new Query(TPhieuXuatthuocBenhnhan.Schema);

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Beispiel #6
0
        public TPhieuXuatthuocBenhnhanCollection FetchByID(object IdPhieu)
        {
            TPhieuXuatthuocBenhnhanCollection coll = new TPhieuXuatthuocBenhnhanCollection().Where("id_phieu", IdPhieu).Load();

            return(coll);
        }
 public TPhieuXuatthuocBenhnhanCollection FetchByQuery(Query qry)
 {
     TPhieuXuatthuocBenhnhanCollection coll = new TPhieuXuatthuocBenhnhanCollection();
     coll.LoadAndCloseReader(qry.ExecuteReader());
     return coll;
 }
 public TPhieuXuatthuocBenhnhanCollection FetchByID(object IdPhieu)
 {
     TPhieuXuatthuocBenhnhanCollection coll = new TPhieuXuatthuocBenhnhanCollection().Where("id_phieu", IdPhieu).Load();
     return coll;
 }