public bool Post(SalesOrderPlanEntity SalesOrderPlanEntity)
 {
     try
     {
         return(_SalesOrderService.InsertSalesOrderPlan(SalesOrderPlanEntity));
     }
     catch (Exception ex)
     {
         throw new ApiDataException(1000, "Category Not Found", HttpStatusCode.NotFound);
     }
 }
 public bool Put(SalesOrderPlanEntity SalesOrderPlanEntity)
 {
     try
     {
         if (SalesOrderPlanEntity.OrderSetID > 0)
         {
             return(_SalesOrderService.UpdateSalesOrderPlan(SalesOrderPlanEntity.OrderSetID, SalesOrderPlanEntity));
         }
     }
     catch (Exception ex)
     {
         throw new ApiDataException(1000, "Product not found", HttpStatusCode.NotFound);
     }
     return(false);
 }
예제 #3
0
        //public IEnumerable<SalesOrderMasterEntity> get(int OrderID,int ActionBy)
        //{
        //    SqlCommand cmd = new SqlCommand("SO_spFetchSalesOrder");
        //    cmd.CommandType = CommandType.StoredProcedure;
        //    cmd.Parameters.AddWithValue("@p_OrderID", OrderID);
        //    cmd.Parameters.AddWithValue("@p_ActionBy",ActionBy);
        //    var locMas = _unitOfWork.DbLayer.GetEntityList<SalesOrderMasterEntity>(cmd);
        //    return locMas;
        //}


        public bool InsertSalesOrderPlan(SalesOrderPlanEntity obj)
        {
            bool       res = false;
            SqlCommand cmd = new SqlCommand("SO_spSavePlanning");

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@p_OrderSetID", obj.OrderSetID);
            cmd.Parameters.AddWithValue("@p_SOID", obj.SOID);
            cmd.Parameters.AddWithValue("@p_SORefID", obj.SORefID);
            cmd.Parameters.AddWithValue("@p_Quantity", obj.Quantity);
            cmd.Parameters.AddWithValue("@p_Deliverydate", obj.Deliverydate);
            cmd.Parameters.AddWithValue("@p_OrdAckSdate ", obj.OrdAckSdate);
            cmd.Parameters.AddWithValue("@p_OrdAckEdate ", obj.OrdAckEdate);
            cmd.Parameters.AddWithValue("@p_MatRcvInFacSdate", obj.MatRcvInFacSdate);
            cmd.Parameters.AddWithValue("@p_MatRcvInFacEdate", obj.MatRcvInFacEdate);
            cmd.Parameters.AddWithValue("@p_MatInFlowSdate", obj.MatInFlowSdate);
            cmd.Parameters.AddWithValue("@p_MatInFlowEdate", obj.MatInFlowEdate);
            cmd.Parameters.AddWithValue("@p_AssembleSdate", obj.AssembleSdate);
            cmd.Parameters.AddWithValue("@p_AssembleEdate", obj.AssembleEdate);
            cmd.Parameters.AddWithValue("@p_HydrolicSdate", obj.HydrolicSdate);
            cmd.Parameters.AddWithValue("@p_HydrolicEdate", obj.HydrolicEdate);
            cmd.Parameters.AddWithValue("@p_PerfTestSdate", obj.PerfTestSdate);
            cmd.Parameters.AddWithValue("@p_PerfTestEdate", obj.PerfTestEdate);
            cmd.Parameters.AddWithValue("@p_PaintingSdate", obj.PaintingSdate);
            cmd.Parameters.AddWithValue("@p_PaintingEdate", obj.PaintingEdate);
            cmd.Parameters.AddWithValue("@p_FinalInspSdate", obj.FinalInspSdate);
            cmd.Parameters.AddWithValue("@p_FinalInspEdate", obj.FinalInspEdate);
            cmd.Parameters.AddWithValue("@p_PackingSdate", obj.PackingSdate);
            cmd.Parameters.AddWithValue("@p_PackingEdate", obj.PackingEdate);
            var locMax = _unitOfWork.DbLayer.ExecuteNonQuery(cmd);

            if (locMax != Int32.MaxValue)
            {
                res = true;
            }
            return(res);
        }