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); }
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)); }