Exemplo n.º 1
0
        public bool Create(ExtendCreateDTO req)
        {
            using (var db = new SqlSugarClient(Connection))
            {
                bool result = true;

                R_ProjectExtend model = new R_ProjectExtend()
                {
                    Name                   = req.Name,
                    Description            = req.Description,
                    CyxmKzType             = req.CyxmKzType,
                    Price                  = req.Price,
                    Unit                   = req.Unit,
                    R_ProjectExtendType_Id = req.ExtendType,
                    R_Company_Id           = req.R_Company_Id
                };

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

                return(result);
            }
        }
Exemplo n.º 2
0
 public bool Update(ExtendCreateDTO req)
 {
     using (var db = new SqlSugarClient(Connection))
     {
         bool            result = true;
         R_ProjectExtend model  = new R_ProjectExtend()
         {
             Name                   = req.Name,
             Description            = req.Description,
             Id                     = req.Id,
             CyxmKzType             = req.CyxmKzType,
             Price                  = req.Price,
             Unit                   = req.Unit,
             R_ProjectExtendType_Id = req.ExtendType
         };
         result = db.Update(model);
         return(result);
     }
 }