using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Data; using DataLibrary; namespace CoreSavingLibrary { public class MenuReport { private String application; private String pageLink; private String groupid; private String groupname; public String Application { get { return application; } set { application = value; } } public String PageLink { get { return pageLink; } set { pageLink = value; } } public String GroupID { get { return groupid; } set { groupid = value; } } public String GroupName { get { return groupname; } set { groupname = value; } } public List GetMenuReport(Sta oracleTa, String appl, String userName) { WebState state = new WebState(); return GetMenuReport(oracleTa, appl, userName, state.SsCoopId); } public List GetMenuReport(Sta oracleTa, String appl, String userName, String coopId) { List menu = new List(); DataTable dt; try { String sql = ""; if (coopId == "") { sql = "select * from cmcoopmaster"; dt = oracleTa.QueryDataTable(sql); if (dt.Rows.Count > 0) { coopId = dt.Rows[0]["coop_control"].ToString().Trim(); } } sql = @" select application, group_id, group_name from webreportgroup where used_flag = 1 and (application = UPPER('" + appl + @"') or application = LOWER('" + appl + @"')) and group_id in (select distinct group_id from amsecreportpermiss where user_name='" + userName + @"' and coop_id='" + coopId + @"' and check_flag=1) order by group_order "; //Doys dt = oracleTa.QueryDataTable(sql); for (int i = 0; i < dt.Rows.Count; i++) { MenuReport m = new MenuReport(); m.Application = dt.Rows[i]["APPLICATION"].ToString().Trim(); m.GroupID = dt.Rows[i]["GROUP_ID"].ToString(); m.GroupName = dt.Rows[i]["GROUP_NAME"].ToString(); m.PageLink = WebUtil.GetSavingUrl() + String.Format("ReportDefault.aspx?app={1}&setApp={1}&gid={0}", dt.Rows[i]["GROUP_ID"], appl); menu.Add(m); } } catch (Exception ex) { String strEl = ex.ToString(); } return menu; } } }