Пример #1
0
        public async Task <ActionResult> Create([Bind(Include = "Id,Description")] EmailType emailtype)
        {
            if (ModelState.IsValid)
            {
                db.EmailTypes.Add(emailtype);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(emailtype));
        }
Пример #2
0
        public async Task <ActionResult> Create([Bind(Include = "Id,EmailTypeId,Name,Content,Active")] EmailTemplate emailtemplate)
        {
            if (ModelState.IsValid)
            {
                emailtemplate.Content = Server.UrlDecode(emailtemplate.Content);
                db.EmailTemplates.Add(emailtemplate);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.EmailTypeId = new SelectList(db.EmailTypes, "Id", "Description", emailtemplate.EmailTypeId);
            return(View(emailtemplate));
        }
Пример #3
0
        public async Task <ActionResult> Create([Bind(Include = "Id,NickName,Address1,Address2,City,State,Zip,SSN,Email,SMTPEmail,ReceiveCallNotes,UserId,Active,PhoneNumber1,PhoneNumber2")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                employee.PhoneNumber1 = PhoneNumber10.Reformat(employee.PhoneNumber1);
                employee.PhoneNumber2 = PhoneNumber10.Reformat(employee.PhoneNumber2);
                db.Employees.Add(employee);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.UserId = new SelectList(db.AspNetUsers, "Id", "UserName", employee.UserId);
            return(View(employee));
        }