コード例 #1
0
        public ActionResult NewCity(CityViewModel model)
        {
            if (ModelState.IsValid)
            {
                //创建数据
                City data = new City();
                data.Name         = model.Name;
                data.CountryName  = model.CountryName;
                data.ProvinceName = model.ProvinceName;
                data.Remark       = model.Remark ?? string.Empty;

                //保存数据
                string   strErrText;
                DDSystem city = new DDSystem();
                if (city.InsertCity(data, LoginAccountId, LoginStaffName, out strErrText))
                {
                    return(Json(string.Empty));
                }
                else
                {
                    return(Json(strErrText));
                }
            }
            return(View(model));
        }