public Maticsoft.Model.SNS.GroupTopicFav DataRowToModel(DataRow row) { Maticsoft.Model.SNS.GroupTopicFav fav = new Maticsoft.Model.SNS.GroupTopicFav(); if (row != null) { if ((row["ID"] != null) && (row["ID"].ToString() != "")) { fav.ID = int.Parse(row["ID"].ToString()); } if ((row["CreatedUserID"] != null) && (row["CreatedUserID"].ToString() != "")) { fav.CreatedUserID = int.Parse(row["CreatedUserID"].ToString()); } if ((row["CreatedDate"] != null) && (row["CreatedDate"].ToString() != "")) { fav.CreatedDate = DateTime.Parse(row["CreatedDate"].ToString()); } if ((row["TopicID"] != null) && (row["TopicID"].ToString() != "")) { fav.TopicID = int.Parse(row["TopicID"].ToString()); } if (row["Tags"] != null) { fav.Tags = row["Tags"].ToString(); } if (row["Remark"] != null) { fav.Remark = row["Remark"].ToString(); } } return fav; }
public ActionResult AjaxAddTopicToFav(int TopicId) { Maticsoft.Model.SNS.GroupTopicFav model = new Maticsoft.Model.SNS.GroupTopicFav(); Maticsoft.BLL.SNS.GroupTopicFav fav2 = new Maticsoft.BLL.SNS.GroupTopicFav(); if (fav2.Exists(TopicId, base.currentUser.UserID)) { return base.Content("Repeate"); } model.CreatedDate = DateTime.Now; model.CreatedUserID = base.currentUser.UserID; model.TopicID = TopicId; if (fav2.AddEx(model)) { return base.Content("Yes"); } return base.Content("No"); }