Ejemplo n.º 1
0
        public RedirectResult pvQuickCall(string Name, String Contact)
        {
            STPQuickCall Qcall = new STPQuickCall()
            {
                Name    = Name,
                Contact = Contact
            };

            db.STPQuickCalls.Add(Qcall);
            db.SaveChanges();

            return(Redirect(Url.Action("Index", "Home")));
        }
Ejemplo n.º 2
0
        public ActionResult pvQuickCall(QuickCall q)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    STPQuickCall Qcall = new STPQuickCall()
                    {
                        Name    = q.Name,
                        Contact = q.Contact
                    };

                    STPNotification n = new STPNotification
                    {
                        Message     = q.Name + " Request a Call!",
                        Is_Notify   = false,
                        CreatedDate = DateTime.Now
                    };

                    db.STPNotifications.Add(n);
                    db.STPQuickCalls.Add(Qcall);
                    db.SaveChanges();
                    Session["Message"] = "QCallSucceed";
                    return(RedirectToAction("Index"));
                }
                catch
                {
                    Session["Message"] = "QCallFailed";
                }
            }
            else
            {
                Session["Message"] = "QCallFailed";
            }
            return(View());
        }