public bool Update(int OrderID, SalesOrderMaster obj) { bool res = false; SqlCommand cmd = new SqlCommand("SO_spSaveSalesOrder"); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@p_OrderID", obj.OrderID); // cmd.Parameters.AddWithValue("@p_CODE", obj.CODE); cmd.Parameters.AddWithValue("@p_OrderDate", obj.OrderDate); cmd.Parameters.AddWithValue("@p_ACKDate", obj.ACKDate); cmd.Parameters.AddWithValue("@p_AssignedTo", obj.AssignedTo); cmd.Parameters.AddWithValue("@p_ActionBy ", obj.ActionBy); cmd.Parameters.AddWithValue("@p_IsActive", obj.IsActive); cmd.Parameters.AddWithValue("@p_CustomerID", obj.CustId); cmd.Parameters.AddWithValue("@p_OrderTakenBy", obj.OrderTakenBy); cmd.Parameters.AddWithValue("@p_OrderStatus", obj.OrderStatus); cmd.Parameters.AddWithValue("@p_OrderDetails", obj.OrderDetails); var locMas = _unitOfWork.DbLayer.ExecuteNonQuery(cmd); if (locMas != Int32.MaxValue) { res = true; } return(res); }
public bool Post(SalesOrderMaster SalesOrderMasterEntity) { try { return(_SalesOrderService.Create(SalesOrderMasterEntity)); } catch (Exception ex) { throw new ApiDataException(1000, "Category Not Found", HttpStatusCode.NotFound); } }
public Object SaveSalesOrder(dynamic data) { SalesOrderMaster salesOrderMaster = JsonConvert.DeserializeObject <SalesOrderMaster>(data.ToString()); _salesOrderLogic.AddorUpdate(salesOrderMaster); return(new { success = true, SalesOrderMaster = new { Record = salesOrderMaster, TotalRecords = 1 }, SalesOrderDetails = new { Record = salesOrderMaster.SalesOrderDetails, TotalRecords = salesOrderMaster.SalesOrderDetails.Count } }); }
public bool Put(SalesOrderMaster SalesOrderMaster) { try { if (SalesOrderMaster.OrderID > 0) { return(_SalesOrderService.Update(SalesOrderMaster.OrderID, SalesOrderMaster)); } } catch (Exception ex) { throw new ApiDataException(1000, "Product not found", HttpStatusCode.NotFound); } return(false); }
public SalesOrderMaster AddorUpdate(SalesOrderMaster master) { _salesOrderMasterRepository.AddOrUpdate(master); _salesOrderMasterRepository.SaveChanges(); return(master); }