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 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();
            }
        }
Example #3
0
        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;
            }
        }