Пример #1
0
        public virtual ActionResult Modify(CustomerChannelModel model)
        {
            if (model == null)
            {
                return(null);
            }
            var entity = model.CreateEntity(SaveType.Modify);
            var result = new Dictionary <string, object>();
            var rev    = this.SaveEntity(entity);
            var mess   = rev ? "" : entity.Errors?.FirstOrDefault()?.Message;

            result.Add("Status", rev);
            result.Add("Message", mess);
            return(this.Jsonp(result));
        }
Пример #2
0
        public virtual ActionResult Add(CustomerChannelModel model)
        {
            if (model == null)
            {
                return(null);
            }
            var entity = model.CreateEntity(SaveType.Add);

            entity.Sequence = GetSequence();
            var result = new Dictionary <string, object>();

            entity.Crm = new CrmEntity {
                Id = CrmId
            };
            var rev  = this.SaveEntity(entity);
            var mess = rev ? "" : entity.Errors?.FirstOrDefault()?.Message;

            result.Add("Status", rev);
            result.Add("Id", entity.Id);
            result.Add("Message", mess);
            result.Add("Sequence", entity.Sequence);
            return(this.Jsonp(result));
        }