Ejemplo n.º 1
0
 /*删除用户反馈信息的业务逻辑*/
 public void DeleteSuggestion(Suggestion suggestion)
 {
     try
     {
         mRepository.DeleteSuggestion(suggestion, true);
     }
     catch(Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 2
0
 /*用户给超市发布反馈信息的业务逻辑*/
 public void InsertSuggestion(Suggestion suggestion)
 {
     suggestion.date = DateTime.Now;
     try
     {
         mRepository.InsertSuggestion(suggestion, true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 3
0
 public bool AddSuggestion(Suggestion suggestion)
 {
     SuggestionBL bl = new SuggestionBL();
     try
     {
         bl.InsertSuggestion(suggestion);
         return true;
     }
     catch
     {
         return false;
     }
 }
Ejemplo n.º 4
0
        public void InsertSuggestion(Suggestion suggestion, bool isImmediateSave)
        {
            try
            {
                mContext.Suggestions.AddObject(suggestion);

                if (isImmediateSave)
                {
                    mContext.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                // TODO: Add exception handling code here.
                throw ex;
            }
        }
Ejemplo n.º 5
0
        public void UpdateSuggestion(Suggestion suggestion, Suggestion origSuggestion, bool isImmediateSave)
        {
            try
            {
                mContext.Suggestions.Attach(origSuggestion);
                mContext.Suggestions.ApplyCurrentValues(suggestion);

                if (isImmediateSave)
                {
                    mContext.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                // TODO: Add exception handling code here.
                throw ex;
            }
        }
Ejemplo n.º 6
0
 /// <summary>
 /// 用于向 Suggestions EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet&lt;T&gt; 属性的 .Add 方法。
 /// </summary>
 public void AddToSuggestions(Suggestion suggestion)
 {
     base.AddObject("Suggestions", suggestion);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 创建新的 Suggestion 对象。
 /// </summary>
 /// <param name="id">id 属性的初始值。</param>
 /// <param name="description">description 属性的初始值。</param>
 /// <param name="date">date 属性的初始值。</param>
 public static Suggestion CreateSuggestion(global::System.Int32 id, global::System.String description, global::System.DateTime date)
 {
     Suggestion suggestion = new Suggestion();
     suggestion.id = id;
     suggestion.description = description;
     suggestion.date = date;
     return suggestion;
 }