Example #1
0
        public JsonResult AddContact(ContactDto dto)
        {
            OpContactInsert op = new OpContactInsert();

            op.Dto = dto;
            OperationResult result  = _manager.ExecuteOperation(op);
            var             contact = result.Items;

            return(Json(contact, JsonRequestBehavior.AllowGet));
        }
        protected void btnSub_Click(object sender, EventArgs e)
        {
            string text = commText.Text;
            string user = Session["username"].ToString();

            OpContactInsert oui = new OpContactInsert();

            oui.Contact = new ContactDb {
                Text = text, User = user
            };
            OperationResult obj = OperationManager.Singleton.executeOperation(oui);

            if ((obj == null) || (!obj.Status))
            {
                return;
            }
            else
            {
                Response.Redirect(Request.RawUrl);
            }
        }
Example #3
0
        public ActionResult Contact(ContactViewModel vm)
        {
            ContactDto kontakt = new ContactDto()
            {
                email  = vm.email,
                naslov = vm.naslov,
                poruka = vm.poruka
            };

            try
            {
                OpContactInsert op = new OpContactInsert();
                op.dto = kontakt;
                ResultOperation res = manager.ExecuteOperation(op);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }