示例#1
0
 private UserPost ConvertToDM(UserPostBM model)
 {
     return(new UserPost
     {
         Id = model.Id,
         UserId = model.UserId,
         Subject = model.Subject,
         Post = model.Post,
         CreatedBy = model.CreatedBy,
         CreationDate = model.CreationDate,
         ModifiedBy = model.ModifiedBy,
         ModificationDate = model.ModificationDate
     });
 }
示例#2
0
        public ActionResult PostComment(PostCommentModel Model)
        {
            UserBM CurrentUser = (UserBM)Session["User"];

            if (CurrentUser != null)
            {
                UserPostBM UserPostBM = new UserPostBM();
                UserPostBM.Post         = Model.UserPost.Post;
                UserPostBM.Subject      = Model.UserPost.Subject;
                UserPostBM.UserId       = CurrentUser.Id;
                UserPostBM.CreatedBy    = CurrentUser.Id;
                UserPostBM.CreationDate = DateTime.Now;
                UserPostBL.Create(UserPostBM);
                TempData["Success"] = "Record saved Successfully.";
            }
            else
            {
                TempData["Error"] = "Please Login.";
            }
            return(RedirectToAction("UserPost"));
        }
示例#3
0
 public void Update(UserPostBM model)
 {
     uow.UserPostRepository.Update(ConvertToDM(model));
     uow.Save();
 }
示例#4
0
 public void Create(UserPostBM model)
 {
     uow.UserPostRepository.Add(ConvertToDM(model));
     uow.Save();
 }