public override SpeedDial[] GetSpeedDials(string extension) { log.Debug("GetSpeedDial from " + extension); List<SpeedDial> speeddials = new List<SpeedDial>(); string sql = "select label, speeddialindex, speeddialnumber from speeddial 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 += ")))"; ExecuteSQLQueryReq esqr = new ExecuteSQLQueryReq(); esqr.sql = sql; ExecuteSQLQueryRes esqres = _aas.executeSQLQuery(esqr); if (esqres.@return != null) { if ([email protected] > 0) { foreach (XmlNode[] nodes in esqres.@return) { SpeedDial sd = new SpeedDial(); sd.displayName = nodes[0].InnerText; sd.directoryNumber = nodes[2].InnerText; sd.position = Convert.ToInt32(nodes[1].InnerText); speeddials.Add(sd); } } else { log.Debug("No speeddial available for " + extension); } } return speeddials.ToArray(); }
public void RemoveSpeedDial(string extension, SpeedDial speeddial, string token) { log.Debug("Removing speeddial: " + speeddial.displayName + " from " + extension); if (ValidateToken(token, extension)) { SpeedDialService.RemoveSpeedDial(extension, speeddial); } }
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 SpeedDial[] GetSpeedDials(string extension) { log.Debug("GetSpeedDial from " + extension); List <SpeedDial> speeddials = new List <SpeedDial>(); string sql = "select label, speeddialindex, speeddialnumber from speeddial 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 += ")))"; ExecuteSQLQueryReq esqr = new ExecuteSQLQueryReq(); esqr.sql = sql; ExecuteSQLQueryRes esqres = _aas.executeSQLQuery(esqr); if (esqres.@return != null) { if ([email protected] > 0) { foreach (XmlNode[] nodes in esqres.@return) { SpeedDial sd = new SpeedDial(); sd.displayName = nodes[0].InnerText; sd.directoryNumber = nodes[2].InnerText; sd.position = Convert.ToInt32(nodes[1].InnerText); speeddials.Add(sd); } } else { log.Debug("No speeddial available for " + extension); } } return(speeddials.ToArray()); }
public static void EditSpeedDial(string extension, SpeedDial newspeeddial, SpeedDial exspeeddial) { _provider.EditSpeedDial(extension, newspeeddial, exspeeddial); }
public override void EditSpeedDial(string extension, SpeedDial newspeeddial, SpeedDial exspeeddial) { throw new NotImplementedException(); }
public override void RemoveSpeedDial(string extension, SpeedDial speeddial) { throw new NotImplementedException(); }
public abstract void EditSpeedDial(string extension, SpeedDial newspeeddial, SpeedDial exspeeddial);
public abstract void RemoveSpeedDial(string extension, SpeedDial speeddial);
public abstract void AddSpeedDial(string extension, SpeedDial speeddial);
public static void AddSpeedDial(string extension, SpeedDial speeddial){ _provider.AddSpeedDial(extension, speeddial); }
public static void RemoveSpeedDial(string extension, SpeedDial speeddial) { _provider.RemoveSpeedDial(extension, speeddial); }
public static void EditSpeedDial(string extension, SpeedDial newspeeddial, SpeedDial exspeeddial) { _provider.EditSpeedDial(extension,newspeeddial,exspeeddial); }
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 void EditSpeedDial(string extension, SpeedDial newspeeddial, SpeedDial exspeeddial, string token) { log.Debug("Edit speeddial: " + exspeeddial.displayName + " from " + extension); if (ValidateToken(token, extension)) { SpeedDialService.EditSpeedDial(extension, newspeeddial,exspeeddial); } }
public static void AddSpeedDial(string extension, SpeedDial speeddial) { _provider.AddSpeedDial(extension, speeddial); }