Esempio n. 1
0
        public JsonResult SaveContacter(SampleRequestParam param)
        {
            Common.Data.JsonData json      = new Common.Data.JsonData();
            ContactData          contacter = new ContactData()
            {
                ContactName   = param.Name,
                ContactTypeId = string.IsNullOrEmpty(param.Code)?-1: int.Parse(param.Code),
                Value         = param.Value,
                Desc          = param.Desc
            };
            IContactDataService contactService = IocMvcFactoryHelper.GetInterface <IContactDataService>();

            json = contactService.Add(contacter);
            return(Json(json));
        }
Esempio n. 2
0
        public JsonResult SaveEnum(SampleRequestParam param)
        {
            Common.Data.JsonData json = new Common.Data.JsonData()
            {
                Result = true
            };
            int ev = 0;

            if (!int.TryParse(param.Value, out ev))
            {
                json.Message = AppLanguage.Lang.Tip_EnumValueIsDigit;
                return(Json(json));
            }
            IEnumDataService enumBll = IocMvcFactoryHelper.GetInterface <IEnumDataService>();

            json = enumBll.Add(new EnumData()
            {
                Name   = param.Name,
                Code   = param.Code,
                Value  = ev,
                Remark = param.Desc
            });
            return(Json(json));
        }