Ejemplo n.º 1
0
        public JsonResult LoadCustomerByName(string strName)
        {
            string strErrText;
            CustomerSystem customer = new CustomerSystem();
            Customer data = customer.LoadCustomerByName(strName, LoginAccountId, LoginStaffName, out strErrText);
            if (data == null)
            {
                return Json(null, JsonRequestBehavior.AllowGet);
            }
            else
            {
                decimal decLoadingForceFeePrice = 0;
                decimal decUnloadingForceFeePrice = 0;
                CustomerForceFeePrice data1 = customer.LoadCustomerForceFeePrice(data.Id, DateTime.Now, LoginAccountId, LoginStaffName, out strErrText);
                if (data1 != null)
                {
                    decLoadingForceFeePrice = data1.LoadingForceFeePrice;
                    decUnloadingForceFeePrice = data1.UnloadingForceFeePrice;
                }

                decimal decStorageFeePrice = 0;
                CustomerStorageFeePrice data2 = customer.LoadCustomerStorageFeePrice(data.Id, DateTime.Now, LoginAccountId, LoginStaffName, out strErrText);
                if (data2 != null)
                {
                    decStorageFeePrice = data2.StorageFeePrice;
                }

                var ret = new
                {
                    Id = data.Id,
                    Name = data.Name,
                    LoadingForceFeePrice = decLoadingForceFeePrice,
                    UnloadingForceFeePrice = decUnloadingForceFeePrice,
                    StorageFeePrice = decStorageFeePrice,
                    OwnOrganId = data.OwnOrganId
                };

                return Json(ret, JsonRequestBehavior.AllowGet);
            }
        }