Ejemplo n.º 1
0
 public HttpResponseMessage UpdateShopping(int ID, string Name, string Date)
 {
     try
     {
         DateTime DateCreate = DateTime.Now;
         try
         {
             DateCreate = DateTime.ParseExact(Date, "yyyy-MM-dd", CultureInfo.InvariantCulture);
         }
         catch (Exception ex)
         {
             return(Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message));
         }
         Shopping  Bll   = new Shopping();
         MShopping Model = new MShopping()
         {
             Id          = ID,
             Name        = Name,
             CreatedDate = DateCreate,
         };
         var Data = Bll.InsertData(Model);
         return(Request.CreateResponse(HttpStatusCode.OK, Data));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message));
     }
 }
Ejemplo n.º 2
0
 public List <MShopping> InsertData(MShopping Model)
 {
     try
     {
         return(dbtran.DbToList <MShopping>("SP_Add_Shopping", new
         {
             Name = Model.Name,
             CreatedDate = Model.CreatedDate
         }, true));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 3
0
 public List <MShopping> UpdateShopping(MShopping Model)
 {
     try
     {
         return(dbtran.DbToList <MShopping>("SP_UPDATE_Shopping", new
         {
             ID = Model.Id,
             Name = Model.Name,
             CreatedDate = Model.CreatedDate,
         }, true));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }