Пример #1
0
 public bool Post(SaveGRNEntity GRNMasterEntity)
 {
     try
     {
         return(_GrnPOService.SaveGRNPO(GRNMasterEntity));
     }
     catch (Exception ex)
     {
         throw new ApiDataException(1000, "Category Not Found", HttpStatusCode.NotFound);
     }
 }
Пример #2
0
        //public bool Create(GrnEntity obj)
        //{
        //    bool res = false;
        //    SqlCommand cmd = new SqlCommand("GRN_spSaveGRNPO");
        //    cmd.CommandType = CommandType.StoredProcedure;
        //    //cmd.Parameters.AddWithValue("@p_GrnNo", obj.GrnNo);
        //    cmd.Parameters.AddWithValue("@p_PurchaseID", obj.PurchaseID);
        //    cmd.Parameters.AddWithValue("@p_InvoiceNo", obj.InvoiceNo);
        //    cmd.Parameters.AddWithValue("@p_InvoiceDate", obj.InvoiceDate);
        //    cmd.Parameters.AddWithValue("@p_Remarks", obj.Remarks);
        //    //cmd.Parameters.AddWithValue("@p_StatusID", obj.StatusID);
        //    cmd.Parameters.AddWithValue("@p_ActionBy", obj.ActionBy);
        //    cmd.Parameters.AddWithValue("@p_IsActive", obj.IsActive);
        //    cmd.Parameters.AddWithValue("@p_MaterialType", obj.MaterialType);
        //    cmd.Parameters.AddWithValue("@p_PODetails", obj.PODetails);
        //    var locMax = _unitOfWork.DbLayer.ExecuteNonQuery(cmd);
        //    if (locMax != Int32.MaxValue)
        //    {
        //        res = true;
        //    }
        //    return res;
        //}


        public bool SaveGRNPO(SaveGRNEntity obj)
        {
            bool       res = false;
            SqlCommand cmd = new SqlCommand("GRN_spSaveGRNPO");

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@p_PurchaseID", obj.PurchaseID);
            cmd.Parameters.AddWithValue("@p_InvoiceNo", obj.InvoiceNo);
            cmd.Parameters.AddWithValue("@p_InvoiceDate", obj.InvoiceDate);
            cmd.Parameters.AddWithValue("@p_Remarks", obj.Remarks);
            cmd.Parameters.AddWithValue("@p_ActionBy", obj.ActionBy);
            cmd.Parameters.AddWithValue("@p_IsActive", obj.IsActive);
            cmd.Parameters.AddWithValue("@p_MaterialType", obj.MaterialType);
            cmd.Parameters.AddWithValue("@p_PODetails", obj.PODetails);
            var locMax = _unitOfWork.DbLayer.ExecuteNonQuery(cmd);

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