public static bool InsertNewVpnType(string name) { bool retVal = false; using (VpnManagerEntities entities = new VpnManagerEntities()) { VpnType conn = new VpnType(); conn.Name = name; entities.VpnType.Add(conn); retVal = entities.SaveChanges() > 0; } return(retVal); }
public static bool EditVpnType(int connectioTypeId, string name) { bool retVal = false; if (connectioTypeId != 0 && !string.IsNullOrEmpty(name)) { using (VpnManagerEntities entities = new VpnManagerEntities()) { VpnType conn = (from ct in entities.VpnType where ct.Id == connectioTypeId select ct).FirstOrDefault(); if (conn != null) { conn.Name = name; retVal = entities.SaveChanges() > 0; } } } return(retVal); }
public static List <string> GetVMWhereItWorks(VpnType vp) { string temp = vp.WorkOnMachine; return(temp.Split(';').ToList()); }