void btnPost_Click(object sender, EventArgs e) { if (this.Page.IsValid) { FeedbackInfo model = new FeedbackInfo(); model.Content = this.txtContent.Text; model.Email = this.txtEmail.Text; model.Phone = this.txtPhone.Text; model.RealName = this.txtRealName.Text; model.IP = Goodspeed.Common.BrowserInfo.Current.IP; int i = FeedbackMange.Add(model); if (i > 0) { this.ltMsg.Text = "留言成功!"; } else { this.ltMsg.Text = "留言失败"; } this.txtRealName.Text = string.Empty; this.txtPhone.Text = string.Empty; this.txtEmail.Text = string.Empty; this.txtContent.Text = string.Empty; } }
protected void Button1_Click(object sender, EventArgs e) { FeedbackInfo feedback = new FeedbackInfo(); IBLL.IFeedback feed = BLLFactory.DataAccess.CreateFeedback(); String title = name.Text; String content = text.Text; if ((title.Length >= 1 && title.Length <= 50) || (content.Length >= 1 && content.Length <= 150)) { try { feedback.Stu_ID = stdID; feedback.Fee_Level = 'D'; feedback.Fee_Time = System.DateTime.Now; feedback.Fee_Topic = title; feedback.Fee_Detail = content; feed.Add(feedback); //写入反馈信息 } catch { throw new Exception(); } finally { name.Text = ""; text.Text = ""; } } }
public static int Add(FeedbackInfo model) { string strSQL = "INSERT INTO dbo.Feedbacks(SiteId,UserId,UserName,RealName,Company,Phone,Email,Requirement,Intention,CreateDateTime,IP) VALUES(@SiteId,@UserId,@UserName,@RealName,@Company,@Phone,@Email,@Requirement,@Intention,GETDATE(),@IP);SELECT @@IDENTITY;"; SqlParameter[] parms = ParameterHelper.GetClassSqlParameters(model); return(Convert.ToInt32(Goodspeed.Library.Data.SQLPlus.ExecuteScalar(CommandType.Text, strSQL, parms))); }
private static FeedbackInfo Get(DataRow dr) { FeedbackInfo model = new FeedbackInfo(); ReflectionHelper.Fill(dr, model); return(model); }
public void Feedback(FeedbackInfo info) { if (this.observer != null) { FeedbackHelper.Feedback(this.observer, info); } }
/// <summary> /// Crea ed esegue un singolo task /// </summary> /// <param name="url"></param> /// <param name="job2Execute"></param> /// <returns></returns> private Task <FeedbackInfo> CreateTask(string url, JobInfo job2Execute) { return(Task.Run(async() => { FeedbackInfo feedback = new FeedbackInfo() { Name = job2Execute.Name }; HttpClient httpClient = CreateHttpClient(url); //lista parametri condivisa tra le call (serve per recuperare i parametri da una chiamata e passarli alla successiva) Dictionary <string, string> parameters = new Dictionary <string, string>(); foreach (var call in job2Execute.Calls) { ExecutionInfo result = await ExecuteCall(httpClient, call, parameters); feedback.Executions.Add(result); } return feedback; }).ContinueWith(res => { return new FeedbackInfo() { Name = job2Execute.Name }; }, TaskContinuationOptions.OnlyOnFaulted)); }
protected void btnSend_Click(object sender, EventArgs e) { try { string id = Request.QueryString["idS"].ToString(); var dt = new DataTable(); dt = ShowTimesService.ShowTimes_GetById(id); var dtC = new DataTable(); dtC = CustomerService.Customer_GetByTop("", "Username='******'", ""); var obj = new FeedbackInfo(); obj.FilId = dt.Rows[0]["FilId"].ToString(); obj.FullName = dtC.Rows[0]["FullName"].ToString(); obj.Avata = dtC.Rows[0]["Avata"].ToString(); obj.Comment = txtConten.Text; FeedbackService.Feedback_Insert(obj); LoaFeedback(); txtConten.Text = ""; } catch (Exception ex) { WebMsgBox.Show(ex.Message); } }
private void Feedback(FeedbackInfo info) { if (this.OnFeedback != null) { this.OnFeedback(info); } }
public bool SaveFeedback(FeedbackInfo feedback) { if (string.IsNullOrWhiteSpace(Provider.CurrentMember.Id)) { var f = new Feedback(); feedback.CopyPropertiesWithSameName(f); f.Save(); Job j = new Job() { Command = JobCommands.NewFeedback, Executer = JobExecuters.Staff, ExecuterId = Provider.Api.GetNextIdleStaffMemberId(f.Department), Name = "New feedback from visitor", RelatedEntityName = "Feedback", RelatedEntityId = f.Id, State = JobStates.NotStarted }; j.Save(); } else { return(SaveCrmActivity(new CrmActivityInfo() { ActivityType = ActivityTypes.Form, Department = feedback.Department, MemberId = Provider.CurrentMember.Id, Message = feedback.Message, Subject = feedback.Subject })); } return(true); }
/// <summary> /// Crea ed esegue un singolo task /// </summary> /// <param name="urlServer"></param> /// <param name="job2Execute"></param> /// <returns></returns> private Task <FeedbackInfo> CreateTask(int taskID, string urlServer, JobInfo job2Execute) { return(Task.Run(() => { FeedbackInfo feedback = new FeedbackInfo() { TaskID = taskID, Name = job2Execute.Name }; WebClient webClient = CreateHttpClient(urlServer); //lista parametri condivisa tra le call (serve per recuperare i parametri da una chiamata e passarli alla successiva) Dictionary <string, string> parameters = new Dictionary <string, string> { { "##server##", "/api" }, { "##sessionID##", taskID.ToString() } }; foreach (string call in job2Execute.Calls) { ExecutionInfo result = ExecuteCall(webClient, call, parameters); feedback.Executions.Add(result); } return feedback; })); }
protected void lnk_Delete_Click(object sender, System.EventArgs e) { if (!base.IsAuthorizedOp(ActionType.Delete.ToString())) { base.ShowAjaxMsg(this.UpdatePanel1, "Không có thẩm quyền"); } else { int @int = WebUtils.GetInt((sender as LinkButton).CommandArgument); FeedbackInfo dataById = SinGooCMS.BLL.Feedback.GetDataById(@int); if (dataById == null) { base.ShowAjaxMsg(this.UpdatePanel1, "Những thông tin này không được tìm thấy, các dữ liệu không tồn tại hoặc đã bị xóa"); } else if (SinGooCMS.BLL.Feedback.Delete(@int)) { this.BindData(); PageBase.log.AddEvent(base.LoginAccount.AccountName, "删除留言[" + dataById.Title + "] thành công"); base.ShowAjaxMsg(this.UpdatePanel1, "Thao tác thành công"); } else { base.ShowAjaxMsg(this.UpdatePanel1, "Thao tác thất bại"); } } }
public static int Add(FeedbackInfo model) { int i = 0; string strSQL = "INSERT INTO Feedbacks(RealName,Email,Phone,Content,Ip,CreateDateTime) VALUES(@RealName,@Email,@Phone,@Content,@Ip,GETDATE());SELECT @@IDENTITY;"; SqlParameter[] parms = { new SqlParameter("RealName", SqlDbType.VarChar), new SqlParameter("Email", SqlDbType.VarChar), new SqlParameter("Phone", SqlDbType.VarChar), new SqlParameter("Content", SqlDbType.VarChar), new SqlParameter("Ip", SqlDbType.VarChar) }; parms[0].Value = Goodspeed.Common.CharHelper.Truncate(model.RealName, 50); parms[1].Value = Goodspeed.Common.CharHelper.Truncate(model.Email, 50); parms[2].Value = Goodspeed.Common.CharHelper.Truncate(model.Phone, 50); parms[3].Value = Goodspeed.Library.Char.HtmlHelper.RemoveHtml(model.Content); parms[4].Value = model.IP; if (Goodspeed.Library.Net.MailClient.ValidateMailAddress(model.Email)) { i = Convert.ToInt32(Goodspeed.Library.Data.SQLPlus.ExecuteScalar(CommandType.Text, strSQL, parms)); } return(i); }
public override string ParseDefinition(string definition) { definition = base.ParseDefinition(definition); #region Handle join cluase for mysql which has no "on", so it needs to make up that. try { StringBuilder sb = new StringBuilder(); if (this.sourceDbInterpreter.GetType() == typeof(MySqlInterpreter)) { bool hasError = false; string formattedDefinition = this.FormatSql(definition, out hasError); if (!hasError) { string[] lines = formattedDefinition.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries); Regex joinRegex = new Regex(@"\b(join)\b", RegexOptions.IgnoreCase); Regex onRegex = new Regex(@"\b(on)\b", RegexOptions.IgnoreCase); Regex wordRegex = new Regex("([a-zA-Z(]+)", RegexOptions.IgnoreCase); sb = new StringBuilder(); foreach (string line in lines) { bool hasChanged = false; if (joinRegex.IsMatch(line)) { string leftStr = line.Substring(line.ToLower().LastIndexOf("join") + 4); if (!onRegex.IsMatch(line) && !wordRegex.IsMatch(leftStr)) { hasChanged = true; sb.AppendLine($"{line} ON 1=1 "); } } if (!hasChanged) { sb.AppendLine(line); } } definition = sb.ToString(); } } } catch (Exception ex) { FeedbackInfo info = new FeedbackInfo() { InfoType = FeedbackInfoType.Error, Message = ExceptionHelper.GetExceptionDetails(ex), Owner = this }; FeedbackHelper.Feedback(info); } #endregion return(definition.Trim()); }
public async Task <FeedbackInfo> AddAsync(FeedbackInfo feedbackInfo) { var entry = await _context.AddAsync(feedbackInfo); await _context.SaveChangesAsync(); return(entry.Entity); }
private static void Feedback(FeedbackInfo info) { if (info.InfoType == FeedbackInfoType.Error) { Console.ForegroundColor = ConsoleColor.Red; } Console.WriteLine(info.Message); }
void IBLL.IFeedback.Modify(FeedbackInfo student) { if (student == null) { throw new Exception(); } dal.Modify(student); }
void IBLL.IFeedback.Remove(FeedbackInfo student) { if (student == null) { throw new Exception(); } dal.Remove(student); }
private void writeButton_Click(object sender, RoutedEventArgs e) { FeedbackInfo info = new FeedbackInfo { From = nameTextBox.Text, Comment = commentTextBox.Text }; commentTextBox.Text = client.WriteFeedback(info); }
public string GetCategoriesChosen() { string returnVal = string.Empty; returnVal = FeedbackInfo.CategoriesGivenAsString(); return(returnVal); }
/// <summary> /// 投诉建议 /// </summary> /// <param name="model"></param> /// <returns></returns> public ActionResult Advise(FeedbackInfo model) { //POST if (String.Equals(Request.HttpMethod, "POST", StringComparison.OrdinalIgnoreCase)) { _Submit(model, "投诉建议"); } return(View()); }
public void Feedback(FeedbackInfoType infoType, string message) { FeedbackInfo info = new FeedbackInfo() { Owner = this, InfoType = infoType, Message = StringHelper.ToSingleEmptyLine(message) }; if (this.observer != null) { FeedbackHelper.Feedback(this.observer, info); } }
public void Feedback(FeedbackInfoType infoType, string message) { FeedbackInfo info = new FeedbackInfo() { Owner = this, InfoType = infoType, Message = StringHelper.ToSingleEmptyLine(message) }; this.Feedback(info); }
/// <summary> /// 添加或编辑 /// </summary> /// <param name="model"></param> /// <returns></returns> public static FeedbackInfo Create(FeedbackInfo model) { if (model.Id == 0) { int id = FeedbackManage.Insert(model); model.Id = id; } return(model); }
public void AddFeeback(int mode, float posy, string type) { var fi = new FeedbackInfo(); fi.startingPosition = posy; fi.mode = mode; fi.type = type; fil.Add(fi); }
public string GetGivenDays() { string returnVal = string.Empty; int daysPaid = FeedbackInfo.DaysPaid(PotTotal); returnVal = daysPaid.ToString(); return(returnVal); }
protected void btnok_Click(object sender, System.EventArgs e) { if (!base.IsAuthorizedOp("Reply")) { base.ShowMsg("Không có thẩm quyền"); } else { string text = base.Server.HtmlEncode(this.txtReply.Text); if (string.IsNullOrEmpty(text)) { base.ShowMsg("请输入回复内容"); } else { FeedbackInfo dataById = SinGooCMS.BLL.Feedback.GetDataById(base.OpID); dataById.Replier = base.LoginAccount.AccountName; dataById.ReplyContent = text; dataById.ReplyDate = System.DateTime.Now; if (SinGooCMS.BLL.Feedback.Update(dataById)) { string @string = WebUtils.GetString(this.txtMail.Text); string strMailBody = string.Concat(new string[] { "来自管理员的回复:<br/><div style='border-bottom:1px solid #ccc'>", text, "</div><br/>", PageBase.config.SiteName, "(", PageBase.config.SiteDomain, ")" }); string empty = string.Empty; if (this.chkReply2Mail.Checked && ValidateUtils.IsEmail(@string)) { MsgService.SendMail(@string, "来自管理员的回复", strMailBody, out empty); } if (!string.IsNullOrEmpty(empty) && "success" != empty) { base.ShowMsg(empty); PageBase.log.AddEvent(base.LoginAccount.AccountName, "回复留言[" + this.feedback.Title + "] thành công,但发送邮件失败"); } else { PageBase.log.AddEvent(base.LoginAccount.AccountName, "回复留言[" + dataById.Title + "] thành công"); MessageUtils.DialogCloseAndParentReload(this); } } else { base.ShowMsg("回复留言失败"); } } } }
public IHttpActionResult Get(string id) { FeedbackInfo feedback = store.Find(entry => entry.From == id); if (feedback == null) { return(NotFound()); } return(Ok(feedback)); }
private void readButton_Click(object sender, RoutedEventArgs e) { try { FeedbackInfo info = client.ReadFeedback(nameTextBox.Text); commentTextBox.Text = info.Comment; } catch (Exception ex) { commentTextBox.Text = ex.Message; } }
void IDAL.IFeedback.Add(FeedbackInfo feedback) { try { DataContext ctx = new DataContext(connection); ITable feedbacks = ctx.GetTable <FeedbackInfo>(); feedbacks.InsertOnSubmit(feedback); ctx.SubmitChanges(); } finally { } }
public static int Add(FeedbackInfo entity) { int result; if (entity == null) { result = 0; } else { result = BizBase.dbo.InsertModel <FeedbackInfo>(entity); } return(result); }