protected void btnAdd_Click(object sender, EventArgs e) { try { objProd = new clsProducts(); objProd.ProductId = Convert.ToInt32(ddlProdMaster.SelectedValue); objProd.strProName = Convert.ToString(ddlProdMaster.SelectedItem.Text); objProd.strProAbbr = Convert.ToString(txtAbbr.Text); objProd.strDesc = Convert.ToString(txtDesc.Text); if (Session["FileName"] != null && Session["Photo"] != null) { objProd.strFileName = Convert.ToString(Session["FileName"]); objProd.imgFileData = (byte[])Session["Photo"]; } else { objProd.strFileName = Convert.ToString("No File"); objProd.imgFileData = null; } int i = objProd.UpdateProductMasterData(); if (i == 1) { lblMsg.Text = "Record has been Modified"; } else { lblMsg.Text = "Error in process"; } } catch (Exception ex) { lblMsg.Text = ex.Message; } }
protected void btnAdd_Click(object sender, EventArgs e) { try { objProd.ProductId = Convert.ToInt32(DropDownList1.SelectedValue); objProd.strProName = TextBox1.Text; objProd.strProAbbr = txtAbbr.Text; objProd.strDesc = txtDesc.Text; objProd.strFileName = Convert.ToString(Session["FileName"]); objProd.imgFileData = (byte[])Session["Photo"]; int i = objProd.UpdateProductMasterData(); if (i == 1) { ClearData(); lblMsg.Text = "Product Data Modified."; } } catch (Exception ex) { lblMsg.Text = ex.Message; } }