コード例 #1
0
        public static bool NewAmountsReceived(AmountsReceived tb)
        {
            try
            {
                db = new UcasProEntities();
                db.Configuration.ProxyCreationEnabled = false;
                db.Configuration.LazyLoadingEnabled = false;
                db.AmountsReceiveds.Add(tb);
                db.SaveChanges();
                return true;

            }
            catch (Exception )
            {

                return false;
            }
        }
コード例 #2
0
        public static bool EditAmountsReceived(AmountsReceived tb)
        {
            try
            {
                db = new UcasProEntities();
                db.Configuration.LazyLoadingEnabled = false;
                db.Configuration.ProxyCreationEnabled = false;
                var q = db.AmountsReceiveds.Where(p => p.ID == tb.ID).SingleOrDefault();
                q.TheDonorsProjectID = tb.TheDonorsProjectID;
                q.Date = tb.Date;
                q.Cost = tb.Cost;


                db.SaveChanges();
                return true;

            }
            catch (Exception)
            {


                return false;
            }
        }