/// <summary> /// 提交反馈 /// </summary> /// <param name="userId">用户id</param> /// <param name="title">标题</param> /// <param name="content">内容</param> /// <returns></returns> public ApiResult <dynamic> PostFeedBackData() { ApiResult <dynamic> api = new ApiResult <dynamic>(); try { string userId = Common.GetString("userId"); string title = Common.GetString("title"); string content = Common.GetString("content"); FeedBackEntity feedBackEntity = new FeedBackEntity(); feedBackEntity.F_UserId = userId; feedBackEntity.F_Content = content; feedBackEntity.F_Title = title; FeedBackApp feedBackApp = new FeedBackApp(); feedBackApp.SubmitForm(feedBackEntity, string.Empty); api.Message = "提交成功"; api.Status = true; return(api); } catch (Exception e) { api.Message = e.Message; return(api); } }
private bool ExecuteNonQuery(string commandText, FeedBackEntity entity) { List <MySqlParameter> paramsList = GetMySqlParameters(entity); int result = MySqlHelper.ExecuteNonQuery(this.ConnectionString, commandText, paramsList.ToArray()); return(base.ExecuteStatus(result)); }
public void SubmitForm(FeedBackEntity userEntity, string keyValue) { if (!string.IsNullOrEmpty(keyValue)) { userEntity.Modify(keyValue); } else { userEntity.CreateSimple(); } service.SubmitForm(userEntity, keyValue); }
FeedBackEntity getFeedBack() { FeedBackEntity feedback = new FeedBackEntity(); feedback.Id = Guid.NewGuid(); feedback.UserName = Util.CurrentUserName; feedback.Message = Filter.GetStringNoHtml(txtMessage.Text.Trim(), FeedBackFields.Message.MaxLength); feedback.Sender = Filter.GetStringNoHtml(txtSender.Text.Trim(), FeedBackFields.Sender.MaxLength); feedback.SenderEmail = Filter.GetMaxString(txtSenderEmail.Text.Trim(), FeedBackFields.SenderEmail.MaxLength); feedback.UserIp = WebUtility.GetUserIP(); return feedback; }
public bool Delete(Guid Id) { bool toReturn = false; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { FeedBackEntity _FeedBackEntity = new FeedBackEntity(Id); if (adapter.FetchEntity(_FeedBackEntity)) { adapter.DeleteEntity(_FeedBackEntity); toReturn = true; } } return toReturn; }
private List <MySqlParameter> GetMySqlParameters(FeedBackEntity entity) { List <MySqlParameter> paramsList = new List <MySqlParameter>(); paramsList.Add(new MySqlParameter("@OpenId", entity.OpenId)); paramsList.Add(new MySqlParameter("@Content", entity.Content)); paramsList.Add(new MySqlParameter("@UserContact", entity.UserContact)); paramsList.Add(new MySqlParameter("@ClientId", entity.ClientId)); paramsList.Add(new MySqlParameter("@ChannelNo", entity.ChannelNo)); paramsList.Add(new MySqlParameter("@Version", entity.Version)); paramsList.Add(new MySqlParameter("@CreateTime", entity.CreateTime)); paramsList.Add(new MySqlParameter("@Status", entity.Status)); paramsList.Add(new MySqlParameter("@UpdateTime", entity.UpdateTime)); return(paramsList); }
public bool Update(Guid Id, string UserName, string Message, string Sender, string SenderEmail, DateTime SendDate, bool Approved, string UserIp) { bool toReturn = false; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { FeedBackEntity _FeedBackEntity = new FeedBackEntity(Id); if (adapter.FetchEntity(_FeedBackEntity)) { _FeedBackEntity.UserName = UserName; _FeedBackEntity.Message = Message; _FeedBackEntity.Sender = Sender; _FeedBackEntity.SenderEmail = SenderEmail; _FeedBackEntity.SendDate = SendDate; _FeedBackEntity.Approved = Approved; _FeedBackEntity.UserIp = UserIp; adapter.SaveEntity(_FeedBackEntity, true); toReturn = true; } } return toReturn; }
public bool Update(FeedBackEntity _FeedBackEntity, RelationPredicateBucket filter) { bool toReturn = false; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { adapter.UpdateEntitiesDirectly(_FeedBackEntity, filter); toReturn = true; } return toReturn; }
public bool Update(FeedBackEntity _FeedBackEntity) { bool toReturn = false; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { RelationPredicateBucket filter = new RelationPredicateBucket(); IPredicateExpression _PredicateExpression = new PredicateExpression(); _PredicateExpression.Add(FeedBackFields.Id == _FeedBackEntity.Id); filter.PredicateExpression.Add(_PredicateExpression); adapter.UpdateEntitiesDirectly(_FeedBackEntity, filter); toReturn = true; } return toReturn; }
public FeedBackEntity SelectOne(Guid Id) { FeedBackEntity toReturn = null; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { FeedBackEntity _FeedBackEntity = new FeedBackEntity(Id); if (adapter.FetchEntity(_FeedBackEntity)) { toReturn = _FeedBackEntity; } } return toReturn; }
public FeedBackEntity Insert(string UserName, string Message, string Sender, string SenderEmail, DateTime SendDate, bool Approved, string UserIp) { FeedBackEntity _FeedBackEntity = new FeedBackEntity(); using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { _FeedBackEntity.UserName = UserName; _FeedBackEntity.Message = Message; _FeedBackEntity.Sender = Sender; _FeedBackEntity.SenderEmail = SenderEmail; _FeedBackEntity.SendDate = SendDate; _FeedBackEntity.Approved = Approved; _FeedBackEntity.UserIp = UserIp; adapter.SaveEntity(_FeedBackEntity, true); } return _FeedBackEntity; }
public FeedBackEntity Insert(FeedBackEntity _FeedBackEntity) { using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { adapter.SaveEntity(_FeedBackEntity, true); } return _FeedBackEntity; }
public void feedback(FeedBackEntity feedback) { BusinessConfig.MyFeedbackService.InsertOne(feedback); }
public void UpdateForm(FeedBackEntity userEntity) { service.Update(userEntity); }
public ActionResult SubmitForm(FeedBackEntity feedBackEntity, string keyValue) { feedBackApp.SubmitForm(feedBackEntity, keyValue); return(Success("操作成功。")); }
public void feedback(FeedBackEntity feedback) { feedback.CreatedTime = DateTime.Now; BusinessConfig.MyFeedbackService.InsertOne(feedback); }