public int ForwardReply(int ReplyId, string Des, int CurrentUserId, string NickName) { Maticsoft.Model.SNS.GroupTopicReply model = this.GetModel(ReplyId); Maticsoft.Model.SNS.GroupTopicReply tModel = new Maticsoft.Model.SNS.GroupTopicReply { OriginalID = ReplyId, Description = Des, OrginalDes = model.Description, CreatedDate = DateTime.Now, GroupID = model.GroupID, OrgianlNickName = model.ReplyNickName, ReplyUserID = CurrentUserId, TopicID = model.TopicID, PhotoUrl = (model.OriginalID > 0) ? "" : model.PhotoUrl, ProductLinkUrl = (model.OriginalID > 0) ? "" : model.ProductLinkUrl, ProductName = (model.OriginalID > 0) ? "" : model.ProductName, ProductUrl = (model.OriginalID > 0) ? "" : model.ProductUrl, Price = (model.OriginalID > 0) ? 0 : model.Price, TargetId = model.TargetId, Type = model.Type, ReplyNickName = NickName, Type = -1 }; return this.dal.ForwardReply(tModel); }
public ActionResult AJaxCreateReply(FormCollection fm) { string content = InjectionFilter.Filter(fm["Des"]); int replyId = Globals.SafeInt(fm["ReplyId"], 0); int userID = base.currentUser.UserID; string nickName = base.currentUser.NickName; Maticsoft.BLL.SNS.GroupTopicReply reply = new Maticsoft.BLL.SNS.GroupTopicReply(); content = ViewModelBase.ReplaceFace(content); int replyID = reply.ForwardReply(replyId, content, userID, nickName); List<Maticsoft.Model.SNS.GroupTopicReply> model = new List<Maticsoft.Model.SNS.GroupTopicReply>(); Maticsoft.Model.SNS.GroupTopicReply item = new Maticsoft.Model.SNS.GroupTopicReply(); item = reply.GetModel(replyID); model.Add(item); return this.PartialView(base.CurrentThemeViewPath + "/Group/TopicReplyResult.cshtml", model); }
public ActionResult AJaxCreateTopicReply(FormCollection fm) { string str = InjectionFilter.Filter((fm["Des"] != null) ? fm["Des"].ToString() : ""); long pid = Globals.SafeLong(fm["Pid"], (long) 0L); int num2 = Globals.SafeInt(fm["GroupId"], 0); int num3 = Globals.SafeInt(fm["TopicId"], 0); string imageUrl = ""; if (pid == 0L) { imageUrl = (fm["ImageUrl"] != null) ? fm["ImageUrl"].ToString() : ""; } if (!string.IsNullOrEmpty(str)) { Maticsoft.BLL.SNS.GroupTopicReply reply = new Maticsoft.BLL.SNS.GroupTopicReply(); Maticsoft.Model.SNS.GroupTopicReply tModel = new Maticsoft.Model.SNS.GroupTopicReply { Description = str }; string savePath = "/Upload/SNS/Images/Group/" + DateTime.Now.ToString("yyyyMMdd") + "/"; string saveThumbsPath = "/Upload/SNS/Images/GroupThumbs/" + DateTime.Now.ToString("yyyyMMdd") + "/"; tModel.PhotoUrl = Maticsoft.BLL.SNS.Photos.MoveImage(imageUrl, savePath, saveThumbsPath); tModel.GroupID = num2; tModel.CreatedDate = DateTime.Now; tModel.ReplyUserID = base.currentUser.UserID; tModel.ReplyNickName = base.currentUser.NickName; tModel.Status = 1; tModel.TopicID = num3; if ((tModel.ReplyID = reply.AddEx(tModel, pid)) > 0) { Maticsoft.BLL.SNS.GroupTopicReply reply3 = new Maticsoft.BLL.SNS.GroupTopicReply(); List<Maticsoft.Model.SNS.GroupTopicReply> model = new List<Maticsoft.Model.SNS.GroupTopicReply>(); tModel = reply3.GetModel(tModel.ReplyID); model.Add(tModel); return this.PartialView(base.CurrentThemeViewPath + "/Group/TopicReplyResult.cshtml", model); } } return base.Content("No"); }
public Maticsoft.Model.SNS.GroupTopicReply DataRowToModel(DataRow row) { Maticsoft.Model.SNS.GroupTopicReply reply = new Maticsoft.Model.SNS.GroupTopicReply(); if (row != null) { if ((row["ReplyID"] != null) && (row["ReplyID"].ToString() != "")) { reply.ReplyID = int.Parse(row["ReplyID"].ToString()); } if ((row["GroupID"] != null) && (row["GroupID"].ToString() != "")) { reply.GroupID = int.Parse(row["GroupID"].ToString()); } if ((row["ReplyType"] != null) && (row["ReplyType"].ToString() != "")) { reply.ReplyType = int.Parse(row["ReplyType"].ToString()); } if (row["ReplyNickName"] != null) { reply.ReplyNickName = row["ReplyNickName"].ToString(); } if ((row["ReplyUserID"] != null) && (row["ReplyUserID"].ToString() != "")) { reply.ReplyUserID = int.Parse(row["ReplyUserID"].ToString()); } if ((row["OriginalID"] != null) && (row["OriginalID"].ToString() != "")) { reply.OriginalID = int.Parse(row["OriginalID"].ToString()); } if (row["OrginalDes"] != null) { reply.OrginalDes = row["OrginalDes"].ToString(); } if ((row["OrginalUserID"] != null) && (row["OrginalUserID"].ToString() != "")) { reply.OrginalUserID = int.Parse(row["OrginalUserID"].ToString()); } if (row["OrgianlNickName"] != null) { reply.OrgianlNickName = row["OrgianlNickName"].ToString(); } if ((row["TopicID"] != null) && (row["TopicID"].ToString() != "")) { reply.TopicID = int.Parse(row["TopicID"].ToString()); } if (row["Description"] != null) { reply.Description = row["Description"].ToString(); } if ((row["HasReferUsers"] != null) && (row["HasReferUsers"].ToString() != "")) { if ((row["HasReferUsers"].ToString() == "1") || (row["HasReferUsers"].ToString().ToLower() == "true")) { reply.HasReferUsers = true; } else { reply.HasReferUsers = false; } } if (row["PhotoUrl"] != null) { reply.PhotoUrl = row["PhotoUrl"].ToString(); } if ((row["TargetId"] != null) && (row["TargetId"].ToString() != "")) { reply.TargetId = new int?(int.Parse(row["TargetId"].ToString())); } if ((row["Type"] != null) && (row["Type"].ToString() != "")) { reply.Type = new int?(int.Parse(row["Type"].ToString())); } if (row["ProductUrl"] != null) { reply.ProductUrl = row["ProductUrl"].ToString(); } if (row["ProductName"] != null) { reply.ProductName = row["ProductName"].ToString(); } if (row["ReplyExUrl"] != null) { reply.ReplyExUrl = row["ReplyExUrl"].ToString(); } if (row["ProductLinkUrl"] != null) { reply.ProductLinkUrl = row["ProductLinkUrl"].ToString(); } if ((row["FavCount"] != null) && (row["FavCount"].ToString() != "")) { reply.FavCount = int.Parse(row["FavCount"].ToString()); } if ((row["Price"] != null) && (row["Price"].ToString() != "")) { reply.Price = new decimal?(decimal.Parse(row["Price"].ToString())); } if (row["UserIP"] != null) { reply.UserIP = row["UserIP"].ToString(); } if ((row["Status"] != null) && (row["Status"].ToString() != "")) { reply.Status = int.Parse(row["Status"].ToString()); } if ((row["CreatedDate"] != null) && (row["CreatedDate"].ToString() != "")) { reply.CreatedDate = DateTime.Parse(row["CreatedDate"].ToString()); } } return reply; }