示例#1
0
 public FamilleTier Put([FromBody] FamilleTier ft)
 {
     if (ModelState.IsValid)
     {
         _FamilleTierService.Update(ft);
     }
     return(ft);
 }
示例#2
0
 public FamilleTier Update(FamilleTier fat)
 {
     try
     {
         _FamilleTierRepository.Update(fat);
         return(fat);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#3
0
 public FamilleTier Add(FamilleTier famille)
 {
     try
     {
         _context.FamilleTiers.Add(famille);
         _context.SaveChanges();
         return(famille);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#4
0
 public FamilleTier Update(FamilleTier FamilleTier)
 {
     try
     {
         _context.Update(FamilleTier);
         _context.SaveChanges();
         return(FamilleTier);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        //public FamilleTier GetByClient(int id)
        //{
        //    var res = new FamilleTier();
        //    try
        //    {
        //        using (var db = new XSoftContext())
        //        {
        //            var result = db.Clients.Where(r => r.FamilleTierId.Equals(id)).FirstOrDefault();


        //        }


        //    }
        //    catch (Exception)
        //    {
        //        return null;

        //    }
        //    return res;
        //}

        public FamilleTier Add(FamilleTier dvs)
        {
            try
            {
                _context.FamilleTiers.Add(dvs);
                _context.SaveChanges();
            }
            catch (Exception)
            {
                return(null);
            }
            return(dvs);
        }
 public FamilleTier Update(FamilleTier FamilleTier)
 {
     try
     {
         _context.Update(FamilleTier);
         _context.SaveChanges();
     }
     catch (Exception)
     {
         return(null);
     }
     return(FamilleTier);
 }
 public FamilleTier Update(FamilleTier fat)
 {
     try
     {
         using (IDbConnection dbConnection = Connection)
         {
             string sQuery = @"update F_FamilleTier set  fc_libelle =@libelle , fc_cattarif=@categorietarif,
                             fc_exonere=@exonere   where FC_NO =@Numero ";
             dbConnection.Open();
             dbConnection.Execute(sQuery, fat);
         }
     }
     catch (Exception)
     {
         return(null);
     }
     return(fat);
 }
 public FamilleTier Add(FamilleTier fat)
 {
     try
     {
         using (IDbConnection dbConnection = Connection)
         {
             string sQuery = @"INSERT INTO F_FamilleTier
                             ( fc_code,fc_libelle,fc_cattarif,fc_exonere                )
                              VALUES  (@Code,@Libelle,@CategorieTarif,@Exonere)";
             dbConnection.Open();
             dbConnection.Execute(sQuery, fat);
         }
     }
     catch (Exception)
     {
         return(null);
     }
     return(fat);
 }
示例#9
0
        public FamilleTier GetFamilleTier(int id)
        {
            FamilleTier res = new FamilleTier();

            try
            {
                using (IDbConnection dbConnection = Connection)
                {
                    string sQuery = @"select * from F_FamilleTier Where FC_NO =@Id";
                    dbConnection.Open();
                    res = dbConnection.Query <FamilleTier>(sQuery, new { Id = id }).FirstOrDefault();
                }
            }
            catch (Exception)
            {
                return(null);
            }

            return(res);
        }
        public FamilleTier GetById(int id)
        {
            var res = new FamilleTier();

            try
            {
                using (IDbConnection dbConnection = Connection)
                {
                    string sQuery = @"select  FC_NO as Numero, FC_Code as Code, FC_Libelle as Libelle, FC_Cattarif as CategorieTarif,
                                        Fc_Exonere as Exonere from F_FamilleTier where FC_NO =@Id ";
                    dbConnection.Open();
                    res = dbConnection.Query <FamilleTier>(sQuery, new { Id = id }).FirstOrDefault();
                }
            }
            catch (Exception)
            {
                return(null);
            }
            return(res);
        }
 public FamilleTier Update(FamilleTier fat)
 {
     _FamilleTierRepository.Update(fat);
     return(fat);
 }
        public FamilleTier Add(FamilleTier fat)
        {
            _FamilleTierRepository.Add(fat);

            return(fat);
        }