Наследование: Machete.Domain.Record
Пример #1
0
 public JsonResult Edit(EmailView emailview, FormCollection collection, string userName)
 {
     //UpdateModel(emailview);
     var email = serv.Get(emailview.ID);
     var newemail = Mapper.Map<EmailView, Email>(emailview, email);
     if (emailview.attachment != null)
     {
         newemail.attachment = Server.HtmlDecode(emailview.attachment);
         newemail.attachmentContentType = System.Net.Mime.MediaTypeNames.Text.Html;
     }
     serv.Save(newemail, userName);
     return Json(new
     {
         jobSuccess = true
     }, JsonRequestBehavior.AllowGet);
 }
Пример #2
0
        public JsonResult Create(EmailView emailview, string userName)
        {
            Email newEmail;
            UpdateModel(emailview);
            var email = Mapper.Map<EmailView, Email>(emailview);
            if (emailview.attachment != null)
            {
                email.attachment = Server.HtmlDecode(emailview.attachment);
                email.attachmentContentType = System.Net.Mime.MediaTypeNames.Text.Html;
            }
            if (emailview.woid.HasValue)
            {
                newEmail = serv.Create(email, userName, emailview.woid);
            }
            else
            {
                newEmail = serv.Create(email, userName);
            }

            return Json(new
            {
                sNewRef = _getTabRef(newEmail),
                sNewLabel = _getTabLabel(newEmail),
                iNewID = newEmail.ID,
                jobSuccess = true
            },
            JsonRequestBehavior.AllowGet);
        }