public override void EditSpeedDial(string extension, SpeedDial newspeeddial, SpeedDial exspeeddial) { log.Debug("Editing speeddial " + exspeeddial.displayName + " from " + extension); string sql = "update speeddial set label = '" + newspeeddial.displayName + "', labelascii = '" + newspeeddial.displayName + "', speeddialindex = " + newspeeddial.position + ", speeddialnumber = '" + newspeeddial.directoryNumber + "' where fkdevice in (select pkid from device d where pkid in (select fkdevice from devicenumplanmap where fknumplan in (select pkid from numplan where dnorpattern = '" + extension + "'"; if (defaultContext != "") { sql += " and fkroutepartition in (select pkid from routepartition where name = '" + defaultContext + "')"; } sql += "))) and label = '" + exspeeddial.displayName + "' and speeddialindex = " + exspeeddial.position + " and speeddialnumber = '" + exspeeddial.directoryNumber + "'"; ExecuteSQLUpdateReq esur = new ExecuteSQLUpdateReq(); esur.sql = sql; log.Debug(_aas.executeSQLUpdate(esur)[email protected] + " speeddial(s) updated from " + extension); }
public override void AddSpeedDial(string extension, SpeedDial speeddial) { log.Debug("Adding speedial " + speeddial.displayName + " from " + extension); string sql = "insert into speeddial (label, labelascii, speeddialindex, speeddialnumber,fkdevice) select '" + speeddial.displayName + "','" + speeddial.displayName + "', "; sql += "(select max(speeddialindex) from speeddial where fkdevice in (select fkdevice from devicenumplanmap where fknumplan in (select pkid from numplan where dnorpattern = '" + extension + "')))"; sql += ", '" + speeddial.directoryNumber + "', pkid from device where pkid in (select fkdevice from devicenumplanmap where fknumplan in (select pkid from numplan where dnorpattern = '" + extension + "'"; if (defaultContext != "") { sql += " and fkroutepartition in (select pkid from routepartition where name = '" + defaultContext + "')"; } sql += ")))"; ExecuteSQLUpdateReq esur = new ExecuteSQLUpdateReq(); esur.sql = sql; log.Debug(_aas.executeSQLUpdate(esur)[email protected] + " speeddial(s) added from " + extension); }
public override void SetPrivacy(string dn, bool isprivate) { System.Web.HttpContext.Current.Cache.Add(dn + "_privacy", isprivate, null, DateTime.Now.AddHours(10), System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, OnCacheSuppress); ExecuteSQLUpdateReq query = new ExecuteSQLUpdateReq(); if (isprivate) { query.sql = "insert into enduserdirgroupmap (fkenduser, fkdirgroup) select eu.pkid, dg.pkid from enduser eu, dirgroup dg where eu.userid in ("; query.sql = "select distinct eu.pkid from enduser eu"; query.sql += " inner join endusernumplanmap eunpm on eu.pkid = eunpm.fkenduser "; query.sql += "inner join numplan np on np.pkid = eunpm.fknumplan where dnorpattern in ('"; query.sql += dn + "') and dg.name = '" + System.Web.Configuration.WebConfigurationManager.AppSettings["CiscoPrivacyGroup"] + "'"; } else { query.sql = "delete from enduserdirgroupmap where fkenduser in (select pkid from enduser where userid = in ("; query.sql = "select distinct eu.pkid from enduser eu"; query.sql += " inner join endusernumplanmap eunpm on eu.pkid = eunpm.fkenduser "; query.sql += "inner join numplan np on np.pkid = eunpm.fknumplan where dnorpattern in ('"; query.sql += dn + "') and fkdirgroup in (select pkid from dirgroup where name = '" + System.Web.Configuration.WebConfigurationManager.AppSettings["CiscoPrivacyGroup"] + "')"; } _aas.executeSQLUpdate(query); }
public override void AddSpeedDial(string extension, SpeedDial speeddial) { log.Debug("Adding speedial " + speeddial.displayName + " from " + extension); string sql = "insert into speeddial (label, labelascii, speeddialindex, speeddialnumber,fkdevice) select '" + speeddial.displayName + "','" + speeddial.displayName + "', "; sql += "(select max(speeddialindex) from speeddial where fkdevice in (select fkdevice from devicenumplanmap where fknumplan in (select pkid from numplan where dnorpattern = '"+extension+"')))"; sql += ", '" + speeddial.directoryNumber + "', pkid from device where pkid in (select fkdevice from devicenumplanmap where fknumplan in (select pkid from numplan where dnorpattern = '" + extension + "'"; if (defaultContext != "") { sql += " and fkroutepartition in (select pkid from routepartition where name = '" + defaultContext + "')"; } sql += ")))"; ExecuteSQLUpdateReq esur = new ExecuteSQLUpdateReq(); esur.sql = sql; log.Debug(_aas.executeSQLUpdate(esur)[email protected] + " speeddial(s) added from " + extension); }