예제 #1
0
        public ActionResult DeleteForm(int id)
        {
            SendForm s = new SendForm {
                Id = id
            };

            db.Entry(s).State = EntityState.Deleted;
            db.SaveChanges();
            return(RedirectToAction("Admins"));
        }
예제 #2
0
        public ActionResult Delete(int id)
        {
            SendForm del = db.Forms.Find(id);

            if (del == null)
            {
                return(HttpNotFound());
            }
            return(View(del));
        }
예제 #3
0
        //public void CreateForm(Office.IRibbonControl control)
        //{
        //    CreateTemplateForm create = new CreateTemplateForm();
        //    create.Show();
        //}
        //public void LoadForm(Office.IRibbonControl control)
        //{
        //    LoadTemplate loadTemplate = new LoadTemplate();
        //    loadTemplate.Show();
        //}

        //public void CheckMailForm(Office.IRibbonControl control)
        //{
        //    try
        //    {
        //        Check check = new Check();
        //        check.Show();
        //    }
        //    catch (Exception ex)
        //    {
        //        MessageBox.Show("Exception");
        //        _ = ex.Message;
        //    }


        //}
        public void DefultReplay(Office.IRibbonControl control)
        {
            try
            {
                SendForm sendForm = new SendForm();
                sendForm.Show();
            } catch (Exception e)
            {
                MessageBox.Show("Exception in Default Replay: \n" + e.Message);
            }
        }
예제 #4
0
        public ActionResult DeleteConfirmed(int id)
        {
            SendForm b = db.Forms.Find(id);

            if (b == null)
            {
                return(HttpNotFound());
            }
            db.Forms.Remove(b);
            db.SaveChanges();
            return(RedirectToAction("Admins"));
        }
예제 #5
0
        public ActionResult EditData(int?id)
        {
            if (id == null)
            {
                return(HttpNotFound());
            }
            // Находим в бд студента
            SendForm form = db.Forms.Find(id);

            if (form != null)
            {
                // Создаем список данных которые можем изменить
                return(View(form));
            }
            return(RedirectToAction("Admins"));
        }
        public async Task <IActionResult> Index(SendForm sendForm)
        {
            var model = new HomeIndex();

            if (string.IsNullOrEmpty(_sendgridApiKey) ||
                "your-sendgrid-api-key" == _sendgridApiKey)
            {
                model.MissingApiKey = true;
            }
            else if (ModelState.IsValid && HttpContext.Request.Method.ToUpper() == "POST")
            {
                model.Recipient        = sendForm.Recipient ?? "";
                model.sendGridResponse = await CallSendGrid(sendForm.Recipient);
            }
            return(View(model));
        }
        private ContentResult Send(SendForm form, int?ProjectId, int?TaskId, int?TeamId, int?EmployeeId)
        {
            if (ModelState.IsValid)
            {
                int MyId         = SessionUser.GetUser().Id;
                int?newMessageId = MessageService.Create(new C.Message(form.Title, form.Message, MyId, form.ReplyTo), EmployeeId, ProjectId, TaskId, TeamId);
                if (newMessageId != null)
                {
                    if (EmployeeId != null)
                    {
                        EmployeeHub.Send((int)EmployeeId);
                        MailboxHub.Send((int)EmployeeId);
                    }
                    else
                    {
                        if (form.ReplyTo != null)
                        {
                            int ParentAuthor = MessageService.Get((int)form.ReplyTo).Author;
                            MailboxHub.Send(ParentAuthor);
                        }

                        if (ProjectId != null)
                        {
                            ProjectHub.Send((int)ProjectId);
                        }
                        else if (TaskId != null)
                        {
                            TaskHub.Send((int)TaskId);
                        }
                        else if (TeamId != null)
                        {
                            TeamHub.Send((int)TeamId);
                        }
                    }
                    return(new ContentResult {
                        Content = "success"
                    });
                }
            }
            return(new ContentResult {
                Content = "fail"
            });
        }
예제 #8
0
 public ActionResult Index(SendForm form)
 {
     db.Entry(form).State = EntityState.Added;
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
예제 #9
0
 public ActionResult EditData(SendForm form)
 {
     db.Entry(form).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Admins"));
 }
 public ContentResult SendEmployee(SendForm form, int EmployeeId)
 {
     return(Send(form, null, null, null, EmployeeId));
 }
 public ContentResult SendTeam(SendForm form, int TeamId)
 {
     return(Send(form, null, null, TeamId, null));
 }
 public ContentResult SendTask(SendForm form, int TaskId)
 {
     return(Send(form, null, TaskId, null, null));
 }
 public ContentResult SendProject(SendForm form, int ProjectId)
 {
     return(Send(form, ProjectId, null, null, null));
 }
 /// <summary>
 /// Click the 'Send a Form' link from the 'Forms' submenu
 /// </summary>
 public void ClickSendForm()
 {
     SendForm.WaitRetry(_driver).Click();
 }
예제 #15
0
파일: Main.cs 프로젝트: EBERSHR/FormPlugin
        public void DefultReplay(Office.IRibbonControl control)
        {
            SendForm sendForm = new SendForm();

            sendForm.Show();
        }