Exemplo n.º 1
0
        internal static int Select_Number(string select)
        {
            try
            {
                int count = 0;
                using (DataTable table = PostgreSQLHelper_Policlinic.ExecuteSelectCommand(select, CommandType.Text))
                {
                    if (table.Rows.Count > 0)
                    {
                        count = int.Parse(table.Rows[0][0].ToString());
                    }
                }

                return(count);
            }
            catch (Exception e)
            {
                return(0);
            }
        }
Exemplo n.º 2
0
        internal static string Select_String(string select)
        {
            try
            {
                string result = "";
                using (DataTable table = PostgreSQLHelper_Policlinic.ExecuteSelectCommand(select, CommandType.Text))
                {
                    if (table.Rows.Count > 0)
                    {
                        result = table.Rows[0][0].ToString();
                    }
                }

                return(result);
            }
            catch (Exception e)
            {
                return(string.Empty);
            }
        }
Exemplo n.º 3
0
        internal static List <string> Select_ArrayString(string select)
        {
            try
            {
                List <String> list = new List <string>();
                using (DataTable table = PostgreSQLHelper_Policlinic.ExecuteSelectCommand(select, CommandType.Text))
                {
                    if (table.Rows.Count > 0)
                    {
                        foreach (DataRow row in table.Rows)
                        {
                            list.Add(row[0].ToString());
                        }
                    }
                }

                return(list);
            }
            catch (Exception e)
            {
                return(null);
            }
        }