public JObject CreateStudio(String connection, UDC.Studio studio) { try { JObject jsonObj = default(JObject); jsonObj = new JObject(); jsonObj = JObject.Parse(studio.StudioData); List <JToken> results = jsonObj.Children().ToList(); ArrayList new_nodes = new ArrayList(); DataTable table = new DataTable("temp_ivr_flows"); DataColumn col1 = new DataColumn("node_id", System.Type.GetType("System.Int32")); DataColumn col2 = new DataColumn("node_type", System.Type.GetType("System.String")); DataColumn col3 = new DataColumn("xml_data", System.Type.GetType("System.String")); table.Columns.Add(col1); table.Columns.Add(col2); table.Columns.Add(col3); int i = 1; foreach (JProperty item in results) { new_nodes.Add(Convert.ToInt32(item.Name)); object[] val = new object[3]; val[0] = item.Name; val[1] = item.Value["type"].ToString(); val[2] = item.Value["data"].ToString(); table.Rows.Add(val); i = i + 1; } XmlDocument xmlobj = new XmlDocument(); xmlobj.LoadXml(studio.StudioXml); Press3.DataAccessLayer.Studio studioObj = new Press3.DataAccessLayer.Studio(connection); DataSet ds = studioObj.CreateOrUpdateStudio(studio, table); if (ds == null) { helper.CreateProperty(UDC.Label.MESSAGE, "No data returned from database"); helper.CreateProperty(UDC.Label.SUCCESS, false); } else { helper.ParseDataSet(ds); } } catch (Exception ex) { Logger.Error("Exception In BAL.CreateStudio " + ex.ToString()); } return(helper.GetResponse()); }
public JObject GetStudioDetails(String connection, int accountId, int studioId) { try { Press3.DataAccessLayer.Studio studioObj = new Press3.DataAccessLayer.Studio(connection); DataSet ds = studioObj.GetStudioDetails(accountId, studioId); if (ds == null) { helper.CreateProperty(UDC.Label.MESSAGE, "No data returned from database"); helper.CreateProperty(UDC.Label.SUCCESS, false); } else { helper.ParseDataSet(ds); } } catch (Exception ex) { Logger.Error("Exception In BAL.GetStudioDetails " + ex.ToString()); } return(helper.GetResponse()); }
public JObject UpdateStudioCallerIdNumber(String connection, UDC.StudioCallerId studioCallerId) { try { Press3.DataAccessLayer.Studio studioObj = new Press3.DataAccessLayer.Studio(connection); DataSet ds = studioObj.UpdateStudioCallerIdNumber(studioCallerId); if (ds == null) { helper.CreateProperty(UDC.Label.MESSAGE, "No data returned from database"); helper.CreateProperty(UDC.Label.SUCCESS, false); } else { helper.ParseDataSet(ds); } } catch (Exception ex) { Logger.Error("Exception In BAL.UpdateStudioCallerIdNumber " + ex.ToString()); } return(helper.GetResponse()); }