public bool Post(PurchaseOrderMasterEntity PurchaseOrderMasterEntity)
 {
     try
     {
         return(_PurchaseOrderMasterservice.Create(PurchaseOrderMasterEntity));
     }
     catch (Exception ex)
     {
         throw new ApiDataException(1000, "Category Not Found", HttpStatusCode.NotFound);
     }
 }
 public bool Put(PurchaseOrderMasterEntity PurchaseOrderMasterEntity)
 {
     try
     {
         if (PurchaseOrderMasterEntity.PurchaseID > 0)
         {
             return(_PurchaseOrderMasterservice.Update(PurchaseOrderMasterEntity.PurchaseID, PurchaseOrderMasterEntity));
         }
     }
     catch (Exception ex)
     {
         throw new ApiDataException(1000, "Product not found", HttpStatusCode.NotFound);
     }
     return(false);
 }
Esempio n. 3
0
        public bool Update(int PurchaseID, PurchaseOrderMasterEntity obj)
        {
            bool       res = false;
            SqlCommand cmd = new SqlCommand("PO_spSavePurchaseOrder");

            //SqlCommand cmd = new SqlCommand("PO_spSavePurchaseOrder");
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@p_PurchaseID", obj.PurchaseID);
            cmd.Parameters.AddWithValue("@p_Code", obj.Code);
            cmd.Parameters.AddWithValue("@p_SupplierID", obj.SupplierID);
            cmd.Parameters.AddWithValue("@p_PurchaseDate", obj.PurchaseDate);
            cmd.Parameters.AddWithValue("@p_ExpectDeliveryDate", obj.ExpectDeliveryDate);
            cmd.Parameters.AddWithValue("@p_MaterialType", obj.MaterialType);
            cmd.Parameters.AddWithValue("@p_ActionBy", obj.ActionBy);
            cmd.Parameters.AddWithValue("@p_IsActive", obj.IsActive);
            cmd.Parameters.AddWithValue("@p_OrderDetails", obj.OrderDetails);
            var locMas = _unitOfWork.DbLayer.ExecuteNonQuery(cmd);

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