コード例 #1
0
        public ServicoTT InsertServico(JObject Obj)
        {
            ServicoTT Serv = Obj.ToObject <ServicoTT>();

            if (ServicoTT.Insert(Serv))
            {
                return(Serv);
            }

            return(Serv);
        }
コード例 #2
0
        public string SaveRecords(JObject container)
        {
            if (container != null)
            {
                try
                {
                    SaveRecordsModel Projecto = container.ToObject <SaveRecordsModel>();
                    if (Projecto != null)
                    {
                        if (Projecto.ArrAloj != null)
                        {
                            foreach (var item in Projecto.ArrAloj)
                            {
                                Alojamento.Insert(item);
                            }
                        }
                        if (Projecto.ArrVoos != null)
                        {
                            foreach (var item in Projecto.ArrVoos)
                            {
                                Voos.Insert(item);
                            }
                        }
                        if (Projecto.ArrDiarias != null)
                        {
                            foreach (var item in Projecto.ArrDiarias)
                            {
                                Diarias.Insert(item);
                            }
                        }
                        if (Projecto.ArrServicos != null)
                        {
                            foreach (var item in Projecto.ArrServicos)
                            {
                                ServicoTT.Insert(item);
                            }
                        }
                    }

                    return("Ok");
                }
                catch (Exception ex)
                {
                    return(ex.InnerException.ToString());
                }
            }
            else
            {
                return("no_magic");
            }
        }
コード例 #3
0
ファイル: Api.cs プロジェクト: v1tal1tysp/NewRepo
        public static List <ServicoTT> getAllServicos(string orcamento)
        {
            List <ServicoTT> Lista = new List <ServicoTT>();

            try
            {
                Lista = ServicoTT.GetAll(orcamento);

                return(Lista);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return(Lista);
            }
        }
コード例 #4
0
        public List <ServicoTT> getAllServicos(JObject orcamento)
        {
            List <ServicoTT> Lista = new List <ServicoTT>();

            try
            {
                var t = orcamento.GetValue("orcamentoidv").ToString();
                Lista = ServicoTT.GetAll(t);

                return(Lista);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return(Lista);
            }
        }
コード例 #5
0
        public void CleanDatabase()
        {
            ProjectoTT.Clean();
            Orcamentos.Clean();
            Ficheiros.Clean();
            ProjectLog.Clean();
            PagamentosCliente.Clean();


            Alojamento.Clean();
            Diarias.Clean();
            ServicoTT.Clean();
            Voos.Clean();


            ReportFornecedores.Clean();
        }