protected void alterproname_TextChanged(object sender, EventArgs e) { addproduct.CssClass = "Initial"; alterpro.CssClass = "Clicked"; deletepro.CssClass = "Initial"; viewproduct.CssClass = "Initial"; viewallapro.CssClass = "Initial"; view.ActiveViewIndex = 2; string altname = alterproname.Text; SqlDataReader sdr = Validatesearch.ValidateSearchProduct(altname); if (sdr.Read()) { alterproname.Text = sdr[1].ToString(); int count = (int)sdr[3]; alterpronum.Text = "AVAILABLE COUNT " + count.ToString(); DateTime datemanuf = (DateTime)sdr[4]; alterpromanuf.Text = "DATE OF MANUFACTURE" + datemanuf.ToString(); DateTime expiredate = (DateTime)sdr[5]; alterproexpiry.Text = "DATE OF EXPIRE" + expiredate.ToString(); } }
protected void searchpro_TextChanged(object sender, EventArgs e) { try { addproduct.CssClass = "Initial"; alterpro.CssClass = "Initial"; deletepro.CssClass = "Initial"; viewproduct.CssClass = "Clicked"; viewallapro.CssClass = "Initial"; view.ActiveViewIndex = 4; string searchproduct = searchpro.Text; SqlDataReader sdr = Validatesearch.ValidateSearchProduct(searchproduct); if (sdr.Read()) { nameofproduct.Text = sdr[1].ToString(); byte[] status2 = (byte[])sdr[2]; string IMAGE = Convert.ToBase64String(status2); imageofproduct.ImageUrl = String.Format("data:image/jpg;base64,{0}", IMAGE); int count = (int)sdr[3]; countofpro.Text = "AVAILABLE COUNT " + count.ToString(); DateTime datemanuf = (DateTime)sdr[4]; manufofproduct.Text = "DATE OF MANUFACTURE" + datemanuf.ToString(); DateTime expiredate = (DateTime)sdr[5]; expiryofproduct.Text = "DATE OF EXPIRE" + expiredate.ToString(); } } catch (Exception ex) { } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string userid = (string)Session["USERID"]; prostatus.Text = "Welcome " + userid; displaymultiview.ActiveViewIndex = 1; imageofproduct1.Visible = false; int i, n = 11; for (i = 2; i <= n; i = i + 10) { byte[] slide = Validatesearch.ValidateSearchslide(i); string IMAGE = Convert.ToBase64String(slide); img1.ImageUrl = String.Format("data:image/jpg;base64,{0}", IMAGE); byte[] slide1 = Validatesearch.ValidateSearchslide(i + 1); string IMAGE1 = Convert.ToBase64String(slide1); img2.ImageUrl = String.Format("data:image/jpg;base64,{0}", IMAGE1); byte[] slide2 = Validatesearch.ValidateSearchslide(i + 2); string IMAGE2 = Convert.ToBase64String(slide2); img3.ImageUrl = String.Format("data:image/jpg;base64,{0}", IMAGE2); byte[] slide3 = Validatesearch.ValidateSearchslide(i + 3); string IMAGE3 = Convert.ToBase64String(slide3); Image1.ImageUrl = String.Format("data:image/jpg;base64,{0}", IMAGE3); byte[] slide4 = Validatesearch.ValidateSearchslide(i + 4); string IMAGE4 = Convert.ToBase64String(slide4); Image2.ImageUrl = String.Format("data:image/jpg;base64,{0}", IMAGE4); byte[] slide5 = Validatesearch.ValidateSearchslide(i + 5); string IMAGE5 = Convert.ToBase64String(slide5); Image3.ImageUrl = String.Format("data:image/jpg;base64,{0}", IMAGE5); byte[] slide6 = Validatesearch.ValidateSearchslide(i + 6); string IMAGE6 = Convert.ToBase64String(slide6); Image4.ImageUrl = String.Format("data:image/jpg;base64,{0}", IMAGE6); byte[] slide7 = Validatesearch.ValidateSearchslide(i + 7); string IMAGE7 = Convert.ToBase64String(slide7); Image5.ImageUrl = String.Format("data:image/jpg;base64,{0}", IMAGE7); byte[] slide8 = Validatesearch.ValidateSearchslide(i + 8); string IMAGE8 = Convert.ToBase64String(slide8); Image6.ImageUrl = String.Format("data:image/jpg;base64,{0}", IMAGE8); byte[] slide9 = Validatesearch.ValidateSearchslide(i + 9); string IMAGE9 = Convert.ToBase64String(slide9); Image7.ImageUrl = String.Format("data:image/jpg;base64,{0}", IMAGE9); } } }
protected void viewallapro_Click(object sender, EventArgs e) { addproduct.CssClass = "Initial"; alterpro.CssClass = "Initial"; deletepro.CssClass = "Initial"; viewproduct.CssClass = "Initial"; viewallapro.CssClass = "Clicked"; view.ActiveViewIndex = 5; DataSet ds = Validatesearch.GetProductsDetails(); Db1.Visible = true; Db1.DataSource = ds; Db1.DataMember = ds.Tables[0].TableName; Db1.DataBind(); }
protected void prosearch1_TextChanged(object sender, EventArgs e) { displaymultiview.ActiveViewIndex = 0; string message = string.Empty; string searchproduct = prosearch1.Text; if (searchproduct != "") { try { //string status1 = Validatesearch.ValidateSearch(searchproduct); SqlDataReader sdr = Validatesearch.ValidateSearchProduct(searchproduct); if (sdr.HasRows) { int i = 0; while (sdr.Read()) { ++i; if (i == 1) { nameofproduct1.Text = sdr[1].ToString(); imageofproduct1.Visible = true; byte[] status2 = (byte[])sdr[2]; string IMAGE = Convert.ToBase64String(status2); imageofproduct1.ImageUrl = String.Format("data:image/jpg;base64,{0}", IMAGE); int count = (int)sdr[3]; countofpro1.Text = "AVAILABLE COUNT " + count.ToString(); DateTime datemanuf = (DateTime)sdr[4]; manufofproduct1.Text = "DATE OF MANUFACTURE" + datemanuf.ToString(); DateTime expiredate = (DateTime)sdr[5]; expiryofproduct1.Text = "DATE OF EXPIRE" + expiredate.ToString(); } if (i == 2) { nameofproduct2.Text = sdr[1].ToString(); imageofproduct2.Visible = true; byte[] status2 = (byte[])sdr[2]; string IMAGE = Convert.ToBase64String(status2); imageofproduct2.ImageUrl = String.Format("data:image/jpg;base64,{0}", IMAGE); int count = (int)sdr[3]; countofpro2.Text = "AVAILABLE COUNT " + count.ToString(); DateTime datemanuf = (DateTime)sdr[4]; manufofproduct2.Text = "DATE OF MANUFACTURE" + datemanuf.ToString(); DateTime expiredate = (DateTime)sdr[5]; expiryofproduct2.Text = "DATE OF EXPIRE" + expiredate.ToString(); } } } sdr.Close(); } catch (Exception ex) { imageofproduct1.Visible = false; message = ex.Message; nameofproduct1.Text = string.Empty; countofpro1.Text = string.Empty; manufofproduct1.Text = string.Empty; expiryofproduct1.Text = string.Empty; } } else if (searchproduct == "") { displaymultiview.ActiveViewIndex = 1; } }