private List <RoadFlow.Data.Model.MenuUser> DataReaderToList(SqlDataReader dataReader) { List <RoadFlow.Data.Model.MenuUser> list = new List <RoadFlow.Data.Model.MenuUser>(); RoadFlow.Data.Model.MenuUser menuUser = null; while (dataReader.Read()) { menuUser = new RoadFlow.Data.Model.MenuUser(); menuUser.ID = dataReader.GetGuid(0); menuUser.MenuID = dataReader.GetGuid(1); menuUser.SubPageID = dataReader.GetGuid(2); menuUser.Organizes = dataReader.GetString(3); menuUser.Users = dataReader.GetString(4); if (!dataReader.IsDBNull(5)) { menuUser.Buttons = dataReader.GetString(5); } if (!dataReader.IsDBNull(6)) { menuUser.Params = dataReader.GetString(6); } list.Add(menuUser); } return(list); }
/// <summary> /// 更新菜单使用人员 /// </summary> /// <param name="menuUser">菜单使用人员实体</param> public int Update(Model.MenuUser menuUser) { ClearCache(); using (var db = new DataContext()) { db.Update(menuUser); return(db.SaveChanges()); } }
public int Update(RoadFlow.Data.Model.MenuUser model) { string sql = "UPDATE MenuUser SET \r\n\t\t\t\tMenuID=@MenuID,SubPageID=@SubPageID,Organizes=@Organizes,Users=@Users,Buttons=@Buttons,Params=@Params\r\n\t\t\t\tWHERE ID=@ID"; SqlParameter[] parameter = new SqlParameter[7] { new SqlParameter("@MenuID", SqlDbType.UniqueIdentifier, -1) { Value = model.MenuID }, new SqlParameter("@SubPageID", SqlDbType.UniqueIdentifier, -1) { Value = model.SubPageID }, new SqlParameter("@Organizes", SqlDbType.VarChar, 100) { Value = model.Organizes }, new SqlParameter("@Users", SqlDbType.VarChar, -1) { Value = model.Users }, (model.Buttons == null) ? new SqlParameter("@Buttons", SqlDbType.VarChar, -1) { Value = DBNull.Value } : new SqlParameter("@Buttons", SqlDbType.VarChar, -1) { Value = model.Buttons }, (model.Params == null) ? new SqlParameter("@Params", SqlDbType.VarChar, -1) { Value = DBNull.Value } : new SqlParameter("@Params", SqlDbType.VarChar, -1) { Value = model.Params }, new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1) { Value = model.ID } }; return(dbHelper.Execute(sql, parameter)); }
public int Add(RoadFlow.Data.Model.MenuUser model) { string sql = "INSERT INTO MenuUser\r\n\t\t\t\t(ID,MenuID,SubPageID,Organizes,Users,Buttons,Params) \r\n\t\t\t\tVALUES(@ID,@MenuID,@SubPageID,@Organizes,@Users,@Buttons,@Params)"; SqlParameter[] parameter = new SqlParameter[7] { new SqlParameter("@ID", SqlDbType.UniqueIdentifier, -1) { Value = model.ID }, new SqlParameter("@MenuID", SqlDbType.UniqueIdentifier, -1) { Value = model.MenuID }, new SqlParameter("@SubPageID", SqlDbType.UniqueIdentifier, -1) { Value = model.SubPageID }, new SqlParameter("@Organizes", SqlDbType.VarChar, 100) { Value = model.Organizes }, new SqlParameter("@Users", SqlDbType.VarChar, -1) { Value = model.Users }, (model.Buttons == null) ? new SqlParameter("@Buttons", SqlDbType.VarChar, -1) { Value = DBNull.Value } : new SqlParameter("@Buttons", SqlDbType.VarChar, -1) { Value = model.Buttons }, (model.Params == null) ? new SqlParameter("@Params", SqlDbType.VarChar, -1) { Value = DBNull.Value } : new SqlParameter("@Params", SqlDbType.VarChar, -1) { Value = model.Params } }; return(dbHelper.Execute(sql, parameter)); }
private List <RoadFlow.Data.Model.MenuUser> DataReaderToList(OracleDataReader dataReader) { List <RoadFlow.Data.Model.MenuUser> list = new List <RoadFlow.Data.Model.MenuUser>(); RoadFlow.Data.Model.MenuUser menuUser = null; while (((DbDataReader)dataReader).Read()) { menuUser = new RoadFlow.Data.Model.MenuUser(); menuUser.ID = ((DbDataReader)dataReader).GetString(0).ToGuid(); menuUser.MenuID = ((DbDataReader)dataReader).GetString(1).ToGuid(); menuUser.SubPageID = ((DbDataReader)dataReader).GetString(2).ToGuid(); menuUser.Organizes = ((DbDataReader)dataReader).GetString(3); menuUser.Users = ((DbDataReader)dataReader).GetString(4); if (!((DbDataReader)dataReader).IsDBNull(5)) { menuUser.Buttons = ((DbDataReader)dataReader).GetString(5); } list.Add(menuUser); } return(list); }
public int Update(RoadFlow.Data.Model.MenuUser model) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_002c: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_004c: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_0067: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown //IL_0082: Expected O, but got Unknown //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_00be: Expected O, but got Unknown //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_00de: Expected O, but got Unknown string sql = "UPDATE MenuUser SET \r\n\t\t\t\tMenuID=:MenuID,SubPageID=:SubPageID,Organizes=:Organizes,Users=:Users,Buttons=:Buttons\r\n\t\t\t\tWHERE ID=:ID"; OracleParameter[] obj = new OracleParameter[6]; OracleParameter val = new OracleParameter(":MenuID", 126); ((DbParameter)val).Value = model.MenuID; obj[0] = val; OracleParameter val2 = new OracleParameter(":SubPageID", 126); ((DbParameter)val2).Value = model.SubPageID; obj[1] = val2; OracleParameter val3 = new OracleParameter(":Organizes", 126); ((DbParameter)val3).Value = model.Organizes; obj[2] = val3; OracleParameter val4 = new OracleParameter(":Users", 126); ((DbParameter)val4).Value = model.Users; obj[3] = val4; _003F val5; if (model.Buttons != null) { val5 = new OracleParameter(":Buttons", 126); ((DbParameter)val5).Value = model.Buttons; } else { val5 = new OracleParameter(":Buttons", 126); ((DbParameter)val5).Value = DBNull.Value; } obj[4] = val5; OracleParameter val6 = new OracleParameter(":ID", 126); ((DbParameter)val6).Value = model.ID; obj[5] = val6; OracleParameter[] parameter = (OracleParameter[])obj; return(dbHelper.Execute(sql, parameter)); }
public int Add(RoadFlow.Data.Model.MenuUser model) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_002c: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_004c: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown //IL_006c: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown //IL_0087: Expected O, but got Unknown //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown //IL_00a2: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_00de: Expected O, but got Unknown string sql = "INSERT INTO MenuUser\r\n\t\t\t\t(ID,MenuID,SubPageID,Organizes,Users,Buttons) \r\n\t\t\t\tVALUES(:ID,:MenuID,:SubPageID,:Organizes,:Users,:Buttons)"; OracleParameter[] obj = new OracleParameter[6]; OracleParameter val = new OracleParameter(":ID", 126); ((DbParameter)val).Value = model.ID; obj[0] = val; OracleParameter val2 = new OracleParameter(":MenuID", 126); ((DbParameter)val2).Value = model.MenuID; obj[1] = val2; OracleParameter val3 = new OracleParameter(":SubPageID", 126); ((DbParameter)val3).Value = model.SubPageID; obj[2] = val3; OracleParameter val4 = new OracleParameter(":Organizes", 126); ((DbParameter)val4).Value = model.Organizes; obj[3] = val4; OracleParameter val5 = new OracleParameter(":Users", 126); ((DbParameter)val5).Value = model.Users; obj[4] = val5; _003F val6; if (model.Buttons != null) { val6 = new OracleParameter(":Buttons", 126); ((DbParameter)val6).Value = model.Buttons; } else { val6 = new OracleParameter(":Buttons", 126); ((DbParameter)val6).Value = DBNull.Value; } obj[5] = val6; OracleParameter[] parameter = (OracleParameter[])obj; return(dbHelper.Execute(sql, parameter)); }
private void getMenuTreeTableHtml(StringBuilder sb, DataTable appDt, Guid parentID, List <RoadFlow.Data.Model.MenuUser> menuUsers, string orgID, Guid?userId = default(Guid?)) { DataRow[] array = appDt.Select("ParentID='" + parentID.ToString() + "'"); DataRow[] array2 = array; foreach (DataRow dr in array2) { string source; string @params; if (!userId.HasValue || !userId.HasValue || userId.Value.IsEmptyGuid() || HasUse(dr["ID"].ToString().ToGuid(), userId.Value, menuUsers, out source, out @params)) { RoadFlow.Data.Model.MenuUser menuUser = menuUsers.Find(delegate(RoadFlow.Data.Model.MenuUser p) { if (p.MenuID == dr["ID"].ToString().ToGuid() && p.SubPageID.IsEmptyGuid()) { return(p.Organizes.Contains(orgID, StringComparison.CurrentCultureIgnoreCase)); } return(false); }); string text = (menuUser != null) ? " checked=\"checked\"" : ""; sb.Append("<tr id=\"" + dr["ID"] + "\" data-pid=\"" + dr["ParentID"] + "\">"); sb.Append("<td>" + dr["Title"] + "</td>"); if (!dr["Ico"].ToString().IsNullOrEmpty()) { sb.Append("<td><input type=\"hidden\" name=\"apptype\" value=\"0\"/>" + (dr["Ico"].ToString().IsFontIco() ? ("<i class=\"fa " + dr["Ico"].ToString() + "\" style=\"font-size:14px;\"></i>") : ("<img src=\"" + dr["Ico"] + "\" style=\"vertical-align:middle;\"/>")) + "</td>"); } else { sb.Append("<td><input type=\"hidden\" name=\"apptype\" value=\"0\"/>" + (dr["AppIco"].ToString().IsNullOrEmpty() ? "" : (dr["AppIco"].ToString().IsFontIco() ? ("<i class=\"fa " + dr["AppIco"].ToString() + "\" style=\"font-size:14px;\"></i>") : ("<img src=\"" + dr["AppIco"] + "\" style=\"vertical-align:middle;\"/>"))) + "</td>"); } sb.Append("<td style=\"text-align:center\"><input type=\"checkbox\" " + text + " onclick=\"appboxclick(this);\" name=\"menuid\" value=\"" + dr["ID"] + "\"/></td>"); sb.Append("<td>"); bool flag = dr["AppLibraryID"].ToString().IsGuid(); if (flag) { foreach (RoadFlow.Data.Model.AppLibraryButtons1 item in from p in new AppLibraryButtons1().GetAllByAppID(dr["AppLibraryID"].ToString().ToGuid()) orderby p.ShowType, p.Sort select p) { text = ((menuUser != null && menuUser.Buttons.Contains(item.ID.ToString(), StringComparison.CurrentCultureIgnoreCase)) ? " checked=\"checked\"" : ""); sb.Append("<input type=\"checkbox\" " + text + " onclick=\"buttonboxclick(this);\" style=\"vertical-align:middle;\" id=\"button_" + dr["ID"] + "_" + item.ID + "\" name=\"button_" + dr["ID"] + "\" value=\"" + item.ID + "\"/>"); sb.Append("<label style=\"vertical-align:middle;\" for=\"button_" + dr["ID"] + "_" + item.ID + "\">" + item.Name + "</label>"); } } sb.Append("</td>"); if (flag) { sb.Append("<td><input type=\"text\" class=\"mytext\" style=\"width:95%\" value=\"" + ((menuUser != null) ? menuUser.Params : "") + "\" name=\"params_" + dr["id"] + "\"/></td>"); } else { sb.Append("<td> </td>"); } sb.Append("</tr>"); if (flag) { foreach (RoadFlow.Data.Model.AppLibrarySubPages item2 in from p in new AppLibrarySubPages().GetAllByAppID(dr["AppLibraryID"].ToString().ToGuid()) orderby p.Sort select p) { menuUser = menuUsers.Find(delegate(RoadFlow.Data.Model.MenuUser p) { if (p.MenuID == dr["ID"].ToString().ToGuid() && p.SubPageID == item2.ID) { return(p.Organizes.Contains(orgID, StringComparison.CurrentCultureIgnoreCase)); } return(false); }); text = ((menuUser != null) ? " checked=\"checked\"" : ""); sb.Append("<tr id=\"" + item2.ID + "\" data-pid=\"" + dr["ID"] + "\">"); sb.Append("<td>" + item2.Name + "</td>"); sb.Append("<td><input type=\"hidden\" name=\"apptype\" value=\"1\"/></td>"); sb.Append("<td style=\"text-align:center\"><input type=\"checkbox\" " + text + " onclick=\"appboxclick(this);\" name=\"subpage_" + dr["id"] + "\" value=\"" + item2.ID + "\"/></td>"); sb.Append("<td>"); foreach (RoadFlow.Data.Model.AppLibraryButtons1 item3 in new AppLibraryButtons1().GetAllByAppID(item2.ID).OrderBy((RoadFlow.Data.Model.AppLibraryButtons1 p) => p.ShowType).ThenBy((RoadFlow.Data.Model.AppLibraryButtons1 p) => p.Sort)) { text = ((menuUser != null && menuUser.Buttons.Contains(item3.ID.ToString(), StringComparison.CurrentCultureIgnoreCase)) ? " checked=\"checked\"" : ""); sb.Append("<input type=\"checkbox\" " + text + " onclick=\"buttonboxclick(this);\" style=\"vertical-align:middle;\" id=\"button_" + item2.ID + "_" + item3.ID + "\" name=\"button_" + dr["id"] + "_" + item2.ID + "\" value=\"" + item3.ID + "\"/>"); sb.Append("<label style=\"vertical-align:middle;\" for=\"button_" + item2.ID + "_" + item3.ID + "\">" + item3.Name + "</label>"); } sb.Append("</td>"); sb.Append("<td> </td>"); sb.Append("</tr>"); } } getMenuTreeTableHtml(sb, appDt, dr["ID"].ToString().ToGuid(), menuUsers, orgID, userId); } } }
public int Update(RoadFlow.Data.Model.MenuUser model) { return(dataMenuUser.Update(model)); }
public int Add(RoadFlow.Data.Model.MenuUser model) { return(dataMenuUser.Add(model)); }
public int Add(RoadFlow.Data.Model.MenuUser model) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0031: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_0056: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_007b: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_009b: Expected O, but got Unknown //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Expected O, but got Unknown //IL_00ba: Expected O, but got Unknown //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Expected O, but got Unknown //IL_00fe: Expected O, but got Unknown //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Expected O, but got Unknown //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Expected O, but got Unknown //IL_0142: Expected O, but got Unknown string sql = "INSERT INTO menuuser\r\n\t\t\t\t(ID,MenuID,SubPageID,Organizes,Users,Buttons,Params) \r\n\t\t\t\tVALUES(@ID,@MenuID,@SubPageID,@Organizes,@Users,@Buttons,@Params)"; MySqlParameter[] obj = new MySqlParameter[7]; MySqlParameter val = new MySqlParameter("@ID", 253, 36); ((DbParameter)val).Value = model.ID; obj[0] = val; MySqlParameter val2 = new MySqlParameter("@MenuID", 253, 36); ((DbParameter)val2).Value = model.MenuID; obj[1] = val2; MySqlParameter val3 = new MySqlParameter("@SubPageID", 253, 36); ((DbParameter)val3).Value = model.SubPageID; obj[2] = val3; MySqlParameter val4 = new MySqlParameter("@Organizes", 253, 100); ((DbParameter)val4).Value = model.Organizes; obj[3] = val4; MySqlParameter val5 = new MySqlParameter("@Users", 751, -1); ((DbParameter)val5).Value = model.Users; obj[4] = val5; _003F val6; if (model.Buttons != null) { val6 = new MySqlParameter("@Buttons", 751, -1); ((DbParameter)val6).Value = model.Buttons; } else { val6 = new MySqlParameter("@Buttons", 751, -1); ((DbParameter)val6).Value = DBNull.Value; } obj[5] = val6; _003F val7; if (model.Params != null) { val7 = new MySqlParameter("@Params", 751, -1); ((DbParameter)val7).Value = model.Params; } else { val7 = new MySqlParameter("@Params", 751, -1); ((DbParameter)val7).Value = DBNull.Value; } obj[6] = val7; MySqlParameter[] parameter = (MySqlParameter[])obj; return(dbHelper.Execute(sql, parameter)); }
public int Update(RoadFlow.Data.Model.MenuUser model) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0031: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_0056: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_0076: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_0095: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_00d9: Expected O, but got Unknown //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Expected O, but got Unknown //IL_011d: Expected O, but got Unknown //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Expected O, but got Unknown //IL_0142: Expected O, but got Unknown string sql = "UPDATE menuuser SET \r\n\t\t\t\tMenuID=@MenuID,SubPageID=@SubPageID,Organizes=@Organizes,Users=@Users,Buttons=@Buttons,Params=@Params\r\n\t\t\t\tWHERE ID=@ID"; MySqlParameter[] obj = new MySqlParameter[7]; MySqlParameter val = new MySqlParameter("@MenuID", 253, 36); ((DbParameter)val).Value = model.MenuID; obj[0] = val; MySqlParameter val2 = new MySqlParameter("@SubPageID", 253, 36); ((DbParameter)val2).Value = model.SubPageID; obj[1] = val2; MySqlParameter val3 = new MySqlParameter("@Organizes", 253, 100); ((DbParameter)val3).Value = model.Organizes; obj[2] = val3; MySqlParameter val4 = new MySqlParameter("@Users", 751, -1); ((DbParameter)val4).Value = model.Users; obj[3] = val4; _003F val5; if (model.Buttons != null) { val5 = new MySqlParameter("@Buttons", 751, -1); ((DbParameter)val5).Value = model.Buttons; } else { val5 = new MySqlParameter("@Buttons", 751, -1); ((DbParameter)val5).Value = DBNull.Value; } obj[4] = val5; _003F val6; if (model.Params != null) { val6 = new MySqlParameter("@Params", 751, -1); ((DbParameter)val6).Value = model.Params; } else { val6 = new MySqlParameter("@Params", 751, -1); ((DbParameter)val6).Value = DBNull.Value; } obj[5] = val6; MySqlParameter val7 = new MySqlParameter("@ID", 253, 36); ((DbParameter)val7).Value = model.ID; obj[6] = val7; MySqlParameter[] parameter = (MySqlParameter[])obj; return(dbHelper.Execute(sql, parameter)); }