/// <summary> /// 导出 /// </summary> /// <param name="request"></param> /// <returns></returns> public Response <GetASNDetailByConditionResponse> GetExportAsnandDetailByCondition(GetASNByConditionRequest request) { Response <GetASNDetailByConditionResponse> response = new Response <GetASNDetailByConditionResponse>() { Result = new GetASNDetailByConditionResponse() }; if (request == null || request.SearchCondition == null) { ArgumentNullException ex = new ArgumentNullException("GetExportAsnandDetailByCondition request"); LogError(ex); response.ErrorCode = ErrorCode.Argument; response.Exception = ex; return(response); } try { ASNManagementAccessor accessor = new ASNManagementAccessor(); response.Result = accessor.GetExportAsnandDetailByCondition(request.SearchCondition); response.IsSuccess = true; } catch (Exception ex) { LogError(ex); response.Exception = ex; response.IsSuccess = false; response.ErrorCode = ErrorCode.Technical; } return(response); }
//明细单条的查看或者编辑 public Response <ASNAndASNDetail> GetASNInfosSF(GetASNByConditionRequest request) { Response <ASNAndASNDetail> response = new Response <ASNAndASNDetail>(); if (request == null) { ArgumentNullException ex = new ArgumentNullException("GetASNByConditionRequest request"); LogError(ex); response.ErrorCode = ErrorCode.Argument; response.Exception = ex; return(response); } try { ASNManagementAccessor accessor = new ASNManagementAccessor(); response.Result = accessor.GetASNInfosSF(request.ID); response.IsSuccess = true; } catch (Exception ex) { LogError(ex); response.IsSuccess = false; response.ErrorCode = ErrorCode.Technical; } return(response); }
/// <summary> /// 根据单号查扫描情况 /// </summary> /// <param name="AsnNumber"></param> /// <returns></returns> public Response <GetASNByConditionResponse> GetASNScanByAsnNumber(string AsnNumber) { Response <GetASNByConditionResponse> response = new Response <GetASNByConditionResponse>() { Result = new GetASNByConditionResponse() }; try { ASNManagementAccessor accessor = new ASNManagementAccessor(); response.Result = accessor.GetASNScanByAsnNumber(AsnNumber); response.IsSuccess = true; } catch (Exception ex) { LogError(ex); response.Exception = ex; response.IsSuccess = false; response.ErrorCode = ErrorCode.Technical; } return(response); }
public Response <GetASNDetailByConditionResponse> GetASNDetailByConditionResponseSF(GetASNByConditionRequest request) { Response <GetASNDetailByConditionResponse> response = new Response <GetASNDetailByConditionResponse>() { Result = new GetASNDetailByConditionResponse() }; if (request == null || request.SearchCondition == null) { ArgumentNullException ex = new ArgumentNullException("GetASNDetailByConditionResponse request"); LogError(ex); response.ErrorCode = ErrorCode.Argument; response.Exception = ex; return(response); } try { ASNManagementAccessor accessor = new ASNManagementAccessor(); int RowCount; response.Result = accessor.GetASNandasndetailByConditionSF(request.SearchCondition, request.PageIndex, request.PageSize, out RowCount); response.Result.PageCount = RowCount % request.PageSize == 0 ? RowCount / request.PageSize : RowCount / request.PageSize + 1; response.Result.PageIndex = request.PageIndex; response.IsSuccess = true; } catch (Exception ex) { LogError(ex); response.Exception = ex; response.IsSuccess = false; response.ErrorCode = ErrorCode.Technical; } return(response); }
/// <summary> /// 根据状态查询明细 /// </summary> /// <param name="search"></param> /// <param name="type"></param> /// <returns></returns> public Response <GetASNByConditionResponse> SearchReceiptOrderTotal(ASNSearchCondition search, int type) { Response <GetASNByConditionResponse> response = new Response <GetASNByConditionResponse>() { Result = new GetASNByConditionResponse() }; if (search == null) { ArgumentNullException ex = new ArgumentNullException("GetASNStatusByConditionRequest request"); LogError(ex); response.ErrorCode = ErrorCode.Argument; response.Exception = ex; return(response); } try { ASNManagementAccessor accessor = new ASNManagementAccessor(); response.Result.ASNCollection = accessor.SearchReceiptOrderTotal(search, type); response.IsSuccess = true; } catch (Exception ex) { LogError(ex); response.Exception = ex; response.IsSuccess = false; response.ErrorCode = ErrorCode.Technical; } return(response); }
///查询取消入库单数据 public Response <GetASNDetailByConditionResponse> GetCancelAsnAndAsnDetail(string strwhere) { Response <GetASNDetailByConditionResponse> response = new Response <GetASNDetailByConditionResponse>() { Result = new GetASNDetailByConditionResponse() }; try { ASNManagementAccessor accessor = new ASNManagementAccessor(); response.Result = accessor.GetCancelAsnAndAsnDetail(strwhere); response.IsSuccess = true; } catch (Exception ex) { LogError(ex); response.Exception = ex; response.IsSuccess = false; response.ErrorCode = ErrorCode.Technical; } return(response); }
/// <summary> /// 导入包装信息 /// </summary> /// <param name="packageinfo"></param> /// <param name="Proc">调用不同存储过程</param> /// <returns></returns> public Response <string> ImportPackageInfo(AddPackageAndDetailRequest Requset, string Proc) { Response <string> response = new Response <string>(); string error = string.Empty; try { error = new ASNManagementAccessor().ImportPackageInfo(Requset, Proc); if (error == "1") { response.IsSuccess = true; } else { response.IsSuccess = false; response.SuccessMessage = error; } } catch (Exception ex) { LogError(ex); response.IsSuccess = false; response.SuccessMessage = ex.Message; response.ErrorCode = ErrorCode.Technical; } return(response); }
//批量完成操作 public bool CompletALLSelect(string asnid) { bool ve = true; try { ve = new ASNManagementAccessor().CompletALLSelect(asnid); } catch (Exception ex) { LogError(ex); } return(ve); }
//NIKE退货仓- public int UDnewboxPrintedTimes(string customerid, string warehouseid, string boxids) { int s = 0; try { s = new ASNManagementAccessor().UDnewboxPrintedTimes(customerid, warehouseid, boxids); } catch (Exception ex) { throw ex; } return(s); }
public int ExternKeyCheck_TH(string pon, string ern, string plno, string flag, long CustomerID) { int i = 0; try { i = new ASNManagementAccessor().ExternKeyCheck_TH(pon, ern, plno, flag, CustomerID); } catch (Exception ex) { LogError(ex); } return(i); }
//NIKE退货仓- public int Insertnewbox(string customerid, string ExternReceiptNumber, int total, string warehouseid, string GoodsType) { int s = 0; try { s = new ASNManagementAccessor().Insertnewbox(customerid, ExternReceiptNumber, total, warehouseid, GoodsType); } catch (Exception ex) { throw ex; } return(s); }
public string AsnScanQtyUpdate(string AsnNumber, string str2, string SKU, string Creator) { string message = ""; try { message = new ASNManagementAccessor().AsnScanQtyUpdate(AsnNumber, str2, SKU, Creator); } catch (Exception ex) { message = ex.Message; } return(message); }
public int CountAsn(string ExternNumber, long customerID) { int s = 0; try { s = new ASNManagementAccessor().CountAsn(ExternNumber, customerID); } catch (Exception ex) { LogError(ex); } return(s); }
public IEnumerable <Receipt> CountReceipt(int ID) { IEnumerable <Receipt> s = new List <Receipt>(); try { s = new ASNManagementAccessor().CountReceipt(ID); } catch (Exception ex) { LogError(ex); } return(s); }
//完成操作 public bool Complet(int ID) { bool ve = true; try { ve = new ASNManagementAccessor().Complet(ID); } catch (Exception ex) { LogError(ex); } return(ve); }
//批量取消操作 public bool StatusBacks(string asnid) { bool ve = true; try { ve = new ASNManagementAccessor().StatusBacks(asnid); } catch (Exception ex) { LogError(ex); } return(ve); }
public int ExternKeyCheckSF(string keys, string flag, long CustomerID) { int i = 0; try { i = new ASNManagementAccessor().ExternKeyCheckSF(keys, flag, CustomerID); } catch (Exception ex) { LogError(ex); } return(i); }
public List <ASNDetail> CheckDiffReturn(string AsnNumber, string ScanBoxNumber) { List <ASNDetail> lists = new List <ASNDetail>(); try { ASNManagementAccessor accessor = new ASNManagementAccessor(); lists = accessor.CheckDiffReturn(AsnNumber, ScanBoxNumber); } catch (Exception ex) { } return(lists); }
public string ClearAsnBoxNumber(string AsnNumber, string ScanBoxNumber) { string response = ""; try { ASNManagementAccessor accessor = new ASNManagementAccessor(); response = accessor.ClearAsnBoxNumber(AsnNumber, ScanBoxNumber); } catch (Exception ex) { response = ex.Message; } return(response); }
/// <summary> /// 根据状态查询明细 /// </summary> /// <param name="search"></param> /// <param name="type"></param> /// <returns></returns> public Response <int> TurnASN(int Id, int CustomerId) { Response <int> response = new Response <int>() { Result = 0 }; try { ASNManagementAccessor accessor = new ASNManagementAccessor(); response.Result = accessor.TurnASN(Id, CustomerId); response.IsSuccess = true; } catch (Exception ex) { LogError(ex); response.Exception = ex; response.IsSuccess = false; response.ErrorCode = ErrorCode.Technical; } return(response); }
//导出选中 public Response <GetASNDetailByConditionResponse> GetReceiptByIDs(string IDs) { Response <GetASNDetailByConditionResponse> response = new Response <GetASNDetailByConditionResponse>() { Result = new GetASNDetailByConditionResponse() }; try { ASNManagementAccessor accessor = new ASNManagementAccessor(); //int RowCount; //if (request.PageSize > 0) //{ response.Result = accessor.GetReceiptByIDs(IDs); //} //else //{ // response.Result.PageIndex = 0; // response.Result.PageCount = 0; // response.Result.ReceiptCollection = accessor.GetWarehouseByConditionNoPaging(request.SearchCondition); //} response.IsSuccess = true; } catch (Exception ex) { LogError(ex); response.Exception = ex; response.IsSuccess = false; response.ErrorCode = ErrorCode.Technical; } return(response); }
/// <summary> /// 添加操作 /// </summary> /// <param name="request"></param> /// <returns></returns> public Response <string> AddasnAndasnDetailSF(AddASNandASNDetailRequest request) { Response <string> response = new Response <string>(); string message = ""; if (request == null || request.asn == null || !request.asn.Any()) { ArgumentNullException ex = new ArgumentNullException("AddasnAndasnDetail request"); LogError(ex); response.ErrorCode = ErrorCode.Argument; response.Exception = ex; response.Result = ex.ToString(); response.IsSuccess = false; return(response); } try { //判断明细中同一外部单号中是否存在相同的sku 如果存在就提示 DataTable dt = request.asnDetails.ToDataTable(); if (request.asn.Select(c => c.CustomerID).ToArray().FirstOrDefault() != 71) {//永兴判断 var dt1 = from t in dt.AsEnumerable() group t by new { t1 = t.Field <string>("ExternReceiptNumber"), t2 = t.Field <string>("SKU"), UPC = t.Field <string>("UPC"), t3 = t.Field <string>("BoxNumber"), t4 = t.Field <string>("BatchNumber"), t5 = t.Field <string>("Unit"), t6 = t.Field <string>("Specifications") } into m select new { SKU = m.Select(p => p.Field <string>("SKU")).First(), UPC = m.Select(p => p.Field <string>("UPC")).First(), ExternReceiptNumber = m.Select(p => p.Field <string>("ExternReceiptNumber")).First(), BoxNumber = m.Select(p => p.Field <string>("BoxNumber")).First(), BatchNumber = m.Select(p => p.Field <string>("BatchNumber")).First(), Unit = m.Select(p => p.Field <string>("Unit")).First(), Specifications = m.Select(p => p.Field <string>("Specifications")).First(), count = m.Count(), }; var dr1 = dt1.Where(c => c.count > 1); var results = ""; if (request.asn.Select(c => c.CustomerID).ToArray().FirstOrDefault() != 74 && request.asn.Select(c => c.CustomerID).ToArray().FirstOrDefault() != 75) { //if (dr1.Count() > 0) //{ // foreach (var item in dr1) // { // results += "<p><font color='#FF0000'>外部单号" + item.ExternReceiptNumber + "中的SKU" + item.SKU + "存在重复值!" + "</font></p>"; // } // response.Result = results; // response.IsSuccess = false; // return response; //} } }//永兴判断 message = new ASNManagementAccessor().AddasnAndasnDetailSF(request); if (message.Contains("添加成功") || message == "") { response.Result = message; response.IsSuccess = true; } else { response.Result = message; response.IsSuccess = false; } } catch (Exception ex) { LogError(ex); response.IsSuccess = false; response.Result = ex.ToString(); response.ErrorCode = ErrorCode.Technical; } return(response); }