Exemplo n.º 1
0
        public DataTable GetUserbyID(BaseDataLite bd, string id)  //Получить всех пользователей по id заявки
        {
            string query = $"SELECT * FROM Users where id = '{id}'";

            command = new SQLiteCommand(query, bd.connection);
            command.ExecuteNonQuery();
            adapter = new SQLiteDataAdapter(query, connection);
            table   = new DataTable();
            adapter.Fill(table);
            return(table);
        }
Exemplo n.º 2
0
        public DataTable GetUserbyName(BaseDataLite bd, string sname)  //Получить все записи по фамилии
        {
            string query = $"SELECT * FROM Users where secound_name = '{sname}'";

            command = new SQLiteCommand(query, bd.connection);
            command.ExecuteNonQuery();
            adapter = new SQLiteDataAdapter(query, connection);
            table   = new DataTable();
            adapter.Fill(table);
            return(table);
        }
Exemplo n.º 3
0
        public DataTable ShowAll(BaseDataLite bd, string tablename) //Вывести всю таблицу
        {
            string query = $"SELECT * FROM {tablename}";

            command = new SQLiteCommand(query, bd.connection);
            command.ExecuteNonQuery();
            adapter = new SQLiteDataAdapter(query, connection);
            table   = new DataTable();
            adapter.Fill(table);
            return(table);
        }
Exemplo n.º 4
0
 public DataTable GetLoanbyStatus(BaseDataLite bd, string status) //Получить все записи опр. статуса заявки
 {
     try
     {
         string query = $"SELECT * FROM Loan where status = '{status}'";
         command = new SQLiteCommand(query, bd.connection);
         command.ExecuteNonQuery();
         adapter = new SQLiteDataAdapter(query, connection);
         table   = new DataTable();
         adapter.Fill(table);
         return(table);
     }
     catch (Exception)
     {
         return(null);
     }
 }
Exemplo n.º 5
0
        public static BClaim FillClaim(int id, BaseDataLite bd)
        {
            DataTable loantb = bd.GetLoanbyID(bd, $"{id}");
            BClaim    claim  = new BClaim();

            claim.Id         = id;
            claim.SumLoan    = Convert.ToInt32(loantb.Rows[0][2]);
            claim.Days       = Convert.ToInt32(loantb.Rows[0][3]);
            claim.Fine       = Convert.ToInt32(loantb.Rows[0][11]);
            claim.CardNumber = Convert.ToString(loantb.Rows[0][7]);
            claim.type       = Convert.ToString(loantb.Rows[0][9]);
            claim.status     = Convert.ToString(loantb.Rows[0][8]);
            claim.PaidOut    = Convert.ToInt32(loantb.Rows[0][12]);
            claim.SumPaid    = Convert.ToInt32(loantb.Rows[0][10]);
            claim.FirstDate  = DateTime.Parse(Convert.ToString(loantb.Rows[0][4]));
            claim.LastDate   = claim.FirstDate.AddDays(claim.Days);
            return(claim);
        }
Exemplo n.º 6
0
 public DataTable GetLoanbyID(BaseDataLite bd, string id) //Получить зайвку по id
 {
     try
     {
         string query = $"SELECT * FROM Loan where id ={id} ";
         command = new SQLiteCommand(query, connection);
         command.ExecuteNonQuery();
         adapter = new SQLiteDataAdapter(query, connection);
         table   = new DataTable();
         adapter.Fill(table);
         if (table.Rows[0][0] == DBNull.Value)
         {
             return(null);
         }
         return(table);
     }
     catch (Exception)
     {
         return(null);
     }
 }