public long Update(FeedbackInfor buider) { var bd = db.FeedbackInfors.Find(buider.FeedbackID); bd.InformationID = buider.InformationID; bd.UsersRead = buider.UsersRead; //bd.CreateBy = buider.CreateBy; //bd.CreateDate = buider.CreateDate; bd.Description = buider.Description; bd.ModifiedBy = buider.ModifiedBy; bd.ModifiedDate = buider.ModifiedDate; db.SaveChanges(); return(buider.FeedbackID); }
public JsonResult CreateFeedBack(long inforID, string content, long?chilID = null) { UserLogin us = (UserLogin)Session[CommonConstant.USER_SESSION]; FeedbackInfor objFeedback = new FeedbackInfor(); var dao = new FeedbackInforDao(); objFeedback.InformationID = inforID; objFeedback.Description = content; objFeedback.ChildID = chilID; objFeedback.CreateDate = Hepper.GetDateServer(); objFeedback.ModifiedDate = Hepper.GetDateServer(); objFeedback.CreateBy = us.UserName; objFeedback.ModifiedBy = us.UserName; var data = dao.Insert(objFeedback); JsonResult result = new JsonResult(); result.Data = data; result.JsonRequestBehavior = JsonRequestBehavior.AllowGet; return(result); }
public ActionResult Index(FormCollection data) { try { UserLogin us = (UserLogin)Session[CommonConstant.USER_SESSION]; var dao = new FeedbackInforDao(); long projectID = Convert.ToInt64(data["txtID"].ToString()); FeedbackInfor objFeedback = new FeedbackInfor(); objFeedback.InformationID = projectID; objFeedback.Description = data["txtDescription"].ToString(); objFeedback.CreateDate = Hepper.GetDateServer(); objFeedback.ModifiedDate = Hepper.GetDateServer(); objFeedback.CreateBy = us.UserName; objFeedback.ModifiedBy = us.UserName; if (dao.Insert(objFeedback) > 0) { SetAlert("Thêm thành công", "success"); ViewBag.Feedback = dao.ToListFeebBackUser(projectID).ToArray <FeedbacInfokUser>(); List <FeedbacInfokUser> fdnul = new List <FeedbacInfokUser>(); foreach (FeedbacInfokUser fb in ViewBag.Feedback) { if (fb.ChildID == null) { fdnul.Add(fb); } } ViewBag.FeedbackNull = fdnul.ToArray <FeedbacInfokUser>(); return(RedirectToAction("Index")); } } catch { SetAlert("Không thêm được", "danger"); return(View()); } return(View()); }
public long Insert(FeedbackInfor buider) { db.FeedbackInfors.Add(buider); db.SaveChanges(); return(buider.FeedbackID); }