/********************************************************************************************************************************************************* * * * The mappings and private methods * * * * * ********************************************************************************************************************************************************/ /* * [SupportQuestionsId] * INT NOT NULL PRIMARY KEY, * [SupportQuestion1] NVARCHAR(50) NULL, * [SupportQuestion2] NVARCHAR(50) NULL, * [SupportQuestion3] NVARCHAR(50) NULL, * [SupportQuestion4] NVARCHAR(50) NULL, * [SupportQuestion5] NVARCHAR(50) NULL, * [CompanyId] * INT NULL */ private SupportQuestion mapSupportQuestions(DataSet ds) { if (ds == null || ds.Tables[0] == null) { return(null); } //create an array of same size SupportQuestion[] links = new SupportQuestion[ds.Tables[0].Rows.Count]; int index = 0; foreach (DataRow dr in ds.Tables[0].Rows) { SupportQuestion tl = new SupportQuestion(); tl.CompanyId = (dr["CompanyId"] != DBNull.Value ? Convert.ToInt16(dr["CompanyId"]) : 0); tl.SupportQuestionId = (dr["SupportQuestionId"] != DBNull.Value ? Convert.ToInt16(dr["SupportQuestionId"]) : 0); tl.SupportQuestion1 = returnRealOrBlank(dr["SupportQuestion1"] as string); tl.SupportQuestion2 = returnRealOrBlank(dr["SupportQuestion2"] as string); tl.SupportQuestion3 = returnRealOrBlank(dr["SupportQuestion3"] as string); tl.SupportQuestion4 = returnRealOrBlank(dr["SupportQuestion4"] as string); tl.SupportQuestion5 = returnRealOrBlank(dr["SupportQuestion5"] as string); links[index] = tl; index++; } if (ds.Tables[0].Rows.Count == 0) { return(new SupportQuestion()); } else { return(links[0]);//just one } }
/// <summary> /// /// </summary> /// <param name="userinput"></param> /// <returns></returns> public string createTechnicalSupportCase(String userinput, SupportQuestion questions) { return(createCase(userinput + questions.ToString(), "VCSM: User requested a Technical Support case")); }