public SearchResult SearchCustomer(Sender sender, SearchCustomerArgs args) { try { using (ObjectProxy op = new ObjectProxy()) { return(op.SearchCustomer(args)); } } catch (Exception ex) { PLogger.LogError(ex); throw ex; } }
public void SearchCustomers() { try { using (ProxyBE p = new ProxyBE()) { SearchCustomerArgs sargs = new SearchCustomerArgs(); sargs.OrderBy = "Created desc"; sargs.RowNumberFrom = pagingParm.RowNumberFrom; sargs.RowNumberTo = pagingParm.RowNumberTo; //Where if (!string.IsNullOrEmpty(parm.CustomerName)) { sargs.CustomerName = parm.CustomerName; } if (!string.IsNullOrEmpty(parm.LinkMan)) { sargs.LinkMan = parm.LinkMan; } if (!string.IsNullOrEmpty(parm.Tel)) { sargs.Tel = parm.Tel; } if (!string.IsNullOrEmpty(parm.Mobile)) { sargs.Mobile = parm.Mobile; } if (!string.IsNullOrEmpty(parm.Fax)) { sargs.Fax = parm.Fax; } if (!string.IsNullOrEmpty(parm.Province)) { sargs.Province = parm.Province; } if (!string.IsNullOrEmpty(parm.City)) { sargs.City = parm.City; } if (!string.IsNullOrEmpty(parm.Address)) { sargs.Address = parm.Address; } if (!string.IsNullOrEmpty(parm.Position)) { sargs.Position = parm.Position; } if (CurrentUser.PartnerID != Guid.Empty) { sargs.PartnerIDs = new List <Guid>(); sargs.PartnerIDs.Add(CurrentUser.PartnerID); } //搜索条件 缺收货地址、联系方式 SearchResult sr = p.Client.SearchCustomer(SenderUser, sargs); Response.Write(JSONHelper.Dataset2Json(sr.DataSet)); } } catch (Exception ex) { WriteError(ex.Message, ex); } }