コード例 #1
0
        public ActionResult Index()
        {
            QueryCRMVehicleViewModel vi = new QueryCRMVehicleViewModel();

            vi.SearchCondition = new CRMVehicleSearchCondition();
            vi.PageIndex       = 0;
            vi.PageCount       = 0;
            vi.ShowEditButton  = false;
            //特殊操作
            if (base.UserInfo.ProjectRoleID == 28 || base.UserInfo.ProjectRoleID == 1)
            {
                vi.ShowEditButton = true;
            }
            var getCRMVehicleByConditionResponse = new VehicleManagementService().GetCRMVehicleByCondition(new GetCRMVehicleByConditionRequest()
            {
                SearchCondition = vi.SearchCondition,
                PageSize        = UtilConstants.PAGESIZE,
                PageIndex       = vi.PageIndex,
            });

            if (getCRMVehicleByConditionResponse.IsSuccess)
            {
                vi.CRMVehicleCollection = getCRMVehicleByConditionResponse.Result.CRMVehicleCollection;
                vi.UserID    = base.UserInfo.ID.ToString();
                vi.PageIndex = getCRMVehicleByConditionResponse.Result.PageIndex;
                vi.PageCount = getCRMVehicleByConditionResponse.Result.PageCount;
            }
            return(View(vi));
        }
コード例 #2
0
        public ActionResult Create(string id, int?ViewType)
        {
            QueryCRMVehicleViewModel vi = new QueryCRMVehicleViewModel();

            if (string.IsNullOrEmpty(id))
            {
                //CRMVehicle v = new CRMVehicle();
                //v.CarBodyPhoto = Guid.NewGuid().ToString();
                //v.CarFrontPhoto = Guid.NewGuid().ToString();
                //v.CarBackPhoto = Guid.NewGuid().ToString();
                //v.CarFloorPhoto = Guid.NewGuid().ToString();
                //vi.CRMVehicle = v;
                vi.ViewType = 0;
            }
            else
            {
                if (ViewType == 1)
                {
                    var response = new VehicleManagementService().GetSearchVehicle(id);
                    vi.CRMVehicle = response;
                    vi.ViewType   = 1;
                }
                else
                {
                    var response = new VehicleManagementService().GetSearchVehicle(id);
                    vi.CRMVehicle = response;
                    vi.ViewType   = 0;
                }
            }


            return(View(vi));
        }
コード例 #3
0
        //输入承运商名称,显示车辆列表
        public string GetCRM_ShipperMappingVehicle(string name)
        {
            ShipperToVehicleViewModel sv = new ShipperToVehicleViewModel();

            var request = new ShipperMappingVehicleRequest();

            request.ShipperName = name;



            var response = new VehicleManagementService().GetCRM_ShipperMappingVehicle(request);

            if (response.IsSuccess)
            {
                sv.Vehicle   = response.Result.CRMVehicleCollection;
                sv.PageIndex = response.Result.PageIndex;
                sv.PageCount = response.Result.PageCount;
            }



            JavaScriptSerializer Serializer = new JavaScriptSerializer();
            string js = Serializer.Serialize(response);

            return(js);
        }
コード例 #4
0
        public string ShipperToVehicle(string shipperName, string vehicleNo, long SID, int?Index)
        {
            ShipperToVehicleViewModel sv = new ShipperToVehicleViewModel();

            sv.PageIndex   = Index ?? 0;
            sv.SID         = (SID);
            sv.ShipperName = shipperName;
            //sv.VehicleNo = vehicle;


            var request = new GetCRMVehicleByConditionRequest();

            int pagesize = 17;

            request.PageIndex = sv.PageIndex;
            request.PageSize  = pagesize;
            request.vehicleNo = vehicleNo;


            var response = new VehicleManagementService().GetAllVehicle(request);

            if (response.IsSuccess)
            {
                sv.Vehicle   = response.Result.CRMVehicleCollection;
                sv.PageIndex = response.Result.PageIndex;
                sv.PageCount = response.Result.PageCount;
            }
            JavaScriptSerializer Serializer = new JavaScriptSerializer();
            string js = Serializer.Serialize(response);


            return(js);
        }
コード例 #5
0
        public ActionResult ShipperToVehicle(string id, int?type)
        {
            ShipperToVehicleViewModel sv = new ShipperToVehicleViewModel()
            {
                Shipper = ApplicationConfigHelper.GetShipperList(),
                Vehicle = ApplicationConfigHelper.GetVehicleList()
            };


            int pagesize = 17;
            var response = new VehicleManagementService().GetAllVehicle(new GetCRMVehicleByConditionRequest()
            {
                PageSize  = pagesize,
                PageIndex = sv.PageIndex,
            });


            if (response.IsSuccess)
            {
                sv.Vehicle   = response.Result.CRMVehicleCollection;
                sv.PageIndex = response.Result.PageIndex;
                sv.PageCount = response.Result.PageCount;
            }

            return(View(sv));
        }
コード例 #6
0
        public JsonResult DeleteCRMVehicle(string id)
        {
            bool response = new VehicleManagementService().DeleteCRMVehicle(id);

            //var response = new VehicleManagementService().DeleteCRMVehicle(id);
            if (response)
            {
                return(Json(new { Message = "删除成功", IsSuccess = true }));
            }
            else
            {
                return(Json(new { Message = "删除失败!", IsSuccess = false }));
            }
        }
コード例 #7
0
        //

        //提交
        public bool AddShipperToVehicle(string shipper, string jsonStr)
        {
            var request  = JsonToModel <CRMCar>(jsonStr);
            var response = new VehicleManagementService().AddShipperToVehicle(new ShipperMappingVehicleRequest
            {
                car         = request,
                ShipperName = shipper,

                UserName = base.UserInfo.Name
            });

            if (response == "操作成功")
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #8
0
        public ActionResult Index(QueryCRMVehicleViewModel vi, int?index, string Action)
        {
            //查询导出
            var request = new GetCRMVehicleByConditionRequest();

            if (Action == "查询" || Action == "Index")
            {
                request.SearchCondition = vi.SearchCondition;
                request.PageSize        = UtilConstants.PAGESIZE;
                request.PageIndex       = vi.PageIndex;
                vi.ShowEditButton       = false;
                //特殊操作
                if (base.UserInfo.ProjectRoleID == 28 || base.UserInfo.ProjectRoleID == 1)
                {
                    vi.ShowEditButton = true;
                }
            }
            else if (Action == "导出")
            {
                request.SearchCondition = vi.SearchCondition;
                request.PageSize        = 0;
                request.PageIndex       = 0;
            }
            var response = new VehicleManagementService().GetCRMVehicleByCondition(request);

            if (response.IsSuccess)
            {
                if (Action == "导出")
                {
                    return(this.Export(response.Result.CRMVehicleCollection));
                }
                else
                {
                    vi.CRMVehicleCollection = response.Result.CRMVehicleCollection;
                    vi.PageIndex            = response.Result.PageIndex;
                    vi.PageCount            = response.Result.PageCount;
                }
            }
            return(View(vi));
        }
コード例 #9
0
        public ActionResult Create(QueryCRMVehicleViewModel vi)
        {
            //string uploadFolderPath = Runbow.TWS.Common.Constants.UPLOAD_FOLDER_PATH;
            //string targetPath = Path.Combine(uploadFolderPath, "AMSTempFile");
            //string url = string.Empty, actualNameInServer = string.Empty, ext = string.Empty;
            if (vi.ViewType == 1)
            {
                vi.CRMVehicle.CreateUser = base.UserInfo.ID.ToString();
                vi.CRMVehicle.CreateTime = DateTime.Now;
            }
            vi.CRMVehicle.UpdateUser = base.UserInfo.ID.ToString();
            vi.CRMVehicle.UpdateTime = DateTime.Now;

            var response = new VehicleManagementService().addCreateVehicle(new GetCRMVehicleByConditionRequest()
            {
                CreateFiles = vi.CRMVehicle
                              //base.UserInfo.Name
            });

            vi.ViewType = 1;
            return(View(vi));
        }