Ejemplo n.º 1
0
        public async Task <int> UpdateBasicMemberAsync(Member member, int memberNo)
        {
            var updateMember = await(from a in CreditContext.Member
                                     where a.MemberNo == memberNo
                                     select a).SingleOrDefaultAsync();

            if (updateMember != null)
            {
                updateMember.MemberNo      = member.MemberNo;
                updateMember.RegionNo      = member.RegionNo;
                updateMember.LastName      = member.LastName;
                updateMember.Middleinitial = member.Middleinitial;
                updateMember.FirstName     = member.FirstName;
                updateMember.Street        = member.Street;
                updateMember.City          = member.City;
                updateMember.StateProv     = member.StateProv;
                updateMember.PhoneNo       = member.PhoneNo;
                updateMember.IssueDt       = DateTime.Now;
                member.MailCode            = "33333";
                member.Country             = "US";
                updateMember.ExprDt        = DateTime.Now.AddYears(3);

                CreditContext.Update(updateMember);
                return(1);
            }
            else
            {
                return(-1);
            }
        }
        public async Task <int> UpdateRegionAsync(Region region, int regionNo)
        {
            var updateRegion = await(from a in CreditContext.Region
                                     where a.RegionNo == regionNo
                                     select a).SingleOrDefaultAsync();

            if (updateRegion != null)
            {
                updateRegion.RegionNo   = region.RegionNo;
                updateRegion.RegionName = region.RegionName;
                updateRegion.Street     = region.Street;
                updateRegion.City       = region.City;
                updateRegion.StateProv  = region.StateProv;
                updateRegion.PhoneNo    = region.PhoneNo;
                updateRegion.MailCode   = "33333";
                updateRegion.Country    = region.Country;

                CreditContext.Update(updateRegion);
                return(1);
            }
            else
            {
                return(-1);
            }
        }
        public async Task <int> UpdateProviderAsync(Provider provider, int providerNo)
        {
            var updateProvider = await(from a in CreditContext.Provider
                                       where a.ProviderNo == providerNo
                                       select a).SingleOrDefaultAsync();

            if (updateProvider != null)
            {
                updateProvider.RegionNo     = provider.RegionNo;
                updateProvider.ProviderNo   = provider.ProviderNo;
                updateProvider.ProviderName = provider.ProviderName;
                updateProvider.Street       = provider.Street;
                updateProvider.City         = provider.City;
                updateProvider.StateProv    = provider.StateProv;
                updateProvider.PhoneNo      = provider.PhoneNo;
                updateProvider.MailCode     = "33333";
                updateProvider.IssueDt      = DateTime.Now;
                updateProvider.Country      = provider.Country;
                updateProvider.ProviderCode = provider.ProviderCode;

                CreditContext.Update(updateProvider);
                return(1);
            }
            else
            {
                return(-1);
            }
        }
Ejemplo n.º 4
0
        public async Task <int> UpdateCorporationAsync(Corporation corp, int corpNo)
        {
            var updateCorp = await(from a in CreditContext.Corporation
                                   where a.CorpNo == corpNo
                                   select a).SingleOrDefaultAsync();

            if (updateCorp != null)
            {
                updateCorp.CorpNo    = corp.CorpNo;
                updateCorp.CorpName  = corp.CorpName;
                updateCorp.RegionNo  = corp.RegionNo;
                updateCorp.Street    = corp.Street;
                updateCorp.City      = corp.City;
                updateCorp.StateProv = corp.StateProv;
                updateCorp.PhoneNo   = corp.PhoneNo;
                updateCorp.MailCode  = "33333";
                updateCorp.Country   = corp.Country;
                updateCorp.ExprDt    = DateTime.Now.AddYears(5);

                CreditContext.Update(updateCorp);
                return(1);
            }
            else
            {
                return(-1);
            }
        }
        public async Task <int> UpdateCategoryAsync(Category category, int categoryNo)
        {
            var updateCategory = await CreditContext.Category.SingleOrDefaultAsync(m => m.CategoryNo == categoryNo);

            if (updateCategory != null)
            {
                updateCategory.CategoryNo   = category.CategoryNo;
                updateCategory.CategoryDesc = category.CategoryDesc;
                updateCategory.CategoryCode = category.CategoryCode;

                CreditContext.Update(updateCategory);
                return(1);
            }
            else
            {
                return(-1);
            }
        }