Ejemplo n.º 1
0
        public ActionResult ContactDelete(long id, FormCollection collection)
        {
            var request = new DeleteContactRequest(SynergySecurity.GetCurrentUser());

            request.Id = id;
            var RecordId = SynergySecurity.ToLog <DeleteContactRequest>(request);
            DeleteContactResponse response = contactApi.DeleteContact(request);

            SynergySecurity.ToUpdateLog <DeleteContactResponse>(response, RecordId);
            return(RedirectToAction("Contacts"));
        }
Ejemplo n.º 2
0
        public ActionResult EditContact(UpdateContactRequest model)
        {
            model.UserId  = SynergySecurity.GetCurrentUser();
            model.Api     = ApiTypes.AgileCrm;
            model.Request = "Update Contact details";
            var RecordId = SynergySecurity.ToLog <UpdateContactRequest>(model);
            UpdateContactResponse response = contactApi.UpdateContactProperty(model);

            SynergySecurity.ToUpdateLog <UpdateContactResponse>(response, RecordId);
            return(RedirectToAction("Contacts"));
        }
Ejemplo n.º 3
0
        public ActionResult Contacts()
        {
            var request  = new GetContactsRequest(SynergySecurity.GetCurrentUser());
            var RecordId = SynergySecurity.ToLog <GetContactsRequest>(request);
            var contacts = contactApi.GetContacts(request);

            SynergySecurity.ToUpdateLog <GetContactsResponse>(contacts, RecordId);
            var model = ToUpdateContactRequestList(contacts);

            return(View("ContactList", model));
        }
Ejemplo n.º 4
0
        public ActionResult ContactDelete(long id)
        {
            UpdateContactRequest request = null;
            var getRequest = new GetContactRequest(SynergySecurity.GetCurrentUser());

            getRequest.Id = id;
            var RecordId = SynergySecurity.ToLog <GetContactRequest>(getRequest);
            var model    = contactApi.GetContact(getRequest);

            SynergySecurity.ToUpdateLog <GetContactResponse>(model, RecordId);
            if (model != null)
            {
                request = new UpdateContactRequest()
                {
                    Id       = model.Contact.id,
                    Property = ToConvertContactProperty(model.Contact)
                };
            }
            return(View(request ?? new UpdateContactRequest()));
        }