Esempio n. 1
0
        /// <summary>
        /// 新增修改
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public override ReturnData Add(object request)
        {
            RequesList <Emenu> menu        = (RequesList <Emenu>)request;
            Interactive        interactive = new Interactive();

            interactive.Insert(menu.Model);
            if (interactive.Result.Item1)
            {
                menu.Model.Id = interactive.Result.Item2;
                var values = new List <KeyValuePair <long, string> >();
                values.Add(new KeyValuePair <long, string>(menu.Model.Id, menu.Model.ToJson()));
                Client.AddZsetAsync(GetKey(), values);
                return(new ReturnData {
                    sucess = Client.Sucess, msg = interactive.Result.Item2.ToString()
                });
            }
            else
            {
                return(new ErrorData {
                    sucess = Client.Sucess, code = Client.Code
                });
            }
        }