/// <summary> /// 保存ToolBar显示情况 /// </summary> /// <param name="tbInfo"></param> public int SetToolBarData(ToolBarInfo tbInfo) { string sqlWhere = " where c_type='NG3_ToolBarInfo' and logid='" + tbInfo.LogID + "' and c_name='" + tbInfo.PageID + "'"; if (string.IsNullOrEmpty(tbInfo.Value) || tbInfo.Value == "{}") { return(DbHelper.ExecuteNonQuery("delete from c_sys_userparm" + sqlWhere)); } string sqlstr = "select * from c_sys_userparm" + sqlWhere; DataTable tmpDT = DbHelper.GetDataTable(sqlstr); if (tmpDT.Rows.Count == 0) { sqlstr = "select c_code from c_sys_userparm order by c_code desc"; DataTable dt = DbHelper.GetDataTable(sqlstr); int c_code = 1; if (dt.Rows.Count > 0) { c_code = Convert.ToInt32(dt.Rows[0]["c_code"]) + 1; } DataRow dr = tmpDT.NewRow(); dr["c_code"] = c_code.ToString("0000000000"); dr["logid"] = tbInfo.LogID; dr["c_name"] = tbInfo.PageID; dr["c_value"] = tbInfo.Value; dr["c_type"] = "NG3_ToolBarInfo"; tmpDT.Rows.Add(dr); } else { tmpDT.Rows[0]["c_value"] = tbInfo.Value; } return(DbHelper.Update(tmpDT, "select * from c_sys_userparm")); }
/// <summary> /// 保存ToolBar显示情况 /// </summary> /// <param name="PageId"></param> /// <param name="HideBtns"></param> public void SetToolBarData(string PageId, string HideBtns) { ToolBarInfo tbInfo = new ToolBarInfo(); tbInfo.PageID = PageId; tbInfo.LogID = NG3.AppInfoBase.LoginID; tbInfo.Value = HideBtns; proxy.SetToolBarData(tbInfo); }
/// <summary> /// 获取ToolBar显示情况 /// </summary> ///<param name="LoginID"></param> ///<param name="PageId"></param> public ToolBarInfo GetToolBarData(string LoginID, string PageId) { ToolBarInfo tbInfo = new ToolBarInfo(); tbInfo.LogID = LoginID; tbInfo.PageID = PageId; string sqlWhere = " where c_type='NG3_ToolBarInfo' and logid='" + LoginID + "' and c_name='" + PageId + "'"; string sqlstr = "select c_value from c_sys_userparm" + sqlWhere; DataTable tmpDT = DbHelper.GetDataTable(sqlstr); if (tmpDT.Rows.Count == 0) { tbInfo.Value = "{}"; } else { tbInfo.Value = tmpDT.Rows[0]["c_value"].ToString(); } return(tbInfo); }
/// <summary> /// 获取ToolBar显示情况 /// </summary> /// <param name="PageId"></param> public JsonResult GetToolBarData(string PageId) { ToolBarInfo tbInfo = proxy.GetToolBarData(NG3.AppInfoBase.LoginID, PageId); return(Json(tbInfo, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 保存ToolBar显示情况 /// </summary> /// <param name="tbInfo"></param> public int SetToolBarData(ToolBarInfo tbInfo) { return(layoutLogDac.SetToolBarData(tbInfo)); }