示例#1
0
        /// <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);
            }
        }
示例#2
0
        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));
        }
示例#3
0
 public void SubmitForm(FeedBackEntity userEntity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         userEntity.Modify(keyValue);
     }
     else
     {
         userEntity.CreateSimple();
     }
     service.SubmitForm(userEntity, keyValue);
 }
示例#4
0
    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;
    }
示例#5
0
 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;
 }
示例#6
0
        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);
        }
示例#7
0
        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;
        }
示例#8
0
 public bool Update(FeedBackEntity _FeedBackEntity, RelationPredicateBucket filter)
 {
     bool toReturn = false;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         adapter.UpdateEntitiesDirectly(_FeedBackEntity, filter);
         toReturn = true;
     }
     return toReturn;
 }
示例#9
0
        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;
        }
示例#10
0
 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;
 }
示例#11
0
        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;
        }
示例#12
0
 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);
 }
示例#14
0
 public void UpdateForm(FeedBackEntity userEntity)
 {
     service.Update(userEntity);
 }
示例#15
0
 public ActionResult SubmitForm(FeedBackEntity feedBackEntity, string keyValue)
 {
     feedBackApp.SubmitForm(feedBackEntity, keyValue);
     return(Success("操作成功。"));
 }
示例#16
0
 public void feedback(FeedBackEntity feedback)
 {
     feedback.CreatedTime = DateTime.Now;
     BusinessConfig.MyFeedbackService.InsertOne(feedback);
 }