public ActionResult CRMShipperCooperationManage(CRMShipperCooperationManageViewModel vm) { IList <CRMShipperCooperation> cooperations = new List <CRMShipperCooperation>(); StringBuilder productTypesSB = new StringBuilder(); if (vm.PostedProductTypes != null && vm.PostedProductTypes.Any()) { vm.PostedProductTypes.Each((i, p) => { productTypesSB.Append(p).Append("|"); }); productTypesSB.Remove(productTypesSB.Length - 1, 1); } cooperations.Add(new CRMShipperCooperation() { CRMShipperID = vm.CRMShipperID, Name = vm.Name, Remark = vm.Remark, AttachmentGroupID = vm.AttachmentGroupID, Str1 = vm.Str1, Str2 = vm.Str2, Str3 = vm.Str3, Str4 = vm.Str4, Str5 = vm.Str5, Str6 = vm.Str6, Str7 = productTypesSB.ToString(), Str8 = vm.Str8, Str9 = vm.Str9, Str10 = vm.Str10 }); new ShipperManagementService().AddOrUpdateCRMShipperCooperations(new AddOrUpdateCRMShipperCooperationsRequest() { CRMShipperCooperationCollection = cooperations }); return(RedirectToAction("CRMShipperCooperationManage", new { id = vm.CRMShipperID, ViewType = vm.ViewType })); }
public ActionResult CRMShipperCooperationManage(long id, int?ViewType) { CRMShipperCooperationManageViewModel vm = new CRMShipperCooperationManageViewModel(); vm.CRMShipperID = id; vm.ViewType = ViewType ?? 0; vm.AttachmentGroupID = Guid.NewGuid().ToString(); var getCRMShipperCooperationsResponse = new ShipperManagementService().GetCRMShipperCooperations(new CRMShipperOperationRequest() { CRMShipperID = id }); if (getCRMShipperCooperationsResponse.IsSuccess) { vm.CRMShipperCooperationCollection = getCRMShipperCooperationsResponse.Result; } return(View(vm)); }