Example #1
0
 public ActionResult DeleteCountry(string id)
 {
     //删除数据
     string strErrText;
     DDSystem country = new DDSystem();
     if (country.DeleteCountry(long.Parse(id), LoginAccountId, LoginStaffName, out strErrText))
     {
         return Json(string.Empty);
     }
     else
     {
         return Json(strErrText);
     }
 }
Example #2
0
 public ActionResult DeleteGoodsType(string id)
 {
     //删除数据
     string strErrText;
     DDSystem dd = new DDSystem();
     if (dd.DeleteGoodsType(long.Parse(id), LoginAccountId, LoginStaffName, out strErrText))
     {
         return Json(string.Empty);
     }
     else
     {
         return Json(strErrText);
     }
 }
Example #3
0
        public JsonResult LoadCitys(string term, string countryName, string provinceName)
        {
            //读取指定国家和省份的城市数据
            string strErrText = string.Empty;
            DDSystem dd = new DDSystem();
            List<City> listCity = dd.LoadCitysByProvince(countryName, provinceName, LoginAccountId, LoginStaffName, out strErrText);
            if (listCity == null)
            {
                listCity = new List<City>();
            }

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

            return Json(ret, JsonRequestBehavior.AllowGet);
        }
Example #4
0
        public JsonResult LoadCarNos(string term)
        {
            //读取所有车辆数据
            string strErrText = string.Empty;
            DDSystem dd = new DDSystem();
            List<CarrierCar> listCar = dd.LoadCarsByCarNo(term, LoginAccountId, LoginStaffName, out strErrText);
            if (listCar == null)
            {
                listCar = new List<CarrierCar>();
            }

            //提取车号中包含关键字的记录
            var ret = (
                from c in listCar
                select c.CarNo).ToArray();

            return Json(ret, JsonRequestBehavior.AllowGet);
        }
Example #5
0
        public JsonResult LoadCarrierNames(string term)
        {
            //读取所有承运单位数据
            string strErrText = string.Empty;
            DDSystem dd = new DDSystem();
            List<Carrier> listCarrier = dd.LoadCarriers(LoginAccountId, LoginStaffName, out strErrText);
            if (listCarrier == null)
            {
                listCarrier = new List<Carrier>();
            }

            //提取承运单位名称中包含关键字的记录
            var ret = (
                from r in listCarrier
                where r.Name.Contains(term)
                select r.Name).ToArray();

            return Json(ret, JsonRequestBehavior.AllowGet);
        }
Example #6
0
        public JsonResult LoadCarByCarNo(string strCarNo)
        {
            string strErrText;
            DDSystem dd = new DDSystem();
            CarrierCar data = dd.LoadCarByCarNo(strCarNo, LoginAccountId, LoginStaffName, out strErrText);
            if (data == null)
            {
                return Json(null, JsonRequestBehavior.AllowGet);
            }
            else
            {
                var ret = new
                {
                    TrailerNo = data.TrailerNo,
                    CarryingCapacity = data.CarryingCapacity
                };

                return Json(ret, JsonRequestBehavior.AllowGet);
            }
        }
Example #7
0
        public JsonResult LoadCarrier(string carrierId)
        {
            string strErrText;
            DDSystem dd = new DDSystem();
            Carrier data = dd.LoadCarrier(long.Parse(carrierId), LoginAccountId, LoginStaffName, out strErrText);
            if (data == null)
            {
                return Json(null, JsonRequestBehavior.AllowGet);
            }
            else
            {
                var ret = new
                {
                    Id = data.Id,
                    Name = data.Name,
                    BusinessType = data.BusinessType,
                    PaymentType = data.PaymentType
                };

                return Json(ret, JsonRequestBehavior.AllowGet);
            }
        }
Example #8
0
        public JsonResult LoadCustomerReceivers(string customerName)
        {
            string strErrText;
            DDSystem dd = new DDSystem();
            List<Receiver> listReceiver = dd.LoadCustomerReceivers(customerName, LoginAccountId, LoginStaffName, out strErrText);
            if (listReceiver == null)
            {
                throw new Exception(strErrText);
            }

            var ret = from r in listReceiver
                      select r.Name;

            return Json(ret, JsonRequestBehavior.AllowGet);
        }
Example #9
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 #10
0
 public JsonResult LoadCarrierTransportPrice(string carrierId, string startCountry, string startProvince, string startCity, string destCountry, string destProvince, string destCity, string planType, string createTime)
 {
     string strErrText;
     DDSystem dd = new DDSystem();
     CarrierTransportPrice data = dd.LoadCarrierTransportPrice(long.Parse(carrierId), startCountry, startProvince, startCity, destCountry, destProvince, destCity, planType, DateTime.Parse(createTime), LoginAccountId, LoginStaffName, out strErrText);
     if (data == null)
     {
         return Json(0, JsonRequestBehavior.AllowGet);
     }
     else
     {
         return Json(data.TransportPrice, JsonRequestBehavior.AllowGet);
     }
 }
Example #11
0
 public JsonResult LoadCarrierSettlementExpression(string carrierId, string planType)
 {
     string strErrText;
     DDSystem dd = new DDSystem();
     CarrierSettlementExpression data = dd.LoadCarrierSettlementExpression(long.Parse(carrierId), planType, LoginAccountId, LoginStaffName, out strErrText);
     if (data == null)
     {
         return Json(null, JsonRequestBehavior.AllowGet);
     }
     else
     {
         var ret = new
         {
             TransportChargeExpression = data.TransportChargeExpression,
             TransportPriceExpression = data.TransportPriceExpression
         };
         return Json(ret, JsonRequestBehavior.AllowGet);
     }
 }
Example #12
0
        public JsonResult LoadProvincesByCountry(string strCountryName)
        {
            string strErrText;
            DDSystem dd = new DDSystem();
            List<Province> listProvince = dd.LoadProvincesByCountry(strCountryName, LoginAccountId, LoginStaffName, out strErrText);
            if (listProvince == null)
            {
                throw new Exception(strErrText);
            }

            var ret = from p in listProvince
                      select p.Name;

            return Json(ret, JsonRequestBehavior.AllowGet);
        }
Example #13
0
        public JsonResult LoadGenerateBusinessCarriersByTimespan(string startTime, string endTime)
        {
            string strErrText;
            DDSystem dd = new DDSystem();
            List<Carrier> listCarrier = dd.LoadGenerateBusinessCarriersByTimespan(startTime, endTime, LoginAccountId, LoginStaffName, out strErrText);
            if (listCarrier == null)
            {
                throw new Exception(strErrText);
            }

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

            return Json(ret, JsonRequestBehavior.AllowGet);
        }
Example #14
0
        public JsonResult LoadDriver(long nId)
        {
            string strErrText;
            DDSystem dd = new DDSystem();
            CarrierDriver data = dd.LoadDriver(nId, LoginAccountId, LoginStaffName, out strErrText);
            if (data == null)
            {
                throw new Exception(strErrText);
            }

            var ret = new
            {
                LicenseNo = data.LicenseNo,
                MobileTel = data.MobileTel,
                HomeTel = data.HomeTel,
            };

            return Json(ret, JsonRequestBehavior.AllowGet);
        }
Example #15
0
        public ActionResult NewCountry(CountryViewModel model)
        {
            if (ModelState.IsValid)
            {
                //创建数据
                Country data = new Country();
                data.Name = model.Name;
                data.Remark = model.Remark ?? string.Empty;

                //保存数据
                string strErrText;
                DDSystem country = new DDSystem();
                if (country.InsertCountry(data, LoginAccountId, LoginStaffName, out strErrText))
                {
                    return Json(string.Empty);
                }
                else
                {
                    return Json(strErrText);
                }
            }
            return View(model);
        }
Example #16
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 #17
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 #18
0
        public ActionResult ModifyGoodsType(string id)
        {
            string strErrText;

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

            GoodsTypeViewModel model = new GoodsTypeViewModel();
            model.Id = data.Id;
            model.Name = data.Name;
            model.ParentId = data.ParentId;
            model.Remark = data.Remark;

            List<GoodsType> listGoodsType = dd.LoadGoodsTypes(LoginAccountId, LoginStaffName, out strErrText);
            if (listGoodsType == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectlistGoodsType = new List<SelectListItem>();
            selectlistGoodsType.Add(new SelectListItem { Text = string.Empty, Value = "0" });
            selectlistGoodsType.AddRange(from t in listGoodsType
                                         where !t.FullPath.StartsWith(data.FullPath)
                                         orderby t.FullName
                                         select new SelectListItem
                                         {
                                             Text = t.FullName,
                                             Value = t.Id.ToString()
                                         });
            ViewData["GoodsTypes"] = new SelectList(selectlistGoodsType, "Value", "Text", model.ParentId);

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

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

            CountryViewModel model = new CountryViewModel();
            model.Id = data.Id;
            model.Name = data.Name;
            model.Remark = data.Remark;

            return View(model);
        }
Example #20
0
        public ActionResult ModifyCity(CityViewModel model)
        {
            if (ModelState.IsValid)
            {
                //创建数据
                City data = new City();
                data.Id = model.Id;
                data.Name = model.Name;
                data.CountryName = model.CountryName;
                data.ProvinceName = model.ProvinceName;
                data.Remark = model.Remark ?? string.Empty;

                //保存数据
                string strErrText;
                DDSystem city = new DDSystem();
                if (city.UpdateCity(data, LoginAccountId, LoginStaffName, out strErrText))
                {
                    return Json(string.Empty);
                }
                else
                {
                    return Json(strErrText);
                }
            }
            return View(model);
        }
Example #21
0
 public JsonResult LoadDistance(string strReceiverName, string startCountry, string startProvince, string startCity)
 {
     string strErrText;
     DDSystem dd = new DDSystem();
     ReceiverDistance data = dd.LoadReceiverDistance(strReceiverName, startCountry, startProvince, startCity, LoginAccountId, LoginStaffName, out strErrText);
     if (data == null)
     {
         return Json(null, JsonRequestBehavior.AllowGet);
     }
     else
     {
         return Json(data.KM, JsonRequestBehavior.AllowGet);
     }
 }
Example #22
0
        public ActionResult NewGoodsType()
        {
            string strErrText;

            //生成上级货物类别下拉列表项
            DDSystem dd = new DDSystem();
            List<GoodsType> listGoodsType = dd.LoadGoodsTypes(LoginAccountId, LoginStaffName, out strErrText);
            if (listGoodsType == null)
            {
                throw new Exception(strErrText);
            }
            List<SelectListItem> selectListGoodsType = new List<SelectListItem>();
            selectListGoodsType.Add(new SelectListItem { Text = string.Empty, Value = "0" });
            selectListGoodsType.AddRange(from o in listGoodsType
                                         orderby o.FullName
                                         select new SelectListItem
                                         {
                                             Text = o.FullName,
                                             Value = o.Id.ToString()
                                         });
            ViewData["GoodsTypes"] = new SelectList(selectListGoodsType, "Value", "Text");

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

            return View(model);
        }
Example #23
0
        public JsonResult LoadDriversByCarNo(string strCarNo)
        {
            string strErrText;
            DDSystem dd = new DDSystem();
            List<CarrierDriver> listDriver = dd.LoadDriversByCarNo(strCarNo, LoginAccountId, LoginStaffName, out strErrText);
            if (listDriver == null)
            {
                throw new Exception(strErrText);
            }

            var ret = from d in listDriver
                      select new
                      {
                          d.Id,
                          d.Name
                      };

            return Json(ret, JsonRequestBehavior.AllowGet);
        }
Example #24
0
        public ActionResult NewGoodsType(GoodsTypeViewModel model)
        {
            if (ModelState.IsValid)
            {
                //创建数据
                GoodsType data = new GoodsType();
                data.Name = model.Name;
                data.ParentId = model.ParentId;
                data.Remark = model.Remark ?? string.Empty;

                //保存数据
                string strErrText;
                DDSystem dd = new DDSystem();
                if (dd.InsertGoodsType(data, LoginAccountId, LoginStaffName, out strErrText))
                {
                    return Json(string.Empty);
                }
                else
                {
                    return Json(strErrText);
                }
            }
            return View(model);
        }
Example #25
0
        public JsonResult LoadGoodsByGoodsNo(string strGoodsNo)
        {
            string strErrText;
            DDSystem dd = new DDSystem();
            Goods data = dd.LoadGoodsByGoodsNo(strGoodsNo, LoginAccountId, LoginStaffName, out strErrText);
            if (data == null)
            {
                return Json(null, JsonRequestBehavior.AllowGet);
            }
            else
            {
                var ret = new
                {
                    Id = data.Id,
                    Name = data.Name,
                    Brand = data.Brand,
                    SpecModel = data.SpecModel,
                    GWeight = data.GWeight,
                    Grade = data.Grade,
                    Packing = data.Packing,
                    PieceWeight = data.PieceWeight
                };

                return Json(ret, JsonRequestBehavior.AllowGet);
            }
        }
Example #26
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 #27
0
        public JsonResult LoadGoodsTypes()
        {
            string strErrText = string.Empty;
            DDSystem dd = new DDSystem();
            List<GoodsType> listGoodsType = dd.LoadGoodsTypes(LoginAccountId, LoginStaffName, out strErrText);
            if (listGoodsType == null)
            {
                throw new Exception(strErrText);
            }

            var ret = from t in listGoodsType
                      select new
                      {
                          t.Id,
                          t.FullName
                      };

            return Json(ret, JsonRequestBehavior.AllowGet);
        }
Example #28
0
        public ActionResult NewProvince(ProvinceViewModel model)
        {
            if (ModelState.IsValid)
            {
                //创建数据
                Province data = new Province();
                data.Name = model.Name;
                data.CountryName = model.CountryName;
                data.Remark = model.Remark ?? string.Empty;

                //保存数据
                string strErrText;
                DDSystem province = new DDSystem();
                if (province.InsertProvince(data, LoginAccountId, LoginStaffName, out strErrText))
                {
                    return Json(string.Empty);
                }
                else
                {
                    return Json(strErrText);
                }
            }
            return View(model);
        }
Example #29
0
        public JsonResult LoadReceiverByName(string strName)
        {
            string strErrText;
            DDSystem dd = new DDSystem();
            Receiver data = dd.LoadReceiverByName(strName, LoginAccountId, LoginStaffName, out strErrText);
            if (data == null)
            {
                return Json(null, JsonRequestBehavior.AllowGet);
            }
            else
            {
                var ret = new
                {
                    Country = data.Country,
                    Province = data.Province,
                    City = data.City,
                    Address = data.Address,
                    Contact = data.Contact,
                    ContactTel = data.ContactTel
                };

                return Json(ret, JsonRequestBehavior.AllowGet);
            }
        }
Example #30
0
        public JsonResult LoadCarrierCars(string carrierName)
        {
            string strErrText;
            DDSystem dd = new DDSystem();
            List<CarrierCar> listCar = dd.LoadCarrierCars(carrierName, LoginAccountId, LoginStaffName, out strErrText);
            if (listCar == null)
            {
                throw new Exception(strErrText);
            }

            var ret = from c in listCar
                      select new
                      {
                          c.CarNo,
                          c.TrailerNo,
                          c.CarryingCapacity
                      };

            return Json(ret, JsonRequestBehavior.AllowGet);
        }