Exemplo n.º 1
0
        public bool Create(StallsCreateDTO req)
        {
            using (var db = new SqlSugarClient(Connection))
            {
                bool    result = true;
                R_Stall model  = new R_Stall()
                {
                    Name        = req.Name,
                    Description = req.Description,
                    Print_Id    = req.Print_Id
                };

                if (db.Insert(model) == null)
                {
                    result = false;
                }

                return(result);
            }
        }
Exemplo n.º 2
0
 public bool Update(StallsCreateDTO req)
 {
     using (var db = new SqlSugarClient(Connection))
     {
         bool    result = true;
         R_Stall model  = new R_Stall()
         {
             Id          = req.Id,
             Name        = req.Name,
             Description = req.Description
         };
         //result = db.Update(model);
         result = db.Update <R_Stall>(
             new
         {
             Name         = req.Name,
             Description  = req.Description,
             Print_Id     = req.Print_Id,
             R_Company_Id = req.R_Company_Id,
         }, x => x.Id == req.Id);
         return(result);
     }
 }