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();
 }
Example #2
0
 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);
     }
 }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
        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());
        }
Example #6
0
 public static void EditSpeedDial(string extension, SpeedDial newspeeddial, SpeedDial exspeeddial)
 {
     _provider.EditSpeedDial(extension, newspeeddial, exspeeddial);
 }
Example #7
0
 public override void EditSpeedDial(string extension, SpeedDial newspeeddial, SpeedDial exspeeddial)
 {
     throw new NotImplementedException();
 }
Example #8
0
 public override void RemoveSpeedDial(string extension, SpeedDial speeddial)
 {
     throw new NotImplementedException();
 }
Example #9
0
 public abstract void EditSpeedDial(string extension, SpeedDial newspeeddial, SpeedDial exspeeddial);
Example #10
0
 public abstract void RemoveSpeedDial(string extension, SpeedDial speeddial);
Example #11
0
 public abstract void AddSpeedDial(string extension, SpeedDial speeddial);
Example #12
0
 public static void AddSpeedDial(string extension, SpeedDial speeddial){
     _provider.AddSpeedDial(extension, speeddial);
 }
Example #13
0
 public static void RemoveSpeedDial(string extension, SpeedDial speeddial)
 {
     _provider.RemoveSpeedDial(extension, speeddial);
 }
Example #14
0
 public override void RemoveSpeedDial(string extension, SpeedDial speeddial)
 {
     throw new NotImplementedException();
 }
Example #15
0
 public abstract void EditSpeedDial(string extension, SpeedDial newspeeddial, SpeedDial exspeeddial);
Example #16
0
 public abstract void RemoveSpeedDial(string extension, SpeedDial speeddial);
Example #17
0
 public abstract void AddSpeedDial(string extension, SpeedDial speeddial);
Example #18
0
 public static void EditSpeedDial(string extension, SpeedDial newspeeddial, SpeedDial exspeeddial)
 {
     _provider.EditSpeedDial(extension,newspeeddial,exspeeddial);
 }
Example #19
0
 public static void RemoveSpeedDial(string extension, SpeedDial speeddial)
 {
     _provider.RemoveSpeedDial(extension, speeddial);
 }
Example #20
0
 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);
 }
Example #21
0
 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); 
 }
Example #22
0
 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);
     }
 }
Example #23
0
 public override void EditSpeedDial(string extension, SpeedDial newspeeddial, SpeedDial exspeeddial)
 {
     throw new NotImplementedException();
 }
Example #24
0
 public static void AddSpeedDial(string extension, SpeedDial speeddial)
 {
     _provider.AddSpeedDial(extension, speeddial);
 }