public static string InsertReply(string rply, int aId, int uId) { Replys reply = new Replys(); reply.Reply = rply; reply.AnswerID = aId; reply.UserId = uId; return(ReplyManager.IsReplyInserted(reply)); }
public JsonResult GetReplyaToEdit(string replyId) { string res = ""; if (!string.IsNullOrEmpty(replyId)) { ReplyBL rBl = new ReplyBL(); int replyID = Convert.ToInt32(replyId); Replys replys = rBl.GetReplyaToEdit(replyID); return(Json(replys, JsonRequestBehavior.AllowGet)); } return(Json("", JsonRequestBehavior.AllowGet)); }
public static int UpdateReply(Replys reply) { string connectionString = WebConfigurationManager.ConnectionStrings["DealQuestionAnswerDBCS"].ConnectionString; using (SqlConnection con = new SqlConnection(connectionString)) { string query = "update Replys set Reply=@rply where Id=@id"; SqlCommand cmd = new SqlCommand(query, con); cmd.Parameters.AddWithValue("@rply", reply.Reply); cmd.Parameters.AddWithValue("@id", reply.Id); con.Open(); return(cmd.ExecuteNonQuery()); } }
private static bool ProcessWindow(IntPtr Handler, int Parameters) { int Len = GetWindowTextLength(Handler); StringBuilder sb = new StringBuilder(Len + 1); GetWindowText(Handler, sb, sb.Capacity); string Ori = sb.ToString(); if (Replys.Contains(SimplfyMatch(Ori))) { return(true); } uint HandlePID; GetWindowThreadProcessId(Handler, out HandlePID); if (HandlePID == GamePID) { var CB = new CallBack(ProcessWindow); EnumChildWindows(Handler, CB, IntPtr.Zero); } else { return(true); } string Reload = StrMap(Ori, IntPtr.Zero, true); CacheReply(Reload); if (Ori == Reload) { return(true); } HandleRef href = new HandleRef(null, Handler); SendMessage(href, WM_SETTEXT, IntPtr.Zero, Reload); if (InvalidateWindow) { ForcePaint(Handler); } return(true); }
public static int SaveReply(Replys reply) { string connectionString = WebConfigurationManager.ConnectionStrings["DealQuestionAnswerDBCS"].ConnectionString; using (SqlConnection con = new SqlConnection(connectionString)) { string query = "insert Replys(Reply,AnswerId,UserId) values(@rply,@aId,@uId)"; using (SqlCommand cmd = new SqlCommand(query, con)) { cmd.Parameters.AddWithValue("@rply", reply.Reply); cmd.Parameters.AddWithValue("@aId", reply.AnswerID); cmd.Parameters.AddWithValue("@uId", reply.UserId); con.Open(); return(cmd.ExecuteNonQuery()); } } }
//添加回复 public void AddReply(int comid, int rep_userid, int rep_to_userid, string date, string rep_content, int rep_typ) { Replys r = new Replys() { Com_Id = comid, Rep_Content = rep_content, Rep_UserId = rep_userid, Rep_To_UserId = rep_to_userid, Rep_Date = date, Rep_Type = rep_typ, Rep_Praise_Num = 0 }; try { lpe.Replys.Add(r); lpe.SaveChanges(); } catch (Exception ex) { throw ex; } }
public async Task <ActionResult> AddReply([FromBody] JObject replys) { var getQuestions = await _dbContext.Questions.Where(x => x.UserId == (int)replys["userId"] && !x.Deleted).ToListAsync(); Respondents respon = new Respondents(); respon.RespondentName = (string)replys["replyName"]; respon.ReplyDate = Convert.ToString(DateTime.Now); respon.UserId = (int)replys["userId"]; _dbContext.Respondents.Add(respon); await _dbContext.SaveChangesAsync(); foreach (var reply in replys) { foreach (var question in getQuestions) { if (question.Question == reply.Key) { Replys userReply = new Replys(); userReply.RespondentName = (string)replys["replyName"]; userReply.RespondentId = respon.Id; userReply.QuestionId = (int)question.Id; userReply.Question = question.Question; userReply.Subject = question.Subject; userReply.Reply = reply.Value.ToString(); _dbContext.Replys.Add(userReply); await _dbContext.SaveChangesAsync(); } } } return(Ok()); }
public void EditReply(Replys Reply) { ReplyRepository.Edit(Reply); }
public void CreateReply(Replys Reply) { ReplyRepository.Add(Reply); }
public Replys GetReplyaToEdit(int replyId) { Replys res = rdl.GetReplyaToEdit(replyId); return(res); }