コード例 #1
0
        public int UpdatetDiscountHead(tDiscountHead updatedisc, string[] conn)
        {
            BISPL_CRMDBEntities db = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn));

            db.tDiscountHeads.Attach(updatedisc);
            db.ObjectStateManager.ChangeObjectState(updatedisc, EntityState.Modified);
            db.SaveChanges();
            return(1);
        }
コード例 #2
0
        public int InserttDiscountHead(tDiscountHead disc, string[] conn)
        {
            BISPL_CRMDBEntities db = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn));

            //db.tDiscountHeads.AddObject(disc);
            db.AddTotDiscountHeads(disc);
            db.SaveChanges();
            return(Convert.ToInt32(disc.ID));
        }
コード例 #3
0
        /// <summary>
        /// GetDiscountListByID is providing List of DiscountList By ID for Edit mode
        /// </summary>
        /// <returns></returns>
        ///
        public tDiscountHead GetDiscountListByID(int discountId, string[] conn)
        {
            BISPL_CRMDBEntities db         = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn));
            tDiscountHead       ActivityID = new tDiscountHead();

            ActivityID = (from p in db.tDiscountHeads
                          where p.ID == discountId
                          select p).FirstOrDefault();

            db.Detach(ActivityID);
            return(ActivityID);
        }