Beispiel #1
0
 public static void UpdateAll(ThamSoDTO thamSos)
 {
     var q = @"UPDATE THAMSO SET LuongNhapNN=@nhapNN,LuongTonLN=@tonLN,LuongTonNN=@tonNN,NoLN=@noLN,ChoTraDu=@traDu";
     var sqlParas = new[] {
                              new SQLiteParameter("@nhapNN", thamSos.SoLuongNhapNN),
                              new SQLiteParameter("@tonLN", thamSos.LuongTonLN),
                              new SQLiteParameter("@tonNN", thamSos.LuongTonNN),
                              new SQLiteParameter("@noLN", thamSos.NoLN),
                              new SQLiteParameter("@traDu", thamSos.ChoTraDu),
                          };
     SqliteExecuteNonQuery(q,sqlParas);
 }
Beispiel #2
0
 public static ThamSoDTO GetAll()
 {
     var thamSos = new ThamSoDTO();
     var obj = SqliteDataReader(@"SELECT * FROM THAMSO", null);
     if (obj.Read()) {
         thamSos.SoLuongNhapNN = int.Parse(obj[0].ToString());
         thamSos.LuongTonLN = int.Parse(obj[1].ToString());
         thamSos.LuongTonNN = int.Parse(obj[2].ToString());
         thamSos.NoLN = int.Parse(obj[3].ToString());
         thamSos.ChoTraDu = bool.Parse(obj[4].ToString());
     }
     return thamSos;
 }
Beispiel #3
0
        public ThamSoDTO getThamSo()
        {
            ThamSoDTO ts = new ThamSoDTO();
            string sql = "select * from THAMSO";
            DataTable dt = conectData.LoadData(sql);
            if (dt == null || dt.Rows.Count == 0)
                return null;
            else
            {
                ts.TienKham =float.Parse(dt.Rows[0]["TienKham"].ToString());
                ts.SoBenhNhanToiDa=int.Parse(dt.Rows[0]["SoBenhNhanToiDa"].ToString());

            }
            return ts;
        }