public Response <DeliveryOrderManagementResponse> GetReturnOrderBLL(DeliveryOrderManagementRequest request) { Response <DeliveryOrderManagementResponse> response = new Response <DeliveryOrderManagementResponse>() { Result = new DeliveryOrderManagementResponse() }; if (request == null) { ArgumentNullException ex = new ArgumentNullException("pro_wms_SampleReturnOrder request"); response.Exception = ex; return(response); } try { response.Result = accessor.GetReturnOrderDAL(request); response.IsSuccess = true; } catch (Exception ex) { LogError(ex); response.IsSuccess = false; } return(response); }
public string SaveOrderBLL(DeliveryOrderManagementRequest request) { string str = string.Empty; try { str = accessor.SaveOrderDAL(request); } catch (Exception ex) { LogError(ex); } return(str); }
/// <summary> /// Save创建半成品订单 /// </summary> /// <param name="request"></param> /// <returns></returns> public string SaveOrderDAL(DeliveryOrderManagementRequest request) { DataTable dt = ModelToTable(request.DeliveryOrderinfo).DefaultView.ToTable(false, new string[] { "UPC", "Season", "RequireQTY" }); string result = string.Empty; using (SqlConnection conn = new SqlConnection(connStr)) { try { SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; if (request.Operation == '1') { cmd.CommandText = "pro_wms_SampleCreateOrder"; } else if (request.Operation == '2') { cmd.CommandText = "pro_wms_DeleteOrderDetail"; } //SqlCommand cmd = new SqlCommand("pro_wms_SampleCreateOrder", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@DeliveryOrder", dt); cmd.Parameters[0].SqlDbType = SqlDbType.Structured; cmd.Parameters.AddWithValue("@UserName", request.UserName); cmd.Parameters[1].SqlDbType = SqlDbType.NVarChar; cmd.Parameters[1].Size = 50; cmd.Parameters.AddWithValue("@Result", ""); cmd.Parameters[2].Direction = ParameterDirection.Output; cmd.Parameters[2].SqlDbType = SqlDbType.VarChar; cmd.Parameters[2].Size = 8000; conn.Open(); cmd.CommandTimeout = 180; cmd.ExecuteNonQuery(); result = cmd.Parameters[2].Value.ToString(); conn.Close(); } catch (Exception) { throw; } } return(result); }
public DeliveryOrderManagementResponse GetReturnOrderDAL(DeliveryOrderManagementRequest request) { DeliveryOrderManagementResponse Responest = new DeliveryOrderManagementResponse(); using (SqlConnection conn = new SqlConnection(connStr)) { try { SqlCommand cmd = new SqlCommand("pro_wms_SampleReturnOrder", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@UserName", request.UserName); cmd.Parameters[0].SqlDbType = SqlDbType.NVarChar; cmd.Parameters[0].Size = 100; cmd.Parameters.AddWithValue("@PageIndex", request.PageIndex); cmd.Parameters[1].SqlDbType = SqlDbType.Int; cmd.Parameters.AddWithValue("@PageSize", request.PageSize); cmd.Parameters[2].SqlDbType = SqlDbType.Int; cmd.Parameters.AddWithValue("@RowCount", 0); cmd.Parameters[3].Direction = ParameterDirection.Output; cmd.Parameters[3].SqlDbType = SqlDbType.Int; conn.Open(); SqlDataAdapter sda = new SqlDataAdapter(); cmd.CommandTimeout = 180; sda.SelectCommand = cmd; sda.Fill(ds); Responest.PageCount = (int)cmd.Parameters[3].Value; Responest.PageIndex = request.PageIndex; Responest.EnumerableDeliveryOrder = ds.ConvertToEntityCollection <DeliveryOrder>(); conn.Close(); } catch (Exception) { throw; } } return(Responest); }