Example #1
0
        public WrapperPartyType CreateSinglePartyType(PartyTypeENT UserProfile)
        {
            WrapperPartyType data = new WrapperPartyType();

            data.PartyType = new PartyTypeCRUD().CreateSingle(UserProfile);
            return(data);
        }
Example #2
0
        public PartyTypeENT SelectSingle(int Id)
        {
            NbkDbEntities dbcontext = new NbkDbEntities();
            PartyType     Obj       = dbcontext.PartyType.Where(x => x.Id == Id).FirstOrDefault();
            PartyTypeENT  Data      = new PartyTypeENT()
            {
                Id        = Obj.Id,
                Name      = Obj.Name,
                IsDefault = Obj.IsDefault
            };

            return(Data);
        }
Example #3
0
        public PartyTypeENT CreateSingle(PartyTypeENT Obj)
        {
            NbkDbEntities dbcontext = new NbkDbEntities();
            PartyType     Data      = new PartyType()
            {
                Name      = Obj.Name,
                IsDefault = Obj.IsDefault
            };


            dbcontext.PartyType.Add(Data);
            dbcontext.SaveChanges();

            Obj.Id = Data.Id;

            return(Obj);
        }
Example #4
0
        public PartyTypeENT UpdateSelectSingle(PartyTypeENT Obj)
        {
            NbkDbEntities dbcontext = new NbkDbEntities();
            PartyType     Data      = new PartyType()
            {
                Id        = Obj.Id,
                Name      = Obj.Name,
                IsDefault = Obj.IsDefault
            };


            dbcontext.PartyType.Attach(Data);
            var update = dbcontext.Entry(Data);

            update.Property(x => x.Name).IsModified      = true;
            update.Property(x => x.IsDefault).IsModified = true;

            dbcontext.SaveChanges();

            return(Obj);
        }