Example #1
0
        public ActionResult OutStockEndDifferences()
        {
            string strErrText;

            //创建Model
            OutWarehouseBillViewModel model = new OutWarehouseBillViewModel();
            model.CreateTime = DateTime.Now.ToString("yyyy-MM-dd");

            model.Goods = new List<OutWarehouseBillGoodsViewModel>();
            model.Goods.Add(new OutWarehouseBillGoodsViewModel());

            //生成国家下拉列表项
            DDSystem dd = new DDSystem();
            List<Country> listCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listCountry == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListCountry = new List<SelectListItem>();
            selectListCountry.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCountry.AddRange(from c in listCountry
                                       select new SelectListItem
                                       {
                                           Text = c.Name,
                                           Value = c.Name
                                       });
            ViewData["Countrys"] = new SelectList(selectListCountry, "Value", "Text", model.ReceiverCountry);

            //生成省份下拉列表项
            List<Province> listState = null;
            if (!string.IsNullOrEmpty(model.ReceiverCountry))
            {
                listState = dd.LoadProvincesByCountry(model.ReceiverCountry, LoginAccountId, LoginStaffName, out strErrText);
                if (listState == null)
                {
                    throw new Exception(strErrText);
                }
            }
            else
            {
                listState = new List<Province>();
            }
            List<SelectListItem> selectListState = new List<SelectListItem>();
            selectListState.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListState.AddRange(from p in listState
                                     select new SelectListItem
                                     {
                                         Text = p.Name,
                                         Value = p.Name
                                     });
            ViewData["Provinces"] = new SelectList(selectListState, "Value", "Text", model.ReceiverProvince);

            //生成城市下拉列表项
            List<City> listCity = null;
            if (!string.IsNullOrEmpty(model.ReceiverProvince))
            {
                listCity = dd.LoadCitysByProvince(model.ReceiverCountry, model.ReceiverProvince, LoginAccountId, LoginStaffName, out strErrText);
                if (listCity == null)
                {
                    throw new Exception(strErrText);
                }
            }
            else
            {
                listCity = new List<City>();
            }
            List<SelectListItem> selectListCity = new List<SelectListItem>();
            selectListCity.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCity.AddRange(from ci in listCity
                                    select new SelectListItem
                                    {
                                        Text = ci.Name,
                                        Value = ci.Name
                                    });
            ViewData["Citys"] = new SelectList(selectListCity, "Value", "Text", model.ReceiverCity);

            //生成仓库下拉列表项
            List<Warehouse> listWarehouse = dd.LoadWarehouses(LoginAccountId, LoginStaffName, out strErrText);
            if (listWarehouse == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListWarehouse = new List<SelectListItem>();
            selectListWarehouse.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListWarehouse.AddRange(from w in listWarehouse
                                         select new SelectListItem
                                         {
                                             Text = w.Name,
                                             Value = w.Name
                                         });
            ViewData["Warehouses"] = new SelectList(selectListWarehouse, "Value", "Text", model.Warehouse);

            return View(model);
        }
Example #2
0
        public ActionResult OutWarehouse(string id)
        {
            string strErrText;

            //创建Model
            OutWarehouseBillViewModel model = new OutWarehouseBillViewModel();

            if (id != null && id != string.Empty)
            {
                //读取出库单数据
                StockSystem stock = new StockSystem();
                OutWarehouseBill data = stock.LoadOutWarehouseBill(long.Parse(id), LoginAccountId, LoginStaffName, out strErrText);
                if (data == null)
                {
                    throw new Exception(strErrText);
                }

                model.Id = data.Id;
                model.BillNo = data.BillNo;
                model.PlanId = data.PlanId;
                model.CustomerId = data.CustomerId;
                model.CustomerName = data.CustomerName;
                model.DeliveryNo = data.DeliveryNo;
                model.OutType = data.OutType;
                model.ReceiverName = data.ReceiverName;
                model.ReceiverCountry = data.ReceiverCountry;
                model.ReceiverProvince = data.ReceiverProvince;
                model.ReceiverCity = data.ReceiverCity;
                model.ReceiverAddress = data.ReceiverAddress;
                model.ReceiverContact = data.ReceiverContact;
                model.ReceiverContactTel = data.ReceiverContactTel;
                model.ReceiveType = data.ReceiveType;
                model.CarNo = data.CarNo;
                model.TrailerNo = data.TrailerNo;
                model.CarrierId = data.CarrierId;
                model.CarrierName = data.CarrierName;
                model.PayerId = data.PayerId;
                model.PayerName = data.PayerName;
                model.IsConsigning = data.IsConsigning;
                model.ConsignedDeliveryNo = data.ConsignedDeliveryNo;
                model.Warehouse = data.Warehouse;
                model.LoadingForceFeePrice = data.LoadingForceFeePrice;
                model.ForceFee = data.ForceFee;
                model.Remark = data.Remark;
                model.CreateTime = data.CreateTime.ToString("yyyy-MM-dd");
            }
            else
            {
                model.CreateTime = DateTime.Now.ToString("yyyy-MM-dd");
            }

            model.Goods = new List<OutWarehouseBillGoodsViewModel>();
            model.Goods.Add(new OutWarehouseBillGoodsViewModel());

            //生成国家下拉列表项
            DDSystem dd = new DDSystem();
            List<Country> listCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listCountry == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListCountry = new List<SelectListItem>();
            selectListCountry.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCountry.AddRange(from c in listCountry
                                       select new SelectListItem
                                       {
                                           Text = c.Name,
                                           Value = c.Name
                                       });
            ViewData["Countrys"] = new SelectList(selectListCountry, "Value", "Text", model.ReceiverCountry);

            //生成省份下拉列表项
            List<Province> listState = null;
            if (!string.IsNullOrEmpty(model.ReceiverCountry))
            {
                listState = dd.LoadProvincesByCountry(model.ReceiverCountry, LoginAccountId, LoginStaffName, out strErrText);
                if (listState == null)
                {
                    throw new Exception(strErrText);
                }
            }
            else
            {
                listState = new List<Province>();
            }
            List<SelectListItem> selectListState = new List<SelectListItem>();
            selectListState.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListState.AddRange(from p in listState
                                     select new SelectListItem
                                     {
                                         Text = p.Name,
                                         Value = p.Name
                                     });
            ViewData["Provinces"] = new SelectList(selectListState, "Value", "Text", model.ReceiverProvince);

            //生成城市下拉列表项
            List<City> listCity = null;
            if (!string.IsNullOrEmpty(model.ReceiverProvince))
            {
                listCity = dd.LoadCitysByProvince(model.ReceiverCountry, model.ReceiverProvince, LoginAccountId, LoginStaffName, out strErrText);
                if (listCity == null)
                {
                    throw new Exception(strErrText);
                }
            }
            else
            {
                listCity = new List<City>();
            }
            List<SelectListItem> selectListCity = new List<SelectListItem>();
            selectListCity.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCity.AddRange(from ci in listCity
                                    select new SelectListItem
                                    {
                                        Text = ci.Name,
                                        Value = ci.Name
                                    });
            ViewData["Citys"] = new SelectList(selectListCity, "Value", "Text", model.ReceiverCity);

            //生成仓库下拉列表项
            List<Warehouse> listWarehouse = dd.LoadWarehouses(LoginAccountId, LoginStaffName, out strErrText);
            if (listWarehouse == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListWarehouse = new List<SelectListItem>();
            selectListWarehouse.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListWarehouse.AddRange(from w in listWarehouse
                                         select new SelectListItem
                                         {
                                             Text = w.Name,
                                             Value = w.Name
                                         });
            ViewData["Warehouses"] = new SelectList(selectListWarehouse, "Value", "Text", model.Warehouse);

            return View(model);
        }
Example #3
0
        public ActionResult SetTransportLimitedPrice()
        {
            string strErrText;

            //生成国家下拉列表项
            DDSystem dd = new DDSystem();
            List<Country> listCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listCountry == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListCountry = new List<SelectListItem>();
            selectListCountry.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCountry.AddRange(from c in listCountry
                                       select new SelectListItem
                                       {
                                           Text = c.Name,
                                           Value = c.Name
                                       });
            ViewData["Countrys"] = new SelectList(selectListCountry, "Value", "Text");

            //生成空的省份下拉列表项
            List<Province> listState = new List<Province>();
            List<SelectListItem> selectListState = new List<SelectListItem>();
            selectListState.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListState.AddRange(from s in listState
                                     select new SelectListItem
                                     {
                                         Text = s.Name,
                                         Value = s.Name
                                     });
            ViewData["Provinces"] = new SelectList(selectListState, "Value", "Text");

            //生成空的城市下拉列表项
            List<City> listCity = new List<City>();
            List<SelectListItem> selectListCity = new List<SelectListItem>();
            selectListCity.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCity.AddRange(from ci in listCity
                                    select new SelectListItem
                                    {
                                        Text = ci.Name,
                                        Value = ci.Name
                                    });
            ViewData["Citys"] = new SelectList(selectListCity, "Value", "Text");

            return View();
        }
Example #4
0
        public JsonResult LoadCountrys(string term)
        {
            //读取所有国家数据
            string strErrText = string.Empty;
            DDSystem dd = new DDSystem();
            List<Country> listCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listCountry == null)
            {
                listCountry = new List<Country>();
            }

            //提取国家名称中包含关键字的记录
            var ret = (from c in listCountry
                       where c.Name.Contains(term)
                       select c.Name).ToArray();

            return Json(ret, JsonRequestBehavior.AllowGet);
        }
Example #5
0
        public ActionResult NewProvince()
        {
            string strErrText;

            //生成国家下拉列表项
            DDSystem dd = new DDSystem();
            List<Country> listCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listCountry == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListCountry = new List<SelectListItem>();
            selectListCountry.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCountry.AddRange(from c in listCountry
                                       select new SelectListItem
                                       {
                                           Text = c.Name,
                                           Value = c.Name
                                       });
            ViewData["Countries"] = new SelectList(selectListCountry, "Value", "Text");

            //创建空的Model
            ProvinceViewModel model = new ProvinceViewModel();

            return View(model);
        }
Example #6
0
        public ActionResult ModifyPaperPlan(string id)
        {
            string strErrText;

            //读取计划数据
            PlanSystem plan = new PlanSystem();
            DeliverPlan data = plan.LoadDeliverPlan(long.Parse(id), LoginAccountId, LoginStaffName, out strErrText);
            if (data == null)
            {
                throw new Exception(strErrText);
            }

            //创建Model
            PaperPlanViewModel model = new PaperPlanViewModel();
            model.Id = data.Id;
            model.CustomerId = data.CustomerId;
            model.CustomerName = data.CustomerName;
            model.ShipmentNo = data.ShipmentNo;
            model.DeliveryNo = data.DeliveryNo;
            model.DeliverType = data.DeliverType;
            model.ReceiverName = data.ReceiverName;
            model.ReceiverCountry = data.ReceiverCountry;
            model.ReceiverProvince = data.ReceiverProvince;
            model.ReceiverCity = data.ReceiverCity;
            model.ReceiverAddress = data.ReceiverAddress;
            model.ReceiverContact = data.ReceiverContact;
            model.ReceiverContactTel = data.ReceiverContactTel;
            model.OrderNo = data.OrderNo;
            model.ReceiveType = data.ReceiveType;
            model.CarNo = data.CarNo;
            model.TrailerNo = data.TrailerNo;
            model.DriverName = data.DriverName;
            model.DriverLicenseNo = data.DriverLicenseNo;
            model.DriverMobileTel = data.DriverMobileTel;
            model.DriverHomeTel = data.DriverHomeTel;
            model.ArrivalTime = data.ArrivalTime;
            model.PayerId = data.PayerId;
            model.PayerName = data.PayerName;
            model.IsConsigning = data.IsConsigning;
            model.ConsignedDeliveryNo = data.ConsignedDeliveryNo;
            model.IsInstalment = data.IsInstalment;
            model.StartCountry = data.StartCountry;
            model.StartProvince = data.StartProvince;
            model.StartCity = data.StartCity;
            model.Remark = data.Remark;
            model.CreateTime = data.CreateTime.ToString("yyyy-MM-dd");

            model.Goods = new List<PaperPlanGoodsViewModel>();
            model.Goods.Add(new PaperPlanGoodsViewModel());

            //生成讫点国家下拉列表项
            DDSystem dd = new DDSystem();
            List<Country> listDestCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listDestCountry == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListDestCountry = new List<SelectListItem>();
            selectListDestCountry.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListDestCountry.AddRange(from c in listDestCountry
                                           select new SelectListItem
                                           {
                                               Text = c.Name,
                                               Value = c.Name
                                           });
            ViewData["DestCountrys"] = new SelectList(selectListDestCountry, "Value", "Text", model.ReceiverCountry);

            //生成讫点省份下拉列表项
            List<Province> listDestProvince = null;
            if (!string.IsNullOrEmpty(model.ReceiverCountry))
            {
                listDestProvince = dd.LoadProvincesByCountry(model.ReceiverCountry, LoginAccountId, LoginStaffName, out strErrText);
                if (listDestProvince == null)
                {
                    throw new Exception(strErrText);
                }
            }
            else
            {
                listDestProvince = new List<Province>();
            }
            List<SelectListItem> selectListDestProvince = new List<SelectListItem>();
            selectListDestProvince.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListDestProvince.AddRange(from p in listDestProvince
                                            select new SelectListItem
                                            {
                                                Text = p.Name,
                                                Value = p.Name
                                            });
            ViewData["DestProvinces"] = new SelectList(selectListDestProvince, "Value", "Text", model.ReceiverProvince);

            //生成讫点城市下拉列表项
            List<City> listDestCity = null;
            if (!string.IsNullOrEmpty(model.ReceiverProvince))
            {
                listDestCity = dd.LoadCitysByProvince(model.ReceiverCountry, model.ReceiverProvince, LoginAccountId, LoginStaffName, out strErrText);
                if (listDestCity == null)
                {
                    throw new Exception(strErrText);
                }
            }
            else
            {
                listDestCity = new List<City>();
            }
            List<SelectListItem> selectListDestCity = new List<SelectListItem>();
            selectListDestCity.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListDestCity.AddRange(from ci in listDestCity
                                        select new SelectListItem
                                        {
                                            Text = ci.Name,
                                            Value = ci.Name
                                        });
            ViewData["DestCitys"] = new SelectList(selectListDestCity, "Value", "Text", model.ReceiverCity);

            //生成起点国家下拉列表项
            List<Country> listStartCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listStartCountry == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListStartCountry = new List<SelectListItem>();
            selectListStartCountry.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListStartCountry.AddRange(from c in listStartCountry
                                            select new SelectListItem
                                            {
                                                Text = c.Name,
                                                Value = c.Name
                                            });
            ViewData["StartCountrys"] = new SelectList(selectListStartCountry, "Value", "Text", model.StartCountry);

            //生成起点省份下拉列表项
            List<Province> listStartProvince = null;
            if (!string.IsNullOrEmpty(model.StartCountry))
            {
                listStartProvince = dd.LoadProvincesByCountry(model.StartCountry, LoginAccountId, LoginStaffName, out strErrText);
                if (listStartProvince == null)
                {
                    throw new Exception(strErrText);
                }
            }
            else
            {
                listStartProvince = new List<Province>();
            }
            List<SelectListItem> selectListStartProvince = new List<SelectListItem>();
            selectListStartProvince.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListStartProvince.AddRange(from p in listStartProvince
                                             select new SelectListItem
                                             {
                                                 Text = p.Name,
                                                 Value = p.Name
                                             });
            ViewData["StartProvinces"] = new SelectList(selectListStartProvince, "Value", "Text", model.StartProvince);

            //生成起点城市下拉列表项
            List<City> listStartCity = null;
            if (!string.IsNullOrEmpty(model.StartProvince))
            {
                listStartCity = dd.LoadCitysByProvince(model.StartCountry, model.StartProvince, LoginAccountId, LoginStaffName, out strErrText);
                if (listStartCity == null)
                {
                    throw new Exception(strErrText);
                }
            }
            else
            {
                listStartCity = new List<City>();
            }
            List<SelectListItem> selectListStartCity = new List<SelectListItem>();
            selectListStartCity.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListStartCity.AddRange(from ci in listStartCity
                                         select new SelectListItem
                                         {
                                             Text = ci.Name,
                                             Value = ci.Name
                                         });
            ViewData["StartCitys"] = new SelectList(selectListStartCity, "Value", "Text", model.StartCity);

            return View(model);
        }
Example #7
0
        public ActionResult ModifyReceiver(string id)
        {
            string strErrText;

            //生成Model数据
            DDSystem dd = new DDSystem();
            Receiver data = dd.LoadReceiver(long.Parse(id), LoginAccountId, LoginStaffName, out strErrText);
            if (data == null)
            {
                throw new Exception(strErrText);
            }

            ReceiverViewModel model = new ReceiverViewModel();
            model.Id = data.Id;
            model.Name = data.Name;
            model.Country = data.Country;
            model.Province = data.Province;
            model.City = data.City;
            model.Address = data.Address;
            model.Contact = data.Contact;
            model.ContactTel = data.ContactTel;

            model.Distances = new List<ReceiverDistanceViewModel>();
            model.Distances.Add(new ReceiverDistanceViewModel());

            //生成国家下拉列表项
            List<Country> listCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listCountry == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListCountry = new List<SelectListItem>();
            selectListCountry.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCountry.AddRange(from c in listCountry
                                       select new SelectListItem
                                       {
                                           Text = c.Name,
                                           Value = c.Name
                                       });
            ViewData["Countrys"] = new SelectList(selectListCountry, "Value", "Text", model.Country);

            //生成空的省份下拉列表项
            List<Province> listState = null;
            if (!string.IsNullOrEmpty(model.Country))
            {
                listState = dd.LoadProvincesByCountry(model.Country, LoginAccountId, LoginStaffName, out strErrText);
                if (listState == null)
                {
                    throw new Exception(strErrText);
                }
            }
            else
            {
                listState = new List<Province>();
            }
            List<SelectListItem> selectListState = new List<SelectListItem>();
            selectListState.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListState.AddRange(from s in listState
                                     select new SelectListItem
                                     {
                                         Text = s.Name,
                                         Value = s.Name
                                     });
            ViewData["Provinces"] = new SelectList(selectListState, "Value", "Text", model.Province);

            //生成空的城市下拉列表项
            List<City> listCity = null;
            if (!string.IsNullOrEmpty(model.Province))
            {
                listCity = dd.LoadCitysByProvince(model.Country, model.Province, LoginAccountId, LoginStaffName, out strErrText);
                if (listCity == null)
                {
                    throw new Exception(strErrText);
                }
            }
            else
            {
                listCity = new List<City>();
            }
            List<SelectListItem> selectListCity = new List<SelectListItem>();
            selectListCity.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCity.AddRange(from ci in listCity
                                    select new SelectListItem
                                    {
                                        Text = ci.Name,
                                        Value = ci.Name
                                    });
            ViewData["Citys"] = new SelectList(selectListCity, "Value", "Text", model.City);

            return View(model);
        }
Example #8
0
        public ActionResult ModifyCity(string id)
        {
            string strErrText;

            //生成Model数据
            DDSystem city = new DDSystem();
            City data = city.LoadCity(long.Parse(id), LoginAccountId, LoginStaffName, out strErrText);
            if (data == null)
            {
                throw new Exception(strErrText);
            }

            CityViewModel model = new CityViewModel();
            model.Id = data.Id;
            model.Name = data.Name;
            model.CountryName = data.CountryName;
            model.ProvinceName = data.ProvinceName;
            model.Remark = data.Remark;

            //生成国家下拉列表项
            DDSystem dd = new DDSystem();
            List<Country> listCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listCountry == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListCountry = new List<SelectListItem>();
            selectListCountry.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCountry.AddRange(from c in listCountry
                                       select new SelectListItem
                                       {
                                           Text = c.Name,
                                           Value = c.Name
                                       });
            ViewData["Countries"] = new SelectList(selectListCountry, "Value", "Text", model.CountryName);

            //生成空的省份下拉列表项
            List<Province> listState = null;
            if (!string.IsNullOrEmpty(model.CountryName))
            {
                listState = dd.LoadProvincesByCountry(model.CountryName, LoginAccountId, LoginStaffName, out strErrText);
                if (listState == null)
                {
                    throw new Exception(strErrText);
                }
            }
            else
            {
                listState = new List<Province>();
            }
            List<SelectListItem> selectListState = new List<SelectListItem>();
            selectListState.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListState.AddRange(from s in listState
                                     select new SelectListItem
                                     {
                                         Text = s.Name,
                                         Value = s.Name
                                     });
            ViewData["States"] = new SelectList(selectListState, "Value", "Text", model.ProvinceName);

            return View(model);
        }
Example #9
0
        public ActionResult ModifyCustomer(string id)
        {
            string strErrText;

            //生成Model数据
            CustomerSystem customer = new CustomerSystem();
            Customer data = customer.LoadCustomer(long.Parse(id), LoginAccountId, LoginStaffName, out strErrText);
            if (data == null)
            {
                throw new Exception(strErrText);
            }

            CustomerViewModel model = new CustomerViewModel();
            model.Id = data.Id;
            model.Name = data.Name;
            model.FullName = data.FullName;
            model.WarningStock = data.WarningStock;
            model.StopStock = data.StopStock;
            model.SettlementExpression = data.SettlementExpression;
            model.ValuationMode = data.ValuationMode;
            model.GrossWeightRate = data.GrossWeightRate.ToString("#0.######");
            model.OwnOrganId = data.OwnOrganId;
            model.Remark = data.Remark;

            model.TransportPrices = new List<CustomerTransportPriceViewModel>();
            model.TransportPrices.Add(new CustomerTransportPriceViewModel());

            model.ForceFeePrices = new List<CustomerForceFeePriceViewModel>();
            model.ForceFeePrices.Add(new CustomerForceFeePriceViewModel());

            model.StorageFeePrices = new List<CustomerStorageFeePriceViewModel>();
            model.StorageFeePrices.Add(new CustomerStorageFeePriceViewModel());

            //生成所属组织部门下拉列表项
            OrganizationSystem organ = new OrganizationSystem();
            List<Organization> listOrgan = organ.LoadOrganizations(LoginAccountId, LoginStaffName, out strErrText);
            if (listOrgan == null)
            {
                throw new Exception(strErrText);
            }
            Organization root = listOrgan.Find(delegate(Organization o) { return o.ParentId == 0; });
            List<SelectListItem> selectListOrgan = new List<SelectListItem>();
            selectListOrgan.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListOrgan.AddRange(from o in listOrgan
                                     where o.ParentId == root.Id
                                     select new SelectListItem
                                     {
                                         Text = o.Name,
                                         Value = o.Id.ToString()
                                     });
            ViewData["OwnOrgans"] = new SelectList(selectListOrgan, "Value", "Text", model.OwnOrganId.ToString());

            //生成国家下拉列表项
            DDSystem dd = new DDSystem();
            List<Country> listCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listCountry == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListCountry = new List<SelectListItem>();
            selectListCountry.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCountry.AddRange(from c in listCountry
                                       select new SelectListItem
                                       {
                                           Text = c.Name,
                                           Value = c.Name
                                       });
            ViewData["Countrys"] = new SelectList(selectListCountry, "Value", "Text");

            //生成空的省份下拉列表项
            List<Province> listState = new List<Province>();
            List<SelectListItem> selectListState = new List<SelectListItem>();
            selectListState.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListState.AddRange(from s in listState
                                     select new SelectListItem
                                     {
                                         Text = s.Name,
                                         Value = s.Name
                                     });
            ViewData["Provinces"] = new SelectList(selectListState, "Value", "Text");

            //生成空的城市下拉列表项
            List<City> listCity = new List<City>();
            List<SelectListItem> selectListCity = new List<SelectListItem>();
            selectListCity.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCity.AddRange(from ci in listCity
                                    select new SelectListItem
                                    {
                                        Text = ci.Name,
                                        Value = ci.Name
                                    });
            ViewData["Citys"] = new SelectList(selectListCity, "Value", "Text");

            return View(model);
        }
Example #10
0
        public ActionResult ModifyOrganization(string id)
        {
            string strErrText;

            //生成Model数据
            OrganizationSystem organ = new OrganizationSystem();
            Organization data = organ.LoadOrganization(long.Parse(id), LoginAccountId, LoginStaffName, out strErrText);
            if (data == null)
            {
                throw new Exception(strErrText);
            }

            OrganizationViewModel model = new OrganizationViewModel();
            model.Id = data.Id;
            model.Name = data.Name;
            model.ParentId = data.ParentId;
            model.CountryName = data.CountryName;
            model.StateName = data.ProvinceName;
            model.CityName = data.CityName;
            model.Address = data.Address;
            model.PostalCode = data.PostalCode;
            model.Remark = data.Remark;

            //生成上级组织部门下拉列表项
            List<Organization> listOrganization = organ.LoadOrganizations(LoginAccountId, LoginStaffName, out strErrText);
            if (listOrganization == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListOrganization = new List<SelectListItem>();
            selectListOrganization.Add(new SelectListItem { Text = string.Empty, Value = "0" });
            selectListOrganization.AddRange(from o in listOrganization
                                            where !o.FullPath.StartsWith(data.FullPath)
                                            orderby o.FullName
                                            select new SelectListItem
                                            {
                                                Text = o.FullName,
                                                Value = o.Id.ToString()
                                            });
            ViewData["Organizations"] = new SelectList(selectListOrganization, "Value", "Text", model.ParentId);

            //生成国家下拉列表项
            DDSystem dd = new DDSystem();
            List<Country> listCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listCountry == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListCountry = new List<SelectListItem>();
            selectListCountry.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCountry.AddRange(from c in listCountry
                                       select new SelectListItem
                                       {
                                           Text = c.Name,
                                           Value = c.Name
                                       });
            ViewData["Countries"] = new SelectList(selectListCountry, "Value", "Text", model.CountryName);

            //生成空的省份下拉列表项
            List<Province> listState = null;
            if (!string.IsNullOrEmpty(model.CountryName))
            {
                listState = dd.LoadProvincesByCountry(model.CountryName, LoginAccountId, LoginStaffName, out strErrText);
                if (listState == null)
                {
                    throw new Exception(strErrText);
                }
            }
            else
            {
                listState = new List<Province>();
            }
            List<SelectListItem> selectListState = new List<SelectListItem>();
            selectListState.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListState.AddRange(from s in listState
                                     select new SelectListItem
                                     {
                                         Text = s.Name,
                                         Value = s.Name
                                     });
            ViewData["States"] = new SelectList(selectListState, "Value", "Text", model.StateName);

            //生成空的城市下拉列表项
            List<City> listCity = null;
            if (!string.IsNullOrEmpty(model.StateName))
            {
                listCity = dd.LoadCitysByProvince(model.CountryName, model.StateName, LoginAccountId, LoginStaffName, out strErrText);
                if (listCity == null)
                {
                    throw new Exception(strErrText);
                }
            }
            else
            {
                listCity = new List<City>();
            }
            List<SelectListItem> selectListCity = new List<SelectListItem>();
            selectListCity.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCity.AddRange(from ci in listCity
                                    select new SelectListItem
                                    {
                                        Text = ci.Name,
                                        Value = ci.Name
                                    });
            ViewData["Cities"] = new SelectList(selectListCity, "Value", "Text", model.CityName);

            return View(model);
        }
Example #11
0
        public ActionResult ModifyCarrier(string id)
        {
            string strErrText;

            //生成国家下拉列表项
            DDSystem dd = new DDSystem();
            List<Country> listCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listCountry == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListCountry = new List<SelectListItem>();
            selectListCountry.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCountry.AddRange(from c in listCountry
                                       select new SelectListItem
                                       {
                                           Text = c.Name,
                                           Value = c.Name
                                       });
            ViewData["Countrys"] = new SelectList(selectListCountry, "Value", "Text");

            //生成空的省份下拉列表项
            List<Province> listState = new List<Province>();
            List<SelectListItem> selectListState = new List<SelectListItem>();
            selectListState.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListState.AddRange(from s in listState
                                     select new SelectListItem
                                     {
                                         Text = s.Name,
                                         Value = s.Name
                                     });
            ViewData["Provinces"] = new SelectList(selectListState, "Value", "Text");

            //生成空的城市下拉列表项
            List<City> listCity = new List<City>();
            List<SelectListItem> selectListCity = new List<SelectListItem>();
            selectListCity.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCity.AddRange(from ci in listCity
                                    select new SelectListItem
                                    {
                                        Text = ci.Name,
                                        Value = ci.Name
                                    });
            ViewData["Citys"] = new SelectList(selectListCity, "Value", "Text");

            //生成Model数据
            Carrier data = dd.LoadCarrier(long.Parse(id), LoginAccountId, LoginStaffName, out strErrText);
            if (data == null)
            {
                throw new Exception(strErrText);
            }

            CarrierViewModel model = new CarrierViewModel();
            model.Id = data.Id;
            model.Name = data.Name;
            model.BusinessType = data.BusinessType;
            model.PaymentType = data.PaymentType;

            model.Cars = new List<CarrierCarViewModel>();
            model.Cars.Add(new CarrierCarViewModel());

            model.Drivers = new List<CarrierDriverViewModel>();
            model.Drivers.Add(new CarrierDriverViewModel());

            model.SettlementExpressions = new List<CarrierSettlementExpressionViewModel>();
            model.SettlementExpressions.Add(new CarrierSettlementExpressionViewModel());

            model.TransportPrices = new List<CarrierTransportPriceViewModel>();
            model.TransportPrices.Add(new CarrierTransportPriceViewModel());

            return View(model);
        }
Example #12
0
        public ActionResult NewNotDeliverPaperPlan()
        {
            string strErrText;

            //创建空的Model
            PaperPlanViewModel model = new PaperPlanViewModel();
            model.CreateTime = DateTime.Now.ToString("yyyy-MM-dd");

            model.Goods = new List<PaperPlanGoodsViewModel>();
            model.Goods.Add(new PaperPlanGoodsViewModel());

            //生成国家下拉列表项
            DDSystem dd = new DDSystem();
            List<Country> listCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listCountry == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListCountry = new List<SelectListItem>();
            selectListCountry.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCountry.AddRange(from c in listCountry
                                       select new SelectListItem
                                       {
                                           Text = c.Name,
                                           Value = c.Name
                                       });
            ViewData["Countrys"] = new SelectList(selectListCountry, "Value", "Text");

            //生成空的省份下拉列表项
            List<Province> listState = new List<Province>();
            List<SelectListItem> selectListState = new List<SelectListItem>();
            selectListState.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListState.AddRange(from s in listState
                                     select new SelectListItem
                                     {
                                         Text = s.Name,
                                         Value = s.Name
                                     });
            ViewData["Provinces"] = new SelectList(selectListState, "Value", "Text");

            //生成空的城市下拉列表项
            List<City> listCity = new List<City>();
            List<SelectListItem> selectListCity = new List<SelectListItem>();
            selectListCity.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCity.AddRange(from ci in listCity
                                    select new SelectListItem
                                    {
                                        Text = ci.Name,
                                        Value = ci.Name
                                    });
            ViewData["Citys"] = new SelectList(selectListCity, "Value", "Text");

            return View(model);
        }
Example #13
0
        public ActionResult CustomerNewPaperPlan()
        {
            string strErrText;

            //创建空的Model
            PaperPlanViewModel model = new PaperPlanViewModel();
            model.CreateTime = DateTime.Now.ToString("yyyy-MM-dd");

            model.Goods = new List<PaperPlanGoodsViewModel>();
            model.Goods.Add(new PaperPlanGoodsViewModel());

            //设置客户信息和付款单位信息
            if (LoginAccountType == InnoSoft.LS.Resources.Options.Customer)
            {
                model.CustomerId = LoginOrganId;
                model.CustomerName = LoginOrganName;
                model.PayerId = model.CustomerId;
                model.PayerName = model.CustomerName;

                //读取客户所属办事处数据
                CustomerSystem customer = new CustomerSystem();
                Customer dataCustomer = customer.LoadCustomer(model.CustomerId, LoginAccountId, LoginStaffName, out strErrText);
                if (dataCustomer == null)
                {
                    throw new Exception(strErrText);
                }
                OrganizationSystem organ = new OrganizationSystem();
                Organization dataOrgan = organ.LoadOrganization(dataCustomer.OwnOrganId, LoginAccountId, LoginStaffName, out strErrText);
                if (dataOrgan == null)
                {
                    throw new Exception(strErrText);
                }
                model.StartCountry = dataOrgan.CountryName;
                model.StartProvince = dataOrgan.ProvinceName;
                model.StartCity = dataOrgan.CityName;
            }

            //生成讫点国家下拉列表项
            DDSystem dd = new DDSystem();
            List<Country> listDestCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listDestCountry == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListDestCountry = new List<SelectListItem>();
            selectListDestCountry.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListDestCountry.AddRange(from c in listDestCountry
                                           select new SelectListItem
                                           {
                                               Text = c.Name,
                                               Value = c.Name
                                           });
            ViewData["DestCountrys"] = new SelectList(selectListDestCountry, "Value", "Text");

            //生成空的讫点省份下拉列表项
            List<Province> listDestProvince = new List<Province>();
            List<SelectListItem> selectListDestProvince = new List<SelectListItem>();
            selectListDestProvince.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListDestProvince.AddRange(from s in listDestProvince
                                            select new SelectListItem
                                            {
                                                Text = s.Name,
                                                Value = s.Name
                                            });
            ViewData["DestProvinces"] = new SelectList(selectListDestProvince, "Value", "Text");

            //生成空的讫点城市下拉列表项
            List<City> listDestCity = new List<City>();
            List<SelectListItem> selectListDestCity = new List<SelectListItem>();
            selectListDestCity.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListDestCity.AddRange(from ci in listDestCity
                                        select new SelectListItem
                                        {
                                            Text = ci.Name,
                                            Value = ci.Name
                                        });
            ViewData["DestCitys"] = new SelectList(selectListDestCity, "Value", "Text");

            //生成起点国家下拉列表项
            List<Country> listStartCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listStartCountry == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListStartCountry = new List<SelectListItem>();
            selectListStartCountry.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListStartCountry.AddRange(from c in listStartCountry
                                            select new SelectListItem
                                            {
                                                Text = c.Name,
                                                Value = c.Name
                                            });
            ViewData["StartCountrys"] = new SelectList(selectListStartCountry, "Value", "Text", model.StartCountry);

            //生成起点省份下拉列表项
            List<Province> listStartProvince = null;
            if (!string.IsNullOrEmpty(model.StartCountry))
            {
                listStartProvince = dd.LoadProvincesByCountry(model.StartCountry, LoginAccountId, LoginStaffName, out strErrText);
                if (listStartProvince == null)
                {
                    throw new Exception(strErrText);
                }
            }
            else
            {
                listStartProvince = new List<Province>();
            }
            List<SelectListItem> selectListStartProvince = new List<SelectListItem>();
            selectListStartProvince.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListStartProvince.AddRange(from p in listStartProvince
                                             select new SelectListItem
                                             {
                                                 Text = p.Name,
                                                 Value = p.Name
                                             });
            ViewData["StartProvinces"] = new SelectList(selectListStartProvince, "Value", "Text", model.StartProvince);

            //生成起点城市下拉列表项
            List<City> listStartCity = null;
            if (!string.IsNullOrEmpty(model.StartProvince))
            {
                listStartCity = dd.LoadCitysByProvince(model.StartCountry, model.StartProvince, LoginAccountId, LoginStaffName, out strErrText);
                if (listStartCity == null)
                {
                    throw new Exception(strErrText);
                }
            }
            else
            {
                listStartCity = new List<City>();
            }
            List<SelectListItem> selectListStartCity = new List<SelectListItem>();
            selectListStartCity.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListStartCity.AddRange(from ci in listStartCity
                                         select new SelectListItem
                                         {
                                             Text = ci.Name,
                                             Value = ci.Name
                                         });
            ViewData["StartCitys"] = new SelectList(selectListStartCity, "Value", "Text", model.StartCity);

            return View(model);
        }
Example #14
0
        public ActionResult ApproveContracts()
        {
            string strErrText;

            //生成国家下拉列表项
            DDSystem dd = new DDSystem();
            List<Country> listCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listCountry == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListCountry = new List<SelectListItem>();
            selectListCountry.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCountry.AddRange(from c in listCountry
                                       select new SelectListItem
                                       {
                                           Text = c.Name,
                                           Value = c.Name
                                       });
            ViewData["Countrys"] = new SelectList(selectListCountry, "Value", "Text");

            //生成空的省份下拉列表项
            List<Province> listState = new List<Province>();
            List<SelectListItem> selectListState = new List<SelectListItem>();
            selectListState.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListState.AddRange(from s in listState
                                     select new SelectListItem
                                     {
                                         Text = s.Name,
                                         Value = s.Name
                                     });
            ViewData["Provinces"] = new SelectList(selectListState, "Value", "Text");

            //生成空的城市下拉列表项
            List<City> listCity = new List<City>();
            List<SelectListItem> selectListCity = new List<SelectListItem>();
            selectListCity.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCity.AddRange(from ci in listCity
                                    select new SelectListItem
                                    {
                                        Text = ci.Name,
                                        Value = ci.Name
                                    });
            ViewData["Citys"] = new SelectList(selectListCity, "Value", "Text");

            //生成空的组织部门下拉列表项
            List<Organization> listOrganization = new List<Organization>();
            List<SelectListItem> selectListOrganization = new List<SelectListItem>();
            selectListOrganization.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListOrganization.AddRange(from o in listOrganization
                                            orderby o.FullName
                                            select new SelectListItem
                                            {
                                                Text = o.FullName,
                                                Value = o.Id.ToString()
                                            });
            ViewData["Organizations"] = new SelectList(selectListOrganization, "Value", "Text");

            return View();
        }
Example #15
0
        public ActionResult ModifyTransportLimitedPrice(string id)
        {
            string strErrText;

            //生成Model数据
            DDSystem dd = new DDSystem();
            TransportLimitedPrice data = dd.LoadTransportLimitedPrice(long.Parse(id), LoginAccountId, LoginStaffName, out strErrText);
            if (data == null)
            {
                throw new Exception(strErrText);
            }

            TransportLimitedPriceViewModel model = new TransportLimitedPriceViewModel();
            model.Id = data.Id;
            model.PlanType = data.PlanType;
            model.StartCountry = data.StartCountry;
            model.StartProvince = data.StartProvince;
            model.StartCity = data.StartCity;
            model.DestCountry = data.DestCountry;
            model.DestProvince = data.DestProvince;
            model.DestCity = data.DestCity;
            model.CarType = data.CarType;
            model.MinTunnagesOrPiles = data.MinTunnagesOrPiles;
            model.MaxTunnagesOrPiles = data.MaxTunnagesOrPiles;
            model.StartTime = data.StartTime.ToString("yyyy-MM-dd");
            model.EndTime = data.EndTime.ToString("yyyy-MM-dd");
            model.TransportPrice = data.TransportPrice;
            model.TransportCharges = data.TransportCharges;

            //生成起点国家下拉列表项
            List<Country> listStartCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listStartCountry == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListStartCountry = new List<SelectListItem>();
            selectListStartCountry.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListStartCountry.AddRange(from c in listStartCountry
                                            select new SelectListItem
                                            {
                                                Text = c.Name,
                                                Value = c.Name
                                            });
            ViewData["StartCountrys"] = new SelectList(selectListStartCountry, "Value", "Text", model.StartCountry);

            //生成起点省份下拉列表项
            List<Province> listStartProvince = null;
            if (!string.IsNullOrEmpty(model.StartCountry))
            {
                listStartProvince = dd.LoadProvincesByCountry(model.StartCountry, LoginAccountId, LoginStaffName, out strErrText);
                if (listStartProvince == null)
                {
                    throw new Exception(strErrText);
                }
            }
            else
            {
                listStartProvince = new List<Province>();
            }
            List<SelectListItem> selectListStartProvince = new List<SelectListItem>();
            selectListStartProvince.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListStartProvince.AddRange(from s in listStartProvince
                                             select new SelectListItem
                                             {
                                                 Text = s.Name,
                                                 Value = s.Name
                                             });
            ViewData["StartProvinces"] = new SelectList(selectListStartProvince, "Value", "Text", model.StartProvince);

            //生成起点城市下拉列表项
            List<City> listStartCity = null;
            if (!string.IsNullOrEmpty(model.StartProvince))
            {
                listStartCity = dd.LoadCitysByProvince(model.StartCountry, model.StartProvince, LoginAccountId, LoginStaffName, out strErrText);
                if (listStartCity == null)
                {
                    throw new Exception(strErrText);
                }
            }
            else
            {
                listStartCity = new List<City>();
            }
            List<SelectListItem> selectListStartCity = new List<SelectListItem>();
            selectListStartCity.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListStartCity.AddRange(from ci in listStartCity
                                         select new SelectListItem
                                         {
                                             Text = ci.Name,
                                             Value = ci.Name
                                         });
            ViewData["StartCitys"] = new SelectList(selectListStartCity, "Value", "Text", model.StartCity);

            //生成讫点国家下拉列表项
            List<Country> listDestCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listDestCountry == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListDestCountry = new List<SelectListItem>();
            selectListDestCountry.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListDestCountry.AddRange(from c in listDestCountry
                                           select new SelectListItem
                                           {
                                               Text = c.Name,
                                               Value = c.Name
                                           });
            ViewData["DestCountrys"] = new SelectList(selectListDestCountry, "Value", "Text", model.DestCountry);

            //生成讫点省份下拉列表项
            List<Province> listDestProvince = null;
            if (!string.IsNullOrEmpty(model.DestCountry))
            {
                listDestProvince = dd.LoadProvincesByCountry(model.DestCountry, LoginAccountId, LoginStaffName, out strErrText);
                if (listDestProvince == null)
                {
                    throw new Exception(strErrText);
                }
            }
            else
            {
                listDestProvince = new List<Province>();
            }
            List<SelectListItem> selectListDestProvince = new List<SelectListItem>();
            selectListDestProvince.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListDestProvince.AddRange(from s in listDestProvince
                                            select new SelectListItem
                                            {
                                                Text = s.Name,
                                                Value = s.Name
                                            });
            ViewData["DestProvinces"] = new SelectList(selectListDestProvince, "Value", "Text", model.DestProvince);

            //生成讫点城市下拉列表项
            List<City> listDestCity = null;
            if (!string.IsNullOrEmpty(model.DestProvince))
            {
                listDestCity = dd.LoadCitysByProvince(model.DestCountry, model.DestProvince, LoginAccountId, LoginStaffName, out strErrText);
                if (listDestCity == null)
                {
                    throw new Exception(strErrText);
                }
            }
            else
            {
                listDestCity = new List<City>();
            }
            List<SelectListItem> selectListDestCity = new List<SelectListItem>();
            selectListDestCity.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListDestCity.AddRange(from ci in listDestCity
                                        select new SelectListItem
                                        {
                                            Text = ci.Name,
                                            Value = ci.Name
                                        });
            ViewData["DestCitys"] = new SelectList(selectListDestCity, "Value", "Text", model.DestCity);

            return View(model);
        }
Example #16
0
        public JsonResult LoadCountrysGrid(string sidx, string sord, int page, int rows)
        {
            //读取全部数据
            string strErrText;
            DDSystem country = new DDSystem();
            List<Country> listCountry = country.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listCountry == null)
            {
                throw new Exception(strErrText);
            }

            //提取当前页面数据
            int nTotalRows = listCountry.Count;
            int nPageIndex = page;
            int nPageSize = rows;
            int nTotalPages = nTotalRows / nPageSize;
            if (nTotalRows % nPageSize > 0)
                nTotalPages++;

            string sortExpression = (sidx ?? "Id") + " " + (sord ?? "ASC");
            var data = listCountry.OrderBy(sortExpression).Skip((nPageIndex - 1) * nPageSize).Take(nPageSize).ToList();

            //生成表格数据
            var ret = new
            {
                total = nTotalPages,
                page = nPageIndex,
                records = nTotalRows,
                rows = (
                      from c in data
                      select new
                      {
                          id = c.Id,
                          cell = new string[]
                          {
                              c.Id.ToString(),
                              c.Name,
                              c.Remark,
                          }
                      }).ToArray()
            };
            return Json(ret, JsonRequestBehavior.AllowGet);
        }
Example #17
0
        public ActionResult NewCustomer()
        {
            string strErrText;

            //生成所属组织部门下拉列表项
            OrganizationSystem organ = new OrganizationSystem();
            List<Organization> listOrgan = organ.LoadOrganizations(LoginAccountId, LoginStaffName, out strErrText);
            if (listOrgan == null)
            {
                throw new Exception(strErrText);
            }
            Organization root = listOrgan.Find(delegate(Organization o) { return o.ParentId == 0; });
            List<SelectListItem> selectListOrgan = new List<SelectListItem>();
            selectListOrgan.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListOrgan.AddRange(from o in listOrgan
                                     where o.ParentId == root.Id
                                     select new SelectListItem
                                     {
                                         Text = o.Name,
                                         Value = o.Id.ToString()
                                     });
            ViewData["OwnOrgans"] = new SelectList(selectListOrgan, "Value", "Text");

            //生成国家下拉列表项
            DDSystem dd = new DDSystem();
            List<Country> listCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listCountry == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListCountry = new List<SelectListItem>();
            selectListCountry.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCountry.AddRange(from c in listCountry
                                       select new SelectListItem
                                       {
                                           Text = c.Name,
                                           Value = c.Name
                                       });
            ViewData["Countrys"] = new SelectList(selectListCountry, "Value", "Text");

            //生成空的省份下拉列表项
            List<Province> listState = new List<Province>();
            List<SelectListItem> selectListState = new List<SelectListItem>();
            selectListState.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListState.AddRange(from s in listState
                                     select new SelectListItem
                                     {
                                         Text = s.Name,
                                         Value = s.Name
                                     });
            ViewData["Provinces"] = new SelectList(selectListState, "Value", "Text");

            //生成空的城市下拉列表项
            List<City> listCity = new List<City>();
            List<SelectListItem> selectListCity = new List<SelectListItem>();
            selectListCity.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCity.AddRange(from ci in listCity
                                    select new SelectListItem
                                    {
                                        Text = ci.Name,
                                        Value = ci.Name
                                    });
            ViewData["Citys"] = new SelectList(selectListCity, "Value", "Text");

            //创建空的Model
            CustomerViewModel model = new CustomerViewModel();
            model.GrossWeightRate = "1";

            model.TransportPrices = new List<CustomerTransportPriceViewModel>();
            model.TransportPrices.Add(new CustomerTransportPriceViewModel());

            model.ForceFeePrices = new List<CustomerForceFeePriceViewModel>();
            model.ForceFeePrices.Add(new CustomerForceFeePriceViewModel());

            model.StorageFeePrices = new List<CustomerStorageFeePriceViewModel>();
            model.StorageFeePrices.Add(new CustomerStorageFeePriceViewModel());

            return View(model);
        }
Example #18
0
        public ActionResult ModifyProvince(string id)
        {
            string strErrText;

            //生成Model数据
            DDSystem province = new DDSystem();
            Province data = province.LoadProvince(long.Parse(id), LoginAccountId, LoginStaffName, out strErrText);
            if (data == null)
            {
                throw new Exception(strErrText);
            }

            ProvinceViewModel model = new ProvinceViewModel();
            model.Id = data.Id;
            model.Name = data.Name;
            model.CountryName = data.CountryName;
            model.Remark = data.Remark;

            //生成国家下拉列表项
            DDSystem dd = new DDSystem();
            List<Country> listCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listCountry == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListCountry = new List<SelectListItem>();
            selectListCountry.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCountry.AddRange(from c in listCountry
                                       select new SelectListItem
                                       {
                                           Text = c.Name,
                                           Value = c.Name
                                       });
            ViewData["Countries"] = new SelectList(selectListCountry, "Value", "Text", model.CountryName);

            return View(model);
        }
Example #19
0
        public ActionResult NewReceiver()
        {
            string strErrText;

            //生成国家下拉列表项
            DDSystem dd = new DDSystem();
            List<Country> listCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listCountry == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListCountry = new List<SelectListItem>();
            selectListCountry.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCountry.AddRange(from c in listCountry
                                       select new SelectListItem
                                       {
                                           Text = c.Name,
                                           Value = c.Name
                                       });
            ViewData["Countrys"] = new SelectList(selectListCountry, "Value", "Text");

            //生成空的省份下拉列表项
            List<Province> listState = new List<Province>();
            List<SelectListItem> selectListState = new List<SelectListItem>();
            selectListState.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListState.AddRange(from s in listState
                                     select new SelectListItem
                                     {
                                         Text = s.Name,
                                         Value = s.Name
                                     });
            ViewData["Provinces"] = new SelectList(selectListState, "Value", "Text");

            //生成空的城市下拉列表项
            List<City> listCity = new List<City>();
            List<SelectListItem> selectListCity = new List<SelectListItem>();
            selectListCity.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCity.AddRange(from ci in listCity
                                    select new SelectListItem
                                    {
                                        Text = ci.Name,
                                        Value = ci.Name
                                    });
            ViewData["Citys"] = new SelectList(selectListCity, "Value", "Text");

            //创建空的Model
            ReceiverViewModel model = new ReceiverViewModel();

            model.Distances = new List<ReceiverDistanceViewModel>();
            model.Distances.Add(new ReceiverDistanceViewModel());

            return View(model);
        }
Example #20
0
        public JsonResult LoadCountrys()
        {
            string strErrText;
            DDSystem dd = new DDSystem();
            List<Country> listCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listCountry == null)
            {
                throw new Exception(strErrText);
            }

            var ret = from c in listCountry
                      select c.Name;

            return Json(ret, JsonRequestBehavior.AllowGet);
        }
Example #21
0
        public ActionResult SyntheticalSearch()
        {
            string strErrText;

            //生成空的付款单位下拉列表项
            List<SelectListItem> selectListPayer = new List<SelectListItem>();
            selectListPayer.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            ViewData["Customers"] = new SelectList(selectListPayer, "Value", "Text");

            //生成国家下拉列表项
            DDSystem dd = new DDSystem();
            List<Country> listCountry = dd.LoadCountrys(LoginAccountId, LoginStaffName, out strErrText);
            if (listCountry == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListCountry = new List<SelectListItem>();
            selectListCountry.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCountry.AddRange(from c in listCountry
                                       select new SelectListItem
                                       {
                                           Text = c.Name,
                                           Value = c.Name
                                       });
            ViewData["Countrys"] = new SelectList(selectListCountry, "Value", "Text");

            //生成空的省份下拉列表项
            List<Province> listState = new List<Province>();
            List<SelectListItem> selectListState = new List<SelectListItem>();
            selectListState.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListState.AddRange(from s in listState
                                     select new SelectListItem
                                     {
                                         Text = s.Name,
                                         Value = s.Name
                                     });
            ViewData["Provinces"] = new SelectList(selectListState, "Value", "Text");

            //生成空的城市下拉列表项
            List<City> listCity = new List<City>();
            List<SelectListItem> selectListCity = new List<SelectListItem>();
            selectListCity.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            selectListCity.AddRange(from ci in listCity
                                    select new SelectListItem
                                    {
                                        Text = ci.Name,
                                        Value = ci.Name
                                    });
            ViewData["Citys"] = new SelectList(selectListCity, "Value", "Text");

            //生成空的组织部门下拉列表项
            List<SelectListItem> selectListOrganization = new List<SelectListItem>();
            selectListOrganization.Add(new SelectListItem { Text = string.Empty, Value = string.Empty });
            ViewData["Organizations"] = new SelectList(selectListOrganization, "Value", "Text");

            return View();
        }