コード例 #1
0
ファイル: AjaxController.cs プロジェクト: tabbles/TabblesWeb
        public IHttpActionResult computeSuggestedTabblesAndCtsOfOpenTabbles([FromBody] InputComputeSuggestedTabblesAndCtsOfOpenTabbles i)
        {
            try
            {
                SqlParameter     noAuth;
                StoredProcResult res;
                storedProcComputeSuggestedOfOpenTabbles(i, out noAuth, out res);
                if (res.err == "timeout")
                {
                    return(Ok(new Result {
                        error = "timeout"
                    }));
                }
                else
                {
                    // devo tradurre i path dei file da G:\ all'analogo android



                    DataTableCollection tables = res.tables;



                    suggestedTabblesCalculationOutputIntermediate suggested = computeSuggestedIntermediate(i, tables);



                    // la tabella numero 4 (cioè la quinta) contiene , per ciascun file, l'ultimo commento troncato. devo tradurla in dizionario, se no in js non riesci ad accedere. ma è un casino in .net dato che è un datatable.



                    return(base.Ok(new Result
                    {
                        ret = new resultTables(dataTables: tables,
                                               noAuth: (int)noAuth.Value,
                                               machineName: null
                                               , obj: suggested
                                               )
                    }));
                }
            }
            catch (Exception e)
            {
                return(Ok(new Result {
                    error = "generic-error", stringOfExc = Utils.stringOfException(e)
                }));
            }
        }
コード例 #2
0
ファイル: AjaxController.cs プロジェクト: tabbles/TabblesWeb
        public IHttpActionResult getDataToComputeSuggested_client([FromBody] InputComputeSuggestedClient i)

        {
            try
            {
                suggestedTabblesCalculationOutputIntermediate suggested = getDataToComputeSuggestedClient(i);

                var json = JsonConvert.SerializeObject(suggested, Formatting.Indented);

                return(Ok(new Result {
                    ret = suggested
                }));
            }
            catch (Exception e)
            {
                return(Ok(new Result {
                    error = "generic-error", stringOfExc = Utils.stringOfException(e)
                }));
            }
        }