public int rowCount() { String sql = "Select count(*) from danhmuc"; int numberRow = Convert.ToInt32(dataProvider.ExecuteScalar(sql)); return(numberRow); }
public int RowCount() { String sql = "Select count(*) from nhacungcap"; int effect = Convert.ToInt32(dataProvider.ExecuteScalar(sql)); return(effect); }
public int RowCount() { String sql = "select count(*) from nhanvien"; int row = Convert.ToInt32(dataProvider.ExecuteScalar(sql)); return(row); }
public static int GetNumberOfBillsByTime(DateTime from, DateTime to) { provider = new DataProvider(); provider.Connect(); string cmdStr = "Execute proc_GetNumberOfBillsByTime '" + from.ToString("yyyy-MM-dd") + "', '" + to.ToString("yyyy-MM-dd") + "'"; int numOfBills = (int)provider.ExecuteScalar(cmdStr); provider.Disconnect(); return(numOfBills); }
public static int GetMaxIdBill() { try { return((int)DataProvider.ExecuteScalar("SELECT MAX(id) FROM dbo.HoaDon")); } catch { return(1); } }
public static int GetNumberOfBills() { provider = new DataProvider(); provider.Connect(); string cmdStr = "Execute proc_GetNumberOfBills"; int numOfBills = (int)provider.ExecuteScalar(cmdStr); provider.Disconnect(); return(numOfBills); }
public static int GetMaxYear() { provider = new DataProvider(); provider.Connect(); string cmdStr = "Execute proc_GetMaxYear"; object result = provider.ExecuteScalar(cmdStr); int maxYear = result == DBNull.Value ? DateTime.Today.Year : (int)result; provider.Disconnect(); return(maxYear); }
public static int GetTotalPriceByYear(int year) { provider = new DataProvider(); provider.Connect(); string cmdStr = "Execute proc_GetTotalPriceByYear " + year; int total; object totalObject = provider.ExecuteScalar(cmdStr); total = totalObject == DBNull.Value ? 0 : (int)totalObject; provider.Disconnect(); return(total); }
public int Insert(DonNhapHangDTO donNhap) { string query = "insert into donnhaphang(manv, mancc, tongluonghang, lydonhap, ngaynhap, trangthaixacnhan) output INSERTED.madonnhap values (@MANV,0,@TONGLUONGHANG,@LYDONHAP,@NGAYNHAP,0)"; List <SqlParameter> Inserted_values = new List <SqlParameter> { new SqlParameter("@MANV", donNhap.maNV), new SqlParameter("@TONGLUONGHANG", donNhap.tongLuongHang), new SqlParameter("@LYDONHAP", donNhap.lyDoNhap), new SqlParameter("@NGAYNHAP", donNhap.ngayNhap) }; return(dp.ExecuteScalar(query, Inserted_values)); }
public static int getMaxIdBill() { string stringquery = "select max(id_Bill) from BILL"; con = DataProvider.OpenConnection(); try { return((int)DataProvider.ExecuteScalar(stringquery, con)); } catch { return(1); } }
/////////////////////////// // Lấy đúng dữ liệu đăng nhập /////////////////////////// public int LoginSuccess(string sql, string MaNV, string MatKhau) { List <SqlParameter> paras = new List <SqlParameter>(); paras.Add(new SqlParameter("@MaNV", MaNV)); paras.Add(new SqlParameter("@MatKhau", MatKhau)); dp.Connect(); try { int x = (int)dp.ExecuteScalar(sql, System.Data.CommandType.Text, paras); return(x); } catch (Exception ex) { throw ex; } finally { dp.Disconnect(); } }
public static string CreateNhanVientId() { return((string)DataProvider.ExecuteScalar("usp_CreateNhanVienId")); }
public static string CreateLoaiSanPhamId() { return((string)DataProvider.ExecuteScalar("usp_CreateLoaiSanPhamId")); }
public static string CreateLoaiPhieuXuatId() { return((string)DataProvider.ExecuteScalar("usp_CreateLoaiPhieuXuatId")); }
public int MaHang() { String sql = "select ident_current('hang')"; return(Convert.ToInt32(dataProvider.ExecuteScalar(sql))); }
public static string CreateThamSoId() { return((string)DataProvider.ExecuteScalar("usp_CreateThamSoId")); }
public int MaPhieuNhap() { String sql = "select ident_current('phieunhap')"; return(Convert.ToInt32(dataProvider.ExecuteScalar(sql))); }