public EmployeeController(IMemoryCache cache, LogisticsContext dbContext)
 {
     _cache             = cache;
     _dbContext         = dbContext;
     _employeeLogic     = new Lms_EmployeeLogic(_cache, new EntityFrameworkGenericRepository <Lms_EmployeePoco>(_dbContext));
     _employeeTypeLogic = new Lms_EmployeeTypeLogic(_cache, new EntityFrameworkGenericRepository <Lms_EmployeeTypePoco>(_dbContext));
 }
Beispiel #2
0
 public ConfigurationController(IMemoryCache cache, IHostingEnvironment hostingEnvironment, LogisticsContext dbContext)
 {
     _cache              = cache;
     _dbContext          = dbContext;
     _hostingEnvironment = hostingEnvironment;
     _configurationLogic = new Lms_ConfigurationLogic(_cache, new EntityFrameworkGenericRepository <Lms_ConfigurationPoco>(_dbContext));
 }
        public CustomerController(IMemoryCache cache, LogisticsContext dbContext)
        {
            _cache = cache;

            _dbContext     = dbContext;
            _customerLogic = new Lms_CustomerLogic(_cache, new EntityFrameworkGenericRepository <Lms_CustomerPoco>(_dbContext));
        }
 public HomeController(IMemoryCache cache, LogisticsContext dbContext)
 {
     _cache            = cache;
     _dbContext        = dbContext;
     _orderLogic       = new Lms_OrderLogic(_cache, new EntityFrameworkGenericRepository <Lms_OrderPoco>(_dbContext));
     _orderStatusLogic = new Lms_OrderStatusLogic(_cache, new EntityFrameworkGenericRepository <Lms_OrderStatusPoco>(_dbContext));
 }
 public CityController(IMemoryCache cache, LogisticsContext dbContext)
 {
     _dbContext     = dbContext;
     _cityLogic     = new App_CityLogic(cache, new EntityFrameworkGenericRepository <App_CityPoco>(_dbContext));
     _provinceLogic = new App_ProvinceLogic(cache, new EntityFrameworkGenericRepository <App_ProvincePoco>(_dbContext));
     _countryLogic  = new App_CountryLogic(cache, new EntityFrameworkGenericRepository <App_CountryPoco>(_dbContext));
 }
Beispiel #6
0
 public TariffController(IMemoryCache cache, IEmailService emailService, IHostingEnvironment hostingEnvironment, LogisticsContext dbContext)
 {
     _cache              = cache;
     _emailService       = emailService;
     _hostingEnvironment = hostingEnvironment;
     _dbContext          = dbContext;
     _tariffLogic        = new Lms_TariffLogic(_cache, new EntityFrameworkGenericRepository <Lms_TariffPoco>(_dbContext));
 }
Beispiel #7
0
 public TransactionController(IMemoryCache cache, LogisticsContext dbContext)
 {
     _cache                  = cache;
     _dbContext              = dbContext;
     _transactionLogic       = new Lms_TransactionLogic(_cache, new EntityFrameworkGenericRepository <Lms_TransactionPoco>(_dbContext));
     _transactionDetailLogic = new Lms_TransactionDetailLogic(_cache, new EntityFrameworkGenericRepository <Lms_TransactionDetailPoco>(_dbContext));
     _chartOfAccountLogic    = new Lms_ChartOfAccountLogic(_cache, new EntityFrameworkGenericRepository <Lms_ChartOfAccountPoco>(_dbContext));
 }
 public AddressController(IMemoryCache cache, LogisticsContext dbContext)
 {
     _cache         = cache;
     _dbContext     = dbContext;
     _addressLogic  = new Lms_AddressLogic(_cache, new EntityFrameworkGenericRepository <Lms_AddressPoco>(_dbContext));
     _cityLogic     = new App_CityLogic(_cache, new EntityFrameworkGenericRepository <App_CityPoco>(_dbContext));
     _provinceLogic = new App_ProvinceLogic(_cache, new EntityFrameworkGenericRepository <App_ProvincePoco>(_dbContext));
     _countryLogic  = new App_CountryLogic(_cache, new EntityFrameworkGenericRepository <App_CountryPoco>(_dbContext));
 }
Beispiel #9
0
 public ReportController(IMemoryCache cache, LogisticsContext dbContext)
 {
     _dbContext              = dbContext;
     _cache                  = cache;
     _orderLogic             = new Lms_OrderLogic(_cache, new EntityFrameworkGenericRepository <Lms_OrderPoco>(_dbContext));
     _customerLogic          = new Lms_CustomerLogic(_cache, new EntityFrameworkGenericRepository <Lms_CustomerPoco>(_dbContext));
     _addressLogic           = new Lms_CustomerAddressMappingLogic(_cache, new EntityFrameworkGenericRepository <Lms_CustomerAddressMappingPoco>(_dbContext));
     _invoiceLogic           = new Lms_InvoiceLogic(_cache, new EntityFrameworkGenericRepository <Lms_InvoicePoco>(_dbContext));
     _additionalServiceLogic = new Lms_OrderAdditionalServiceLogic(_cache, new EntityFrameworkGenericRepository <Lms_OrderAdditionalServicePoco>(_dbContext));
 }
Beispiel #10
0
        public MiscellaneousOrderController(IMemoryCache cache, IEmailService emailService, IHostingEnvironment hostingEnvironment, IHttpContextAccessor httpContext, LogisticsContext dbContext)
        {
            _cache              = cache;
            _dbContext          = dbContext;
            _emailService       = emailService;
            _hostingEnvironment = hostingEnvironment;
            _httpContext        = httpContext;

            _orderLogic       = new Lms_OrderLogic(_cache, new EntityFrameworkGenericRepository <Lms_OrderPoco>(_dbContext));
            _orderStatusLogic = new Lms_OrderStatusLogic(_cache, new EntityFrameworkGenericRepository <Lms_OrderStatusPoco>(_dbContext));
        }
        public ReportController(IMemoryCache cache, IHostingEnvironment hostingEnvironment, IHttpContextAccessor httpContext, LogisticsContext dbContext)
        {
            _dbContext          = dbContext;
            _cache              = cache;
            _hostingEnvironment = hostingEnvironment;
            _httpContext        = httpContext;

            _orderLogic             = new Lms_OrderLogic(_cache, new EntityFrameworkGenericRepository <Lms_OrderPoco>(_dbContext));
            _customerLogic          = new Lms_CustomerLogic(_cache, new EntityFrameworkGenericRepository <Lms_CustomerPoco>(_dbContext));
            _addressMappingLogic    = new Lms_CustomerAddressMappingLogic(_cache, new EntityFrameworkGenericRepository <Lms_CustomerAddressMappingPoco>(_dbContext));
            _addressLogic           = new Lms_AddressLogic(_cache, new EntityFrameworkGenericRepository <Lms_AddressPoco>(_dbContext));
            _invoiceLogic           = new Lms_InvoiceLogic(_cache, new EntityFrameworkGenericRepository <Lms_InvoicePoco>(_dbContext));
            _additionalServiceLogic = new Lms_OrderAdditionalServiceLogic(_cache, new EntityFrameworkGenericRepository <Lms_OrderAdditionalServicePoco>(_dbContext));
            _paymentMethodLogic     = new Lms_PaymentMethodLogic(_cache, new EntityFrameworkGenericRepository <Lms_PaymentMethodPoco>(_dbContext));
            _paymentCollectionLogic = new Lms_InvoicePaymentCollectionLogic(_cache, new EntityFrameworkGenericRepository <Lms_InvoicePaymentCollectionPoco>(_dbContext));

            _cityLogic     = new App_CityLogic(_cache, new EntityFrameworkGenericRepository <App_CityPoco>(_dbContext));
            _provinceLogic = new App_ProvinceLogic(_cache, new EntityFrameworkGenericRepository <App_ProvincePoco>(_dbContext));
            _countryLogic  = new App_CountryLogic(_cache, new EntityFrameworkGenericRepository <App_CountryPoco>(_dbContext));
            _bankLogic     = new Lms_BankLogic(_cache, new EntityFrameworkGenericRepository <Lms_BankPoco>(_dbContext));
        }
 public ActionResult Login(Admin admin)
 {
     using (LogisticsContext db = new LogisticsContext())
     {
         try
         {
             var myadmin = db.AdminTable.Single(a => a.Username == admin.Username && a.Password == admin.Password);
             if (myadmin != null)
             {
                 Session["AdminId"]   = myadmin.AdminId.ToString();
                 Session["AdminName"] = myadmin.Name.ToString();
                 return(RedirectToAction("Index"));
             }
         }
         catch (Exception)
         {
             ModelState.AddModelError("", "");
         }
     }
     return(View());
 }
        public SearchController(IMemoryCache cache, IEmailService emailService, IHostingEnvironment hostingEnvironment, IHttpContextAccessor httpContext, LogisticsContext dbContext)
        {
            _cache              = cache;
            _dbContext          = dbContext;
            _emailService       = emailService;
            _hostingEnvironment = hostingEnvironment;
            _httpContext        = httpContext;

            _orderLogic    = new Lms_OrderLogic(_cache, new EntityFrameworkGenericRepository <Lms_OrderPoco>(_dbContext));
            _customerLogic = new Lms_CustomerLogic(_cache, new EntityFrameworkGenericRepository <Lms_CustomerPoco>(_dbContext));
            _addressLogic  = new Lms_AddressLogic(_cache, new EntityFrameworkGenericRepository <Lms_AddressPoco>(_dbContext));
            _employeeLogic = new Lms_EmployeeLogic(_cache, new EntityFrameworkGenericRepository <Lms_EmployeePoco>(_dbContext));

            _cityLogic     = new App_CityLogic(_cache, new EntityFrameworkGenericRepository <App_CityPoco>(_dbContext));
            _provinceLogic = new App_ProvinceLogic(_cache, new EntityFrameworkGenericRepository <App_ProvincePoco>(_dbContext));
            _countryLogic  = new App_CountryLogic(_cache, new EntityFrameworkGenericRepository <App_CountryPoco>(_dbContext));

            _unitTypeLogic    = new Lms_UnitTypeLogic(_cache, new EntityFrameworkGenericRepository <Lms_UnitTypePoco>(_dbContext));
            _weightScaleLogic = new Lms_WeightScaleLogic(_cache, new EntityFrameworkGenericRepository <Lms_WeightScalePoco>(_dbContext));

            _deliveryOptionLogic   = new Lms_DeliveryOptionLogic(_cache, new EntityFrameworkGenericRepository <Lms_DeliveryOptionPoco>(_dbContext));
            _vehicleTypeScaleLogic = new Lms_VehicleTypeLogic(_cache, new EntityFrameworkGenericRepository <Lms_VehicleTypePoco>(_dbContext));
        }
Beispiel #14
0
 public DocumentTypeController(IMemoryCache cache, LogisticsContext dbContext)
 {
     _dbContext         = dbContext;
     _documentTypeLogic = new App_DocumentTypeLogic(_cache, new EntityFrameworkGenericRepository <App_DocumentTypePoco>(_dbContext));
 }
 public BaseRepository(LogisticsContext context)
 {
     Context = context ?? throw new ArgumentNullException(nameof(context));
 }
 public StorageOrderDeliveryController(IMemoryCache cache, LogisticsContext dbContext)
 {
     _dbContext = dbContext;
     _storageOrderDeliveryLogic = new Lms_StorageOrderDeliveryLogic(_cache, new EntityFrameworkGenericRepository <Lms_StorageOrderDeliveryPoco>(_dbContext));
 }
 public AddressTypeController(IMemoryCache cache, LogisticsContext dbContext)
 {
     _dbContext        = dbContext;
     _addressTypeLogic = new Lms_AddressTypeLogic(_cache, new EntityFrameworkGenericRepository <Lms_AddressTypePoco>(_dbContext));
 }
 public BankController(IMemoryCache cache, LogisticsContext dbContext)
 {
     _dbContext = dbContext;
     _bankLogic = new Lms_BankLogic(_cache, new EntityFrameworkGenericRepository <Lms_BankPoco>(_dbContext));
 }
Beispiel #19
0
 public CreditsController(IMemoryCache cache, LogisticsContext dbContext)
 {
     _dbContext = dbContext;
 }
 public EmployeeTimesheetController(IMemoryCache cache, LogisticsContext dbContext)
 {
     _dbContext = dbContext;
     _employeeTimesheetLogic = new Lms_EmployeeTimesheetLogic(_cache, new EntityFrameworkGenericRepository <Lms_EmployeeTimesheetPoco>(_dbContext));
 }
Beispiel #21
0
 public LoginController(LogisticsContext dbContext)
 {
     _dbContext = dbContext;
     _userLogic = new App_UserLogic(new EntityFrameworkGenericRepository <App_UserPoco>(_dbContext));
 }
 public TransactionController(IMemoryCache cache, LogisticsContext dbContext)
 {
     _dbContext        = dbContext;
     _transactionLogic = new Lms_TransactionLogic(_cache, new EntityFrameworkGenericRepository <Lms_TransactionPoco>(_dbContext));
 }
Beispiel #23
0
        /// <summary>
        /// 生成运货单
        /// </summary>
        /// <param name="code">货物id</param>
        /// <param name="truckId">卡车id</param>
        /// <returns></returns>
        public async Task <bool> ToWayBill(string code, Guid truckId)
        {
            //查询状态是否正确--->修改订单中的状态--->生成waybill--->生成waybillLink
            bool  flag = true;
            Order order;

            using (var orderservice = new OrderService())
            {
                order = orderservice.GetAll().Where(p => p.BarCode == code).FirstOrDefault();
                if (order == null || order.Status != "2")
                {
                    flag = false;
                }
            }

            if (flag)
            {
                var context = new LogisticsContext();

                using (var transaction = context.Database.BeginTransaction())
                {
                    try
                    {
                        //修改订单的状态
                        order.Status = "3";
                        context.Entry(order).State = EntityState.Modified;
                        await context.SaveChangesAsync();

                        //创建waybill
                        WayBill wayBill = new WayBill()
                        {
                            FinishTime = DateTime.Now,
                            PlanPath   = "NULL"
                        };
                        context.Set <WayBill>().Add(wayBill);
                        await context.SaveChangesAsync();

                        //创建truck waybill联系
                        WaybillTransportLink transportLink = new WaybillTransportLink()
                        {
                            TransportInfoId = truckId,
                            WayBillId       = wayBill.Id
                        };
                        context.Set <WaybillTransportLink>().Add(transportLink);
                        await context.SaveChangesAsync();

                        //创建order waybill联系
                        OrderWaybillLink orderWaybillLink = new OrderWaybillLink()
                        {
                            OrderId   = order.Id,
                            WaybillId = wayBill.Id
                        };
                        context.Set <OrderWaybillLink>().Add(orderWaybillLink);
                        await context.SaveChangesAsync();

                        transaction.Commit();
                    }
                    catch (Exception errer)
                    {
                        transaction.Rollback();
                        flag = false;
                        throw errer;
                    }
                    finally
                    {
                        context.Dispose();
                    }
                }
            }

            return(flag);
        }
 public UserController(IMemoryCache cache, LogisticsContext dbContext)
 {
     _cache     = cache;
     _dbContext = dbContext;
     _userLogic = new App_UserLogic(new EntityFrameworkGenericRepository <App_UserPoco>(_dbContext));
 }
 public WeightScaleController(IMemoryCache cache, LogisticsContext dbContext)
 {
     _dbContext        = dbContext;
     _weightScaleLogic = new Lms_WeightScaleLogic(_cache, new EntityFrameworkGenericRepository <Lms_WeightScalePoco>(_dbContext));
 }
Beispiel #26
0
 public ProvinceController(IMemoryCache cache, LogisticsContext dbContext)
 {
     _cache         = cache;
     _dbContext     = dbContext;
     _provinceLogic = new App_ProvinceLogic(_cache, new EntityFrameworkGenericRepository <App_ProvincePoco>(_dbContext));
 }
 public AdditionalServiceController(IMemoryCache cache, LogisticsContext dbContext)
 {
     _cache     = cache;
     _dbContext = dbContext;
     _additionalServiceLogic = new Lms_AdditionalServiceLogic(_cache, new EntityFrameworkGenericRepository <Lms_AdditionalServicePoco>(_dbContext));
 }
Beispiel #28
0
 public DeliveryOptionController(IMemoryCache cache, LogisticsContext dbContext)
 {
     _dbContext           = dbContext;
     _deliveryOptionLogic = new Lms_DeliveryOptionLogic(_cache, new EntityFrameworkGenericRepository <Lms_DeliveryOptionPoco>(_dbContext));
 }
Beispiel #29
0
 public OrderDocumentController(IMemoryCache cache, LogisticsContext dbContext)
 {
     _dbContext          = dbContext;
     _orderDocumentLogic = new Lms_OrderDocumentLogic(_cache, new EntityFrameworkGenericRepository <Lms_OrderDocumentPoco>(_dbContext));
 }
Beispiel #30
0
 public InvoiceStorageOrderMappingController(IMemoryCache cache, LogisticsContext dbContext)
 {
     _dbContext = dbContext;
     _invoiceStorageOrderMappingLogic = new Lms_InvoiceStorageOrderMappingLogic(_cache, new EntityFrameworkGenericRepository <Lms_InvoiceStorageOrderMappingPoco>(_dbContext));
 }