public ActionResult EmailParent(int?pID)
        {
            VMEmailParent pvModel = new VMEmailParent();

            if (pID > 0)
            {
                pvModel.PID = (int)pID;
                EmailFormParent emailParent = db.EmailFormParents.Where(aa => aa.PEmailFormParentID == pID).First();
                pvModel.IsPreviousDate = (bool)emailParent.IsPreviousDate;
                pvModel.ToEmail        = emailParent.ToEmail;
                pvModel.CCEmail        = emailParent.CcEmail;
            }
            return(View(pvModel));
        }
        public ActionResult EmailParent(VMEmailParent email)
        {
            User            LoggedInUser = Session["LoggedUser"] as User;
            EmailFormParent ep           = new EmailFormParent();

            ep.ToEmail        = email.ToEmail;
            ep.CcEmail        = email.CCEmail;
            ep.CreatedBy      = LoggedInUser.UserID;
            ep.CreatedDate    = DateTime.Now;
            ep.IsPreviousDate = email.IsPreviousDate;
            ep.Status         = true;
            db.EmailFormParents.Add(ep);
            db.SaveChanges();
            return(Json(ep.PEmailFormParentID.ToString(), JsonRequestBehavior.AllowGet));
        }