public IActionResult LocatorBoardManagerNewSave(LocatorBoardModel model) { string sql = @"INSERT INTO eboards.LocatorBoard( _createdby, LocatorBoard_id, LocatorBoardname, LocatorBoarddescription, list_id, listlocationfield, locationbaseviewnamespace_id, locationbaseview_id, locationidfield, locationdisplayfield, topleftfield, toprightfield ) VALUES( @_createdby, @LocatorBoard_id, @LocatorBoardname, @LocatorBoarddescription, @list_id, @listlocationfield, @locationbaseviewnamespace_id, @locationbaseview_id, @locationidfield, @locationdisplayfield, @topleftfield, @toprightfield )"; string newID = System.Guid.NewGuid().ToString(); var paramList = new List <KeyValuePair <string, string> >() { new KeyValuePair <string, string>("_createdby", HttpContext.Session.GetString(SynapseSession.FullName)), new KeyValuePair <string, string>("LocatorBoard_id", newID), new KeyValuePair <string, string>("LocatorBoardname", model.LocatorBoardName), new KeyValuePair <string, string>("LocatorBoarddescription", model.LocatorBoardDescription), new KeyValuePair <string, string>("list_id", model.ListId), new KeyValuePair <string, string>("listlocationfield", model.ListLocationField), new KeyValuePair <string, string>("locationbaseviewnamespace_id", model.BaseViewNamespaceId), new KeyValuePair <string, string>("locationbaseview_id", model.BaseViewId), new KeyValuePair <string, string>("locationidfield", model.LocationIDField), new KeyValuePair <string, string>("locationdisplayfield", model.Heading), new KeyValuePair <string, string>("topleftfield", model.TopLeftField), new KeyValuePair <string, string>("toprightfield", model.TopRightField) }; DataServices.ExcecuteNonQueryFromSQL(sql, paramList); return(Json("OK")); }
public IActionResult LocatorBoardManagerViewSave(LocatorBoardModel model) { string sql = @"UPDATE eboards.LocatorBoard SET _createdby = @_createdby, LocatorBoardname = @LocatorBoardname, LocatorBoarddescription = @LocatorBoarddescription, list_id = @list_id, listlocationfield = @listlocationfield, locationbaseviewnamespace_id = @locationbaseviewnamespace_id, locationbaseview_id = @locationbaseview_id, locationidfield = @locationidfield, locationdisplayfield = @locationdisplayfield, topleftfield = @topleftfield, toprightfield = @toprightfield WHERE LocatorBoard_id = @LocatorBoard_id"; var paramList = new List <KeyValuePair <string, string> >() { new KeyValuePair <string, string>("_createdby", HttpContext.Session.GetString(SynapseSession.FullName)), new KeyValuePair <string, string>("LocatorBoard_id", model.LocatorBoardId), new KeyValuePair <string, string>("LocatorBoardname", model.LocatorBoardName), new KeyValuePair <string, string>("LocatorBoarddescription", model.LocatorBoardDescription), new KeyValuePair <string, string>("list_id", model.ListId), new KeyValuePair <string, string>("listlocationfield", model.ListLocationField), new KeyValuePair <string, string>("locationbaseviewnamespace_id", model.BaseViewNamespaceId), new KeyValuePair <string, string>("locationbaseview_id", model.BaseViewId), new KeyValuePair <string, string>("locationidfield", model.LocationIDField), new KeyValuePair <string, string>("locationdisplayfield", model.Heading), new KeyValuePair <string, string>("topleftfield", model.TopLeftField), new KeyValuePair <string, string>("toprightfield", model.TopRightField) }; DataServices.ExcecuteNonQueryFromSQL(sql, paramList); return(Json("OK")); }
public IActionResult LocatorBoardManagerView(string id) { DataSet dsBaseview = DataServices.DataSetFromSQL("SELECT * FROM listsettings.baseviewnamespace ORDER BY baseviewnamespace"); ViewBag.BaseviewNamespace = ToSelectList(dsBaseview.Tables[0], "baseviewnamespaceid", "baseviewnamespace"); DataSet dsList = DataServices.DataSetFromSQL("SELECT * FROM listsettings.listmanager ORDER BY listname"); ViewBag.List = ToSelectList(dsList.Tables[0], "list_id", "listname"); string sql = "SELECT * FROM eboards.locatorboard WHERE locatorboard_id = @locatorboard_id;"; DataSet ds = new DataSet(); var paramList = new List <KeyValuePair <string, string> >() { new KeyValuePair <string, string>("locatorboard_id", id) }; ds = DataServices.DataSetFromSQL(sql, paramList); DataTable dt = ds.Tables[0]; LocatorBoardModel model = new LocatorBoardModel(); model.LocatorBoardId = id; try { model.LocatorBoardName = dt.Rows[0]["locatorboardname"].ToString(); } catch { } try { model.LocatorBoardDescription = dt.Rows[0]["locatorboarddescription"].ToString(); } catch { } model.BaseViewNamespaceId = dt.Rows[0]["locationbaseviewnamespace_id"].ToString(); model.ListId = dt.Rows[0]["list_id"].ToString(); model.ListLocationField = dt.Rows[0]["listlocationfield"].ToString(); model.BaseViewId = dt.Rows[0]["locationbaseview_id"].ToString(); model.LocationIDField = dt.Rows[0]["locationidfield"].ToString(); model.Heading = dt.Rows[0]["locationdisplayfield"].ToString(); model.TopLeftField = dt.Rows[0]["topleftfield"].ToString(); model.TopRightField = dt.Rows[0]["toprightfield"].ToString(); ViewBag.PreviewURL = SynapseHelpers.GetEBoardURL() + "locatorboard.aspx?id=" + id + "&Location=XXXXX"; string sqlBaseView = "SELECT * FROM listsettings.baseviewmanager WHERE baseviewnamespaceid = @id ORDER BY baseviewname;"; var paramListBaseView = new List <KeyValuePair <string, string> >() { new KeyValuePair <string, string>("id", model.BaseViewNamespaceId) }; DataSet dsBaseView = DataServices.DataSetFromSQL(sqlBaseView, paramListBaseView); ViewBag.BaseView = ToSelectList(dsBaseView.Tables[0], "baseview_id", "baseviewname"); string sqlAtt = "SELECT attributename FROM listsettings.baseviewattribute WHERE baseview_id = @id ORDER BY attributename;"; var paramListAtt = new List <KeyValuePair <string, string> >() { new KeyValuePair <string, string>("id", model.BaseViewId) }; DataSet dsAtt = DataServices.DataSetFromSQL(sqlAtt, paramListAtt); List <SelectListItem> list = new List <SelectListItem>(); ViewBag.AttributeList = ToSelectList(dsAtt.Tables[0], "attributename", "attributename"); return(View(model)); }