public JsonResult CreateController(string jsonTable = "", string module = "") { try { if (!String.IsNullOrEmpty(jsonTable)) { List <GenerateTableModel> generateTables = JsonConvert.DeserializeObject <List <GenerateTableModel> >(jsonTable); if (generateTables != null && generateTables.Count() > 0) { foreach (GenerateTableModel table in generateTables) { ETDataConnection gConn = new ETDataConnection(GetConnectionString(SDatabase)); TableInfo tableInfo = new TableInfo(table.TableName, gConn); ClassInfo classInfo = new ClassInfo(tableInfo, module); string fileTemplatePath = Server.MapPath("/DataTemp"); string fileResultPath = Server.MapPath("/DataGen"); classInfo.GenerateController(fileTemplatePath); classInfo.SaveController(fileResultPath); } } } return(Json(1, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(0, JsonRequestBehavior.AllowGet)); } }