private void LoadSupplier() { string sql = "Select * from [Supplier]"; ds_sup = objDb.GetCommand(sql); gvSupplier.DataSource = ds_sup.Tables[0]; gvSupplier.DataBind(); }
private void LoadCategory() { string sql = "Select * from [Category]"; ds_cat = objDb.GetCommand(sql); gvCategory.DataSource = ds_cat.Tables[0]; gvCategory.DataBind(); }
private void LoadUserInfo(string userID) { string sql = "Select * from [User] where UserID=" + userID; DataSet ds = new DataSet(); try { ds = objDb.GetCommand(sql); if (ds.Tables[0].Rows.Count > 0) { txtUserEmail.Text = ds.Tables[0].Rows[0]["UserEmail"].ToString(); txtFirstName.Text = ds.Tables[0].Rows[0]["UserFirstName"].ToString(); txtLastName.Text = ds.Tables[0].Rows[0]["UserLastName"].ToString(); txtUserAddress.Text = ds.Tables[0].Rows[0]["UserAddress"].ToString(); if (ds.Tables[0].Rows[0]["UserActived"].ToString() == "1") { txtUserActived.Checked = true; } else { txtUserActived.Checked = false; } if (ds.Tables[0].Rows[0]["IsAdministration"].ToString() == "1") { txtAdministrator.Checked = true; } else { txtAdministrator.Checked = false; } txtUserIP.Text = ds.Tables[0].Rows[0]["UserIP"].ToString(); txtUserPhone.Text = ds.Tables[0].Rows[0]["UserPhone"].ToString(); } } catch (Exception ex) { throw ex; } }
private void LoadProducts() { string sql = "Select P.ProductID, P.ProductSKU, P.ProductName, P.ProductPrice, P.ProductShortDesc, I.PictureURL as URLImage from [Product] P left join [ProductPicture] I on P.ProductID = I.ProductID and I.IsPresentPicture = 1 "; ds = objDb.GetCommand(sql); gvProducts.DataSource = ds.Tables[0]; gvProducts.DataBind(); }