Пример #1
0
        public async Task <AppSupply> AddSupplyInfo(AppSupply supply)
        {
            if (db != null)
            {
                supply.AppSupplyId = Guid.NewGuid();
                supply.CreatedDate = DateTime.Now;
                await db.AppSupply.AddAsync(supply);

                await db.SaveChangesAsync();

                return(supply);
            }

            return(supply);
        }
        public async Task <AppCompany> AddCompany(AppCompany company)
        {
            if (db != null)
            {
                company.AppCompanyId = Guid.NewGuid();
                company.CreatedDate  = DateTime.Now;
                await db.AppCompany.AddAsync(company);

                await db.SaveChangesAsync();

                return(company);
            }

            return(company);
        }
        public async Task <AppActivity> AddActivity(AppActivity activity)
        {
            if (db != null)
            {
                activity.AppActivityId = Guid.NewGuid();
                activity.CreatedDate   = DateTime.Now;
                await db.AppActivity.AddAsync(activity);

                await db.SaveChangesAsync();

                return(activity);
            }

            return(activity);
        }
Пример #4
0
        public async Task <AppFreight> AddFreight(AppFreight freight)
        {
            if (db != null)
            {
                freight.AppFreightId = Guid.NewGuid();
                freight.CreatedDate  = DateTime.Now;
                await db.AppFreight.AddAsync(freight);

                await db.SaveChangesAsync();

                return(freight);
            }

            return(freight);
        }
Пример #5
0
        public async Task <AppUitemplate> AddTemplateUIInfo(AppUitemplate templateInfo)
        {
            if (db != null)
            {
                templateInfo.AppUitemplateId = Guid.NewGuid();
                templateInfo.CreatedDate     = DateTime.Now;
                await db.AppUitemplate.AddAsync(templateInfo);

                await db.SaveChangesAsync();

                return(templateInfo);
            }

            return(templateInfo);
        }
        public async Task <AppCategory> AddCategory(AppCategory category)
        {
            if (db != null)
            {
                category.AppCategoryId = Guid.NewGuid();
                category.CreatedDate   = DateTime.Now;
                await db.AppCategory.AddAsync(category);

                await db.SaveChangesAsync();

                return(category);
            }

            return(category);
        }
        public async Task <AppProduct> AddProduct(AppProduct product)
        {
            if (db != null)
            {
                product.AppProductId = Guid.NewGuid();
                product.CreatedDate  = DateTime.Now;
                await db.AppProduct.AddAsync(product);

                await db.SaveChangesAsync();

                return(product);
            }

            return(product);
        }
Пример #8
0
        public async Task <AppBrand> AddBrand(AppBrand brand)
        {
            if (db != null)
            {
                brand.AppBrandId  = Guid.NewGuid();
                brand.CreatedDate = DateTime.Now;
                await db.AppBrand.AddAsync(brand);

                await db.SaveChangesAsync();

                return(brand);
            }

            return(brand);
        }
Пример #9
0
        public async Task <AppDemand> AddProductDemand(AppDemand demand)
        {
            if (db != null)
            {
                demand.AppDemandId = Guid.NewGuid();
                demand.CreatedDate = DateTime.Now;
                await db.AppDemand.AddAsync(demand);

                await db.SaveChangesAsync();

                return(demand);
            }

            return(demand);
        }
        public async Task <AppBuyer> AddBuyer(AppBuyer buyer)
        {
            if (db != null)
            {
                await db.AppBuyer.AddAsync(buyer);

                await db.SaveChangesAsync();

                return(buyer);
            }

            return(buyer);
        }
        public async Task <AppUserRole> AddUserRole(AppUserRole userRole)
        {
            if (userRole != null)
            {
                userRole.AppUserRoleId = Guid.NewGuid();
                userRole.CreatedDate   = DateTime.Now;
                await db.AppUserRole.AddAsync(userRole);

                await db.SaveChangesAsync();
            }
            return(userRole);
        }
Пример #12
0
        public async Task <AppGroundLogistics> AddGroundLogistics(AppGroundLogistics groundLogistics)
        {
            if (db != null)
            {
                groundLogistics.AppGroundLogisticId = Guid.NewGuid();
                groundLogistics.CreatedDate         = DateTime.Now;

                await db.AppGroundLogistics.AddAsync(groundLogistics);

                await db.SaveChangesAsync();

                return(groundLogistics);
            }

            return(groundLogistics);
        }