示例#1
0
 protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (DropDownList1.SelectedIndex != 0)
         {
             int     intProdId = Convert.ToInt32(DropDownList1.SelectedValue);
             DataSet ds        = clsProducts.GetProductDataByProductId(intProdId);
             if (ds.Tables[0].Rows.Count != 0)
             {
                 TextBox1.Text              = ds.Tables[0].Rows[0][1].ToString();
                 txtAbbr.Text               = ds.Tables[0].Rows[0][2].ToString();
                 txtDesc.Text               = ds.Tables[0].Rows[0][3].ToString();
                 BrowseImage1.LoadFileName  = ds.Tables[0].Rows[0][4].ToString();
                 BrowseImage1.LaodImageByte = (byte[])ds.Tables[0].Rows[0][5];
                 BrowseImage1.GetImage();
             }
         }
         else
         {
             ClearData();
         }
     }
     catch (Exception ex)
     {
         throw new ArgumentException(ex.Message);
     }
 }
示例#2
0
 protected void ddlProdMaster_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         int ProdId = Convert.ToInt32(ddlProdMaster.SelectedValue);
         if (ProdId != 0)
         {
             DataSet dsData = objProd.GetProductDataByProId(ProdId);
             if (dsData.Tables[0].Rows.Count != 0)
             {
                 txtAbbr.Text = dsData.Tables[0].Rows[0][2].ToString();
                 txtDesc.Text = dsData.Tables[0].Rows[0][3].ToString();
                 BrowseImage1.LoadFileName  = dsData.Tables[0].Rows[0][4].ToString();
                 BrowseImage1.LaodImageByte = (byte[])dsData.Tables[0].Rows[0][5];
                 BrowseImage1.GetImage();
             }
         }
     }
     catch (Exception ex)
     {
         lblMsg.Text = ex.Message;
     }
 }