Ejemplo n.º 1
0
 public ReturnType AddRateContent(RateContent rateContent)
 {
     try
     {
         using (AladingEntities alading = new AladingEntities(AppSettings.GetConnectionString()))
         {
             alading.AddToRateContent(rateContent);
             if (alading.SaveChanges() == 1)
             {
                 return(ReturnType.Success);
             }
             else
             {
                 return(ReturnType.PropertyExisted);
             }
         }
     }
     catch (SqlException sex)
     {
         return(ReturnType.ConnFailed);
     }
     catch (Exception ex)
     {
         return(ReturnType.OthersError);
     }
 }
Ejemplo n.º 2
0
        /*删除*/
        public ReturnType RemoveRateContent(RateContent rateContent)
        {
            try
            {
                using (AladingEntities alading = new AladingEntities(AppSettings.GetConnectionString()))
                {
                    var result = alading.RateContent.Where(v => v.TradeRateContent == rateContent.TradeRateContent);
                    foreach (RateContent s in result.ToList())
                    {
                        alading.DeleteObject(s);
                    }

                    alading.SaveChanges();
                    return(ReturnType.Success);
                }
            }
            catch (SqlException sex)
            {
                return(ReturnType.ConnFailed);
            }
            catch (System.Exception ex)
            {
                return(ReturnType.OthersError);
            }
        }
Ejemplo n.º 3
0
 /*删除*/
 public static ReturnType RemoveRateContent(RateContent rateContent)
 {
     return(DataProviderClass.Instance().RemoveRateContent(rateContent));
 }