public void LoadData()
        {
            try
            {
                DataTable dt;
                DAC_Stock oDAC_Stock = new DAC_Stock();
                dt = oDAC_Stock.Select();
                String StrInnserHtml = "";

                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        StrInnserHtml = StrInnserHtml + "<tr><td>" + dt.Rows[i][1].ToString() +
                                        "</td><td>" + dt.Rows[i][2].ToString() +
                                        "</td><td>" + dt.Rows[i][3].ToString() +
                                        "</td><td>" + dt.Rows[i][4].ToString() +
                                        "</td><td>" + dt.Rows[i][5].ToString() +
                                        "</td><td>" + dt.Rows[i][6].ToString() +
                                        "</td></tr>";
                    }
                }
                divInnerHtml.InnerHtml = StrInnserHtml;
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        protected void btnupdate_Click(object sender, EventArgs e)
        {
            REF_Stock oREF_Stock = new REF_Stock();
            DAC_Stock oDAC_Stock = new DAC_Stock();

            oREF_Stock.ID     = StockID;
            oREF_Stock.ItemID = ItemName.Text;
            int Qty = Convert.ToInt32(Quentity.Text) + Convert.ToInt32(newQty.Text);

            oREF_Stock.Qty = Qty.ToString();
            oDAC_Stock.Update(oREF_Stock);
            Response.Redirect("./frmStock.aspx", true);
        }
 public void LoadData(REF_Stock oREF_Stock)
 {
     try
     {
         DataTable dt;
         DAC_Stock oDAC_Stock = new DAC_Stock();
         dt = oDAC_Stock.SelectStockID(oREF_Stock);
         ItemName.Enabled = false;
         ItemName.Text    = dt.Rows[0][1].ToString();
         Quentity.Text    = dt.Rows[0][2].ToString();
     }
     catch (Exception ex)
     {
         throw;
     }
 }
        protected void btnsave_Click(object sender, EventArgs e)
        {
            try
            {
                REF_Stock oREF_Stock = new REF_Stock();
                DAC_Stock oDAC_Stock = new DAC_Stock();

                oREF_Stock.ItemID = dropItem.Value;
                oREF_Stock.Qty    = Quentity.Text;
                oDAC_Stock.Insert(oREF_Stock);
                Response.Redirect("./frmStock.aspx", true);
            }
            catch (Exception ex)
            {
                ShowMessage("Something went wrong! Please try again!");
            }
        }