protected void btnCancelUnused_Click(object sender, EventArgs e) { try { ModalPopupUnused.Hide(); } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }
protected void GrdViewManualBook_RowCommand(object sender, GridViewCommandEventArgs e) { if (((System.Web.UI.WebControls.Image)(e.CommandSource as ImageButton)).ID == "btnShowUnusedLeafs") { GridViewRow row = (GridViewRow)((Control)e.CommandSource).NamingContainer; int rowIndex = row.RowIndex; int BookId = Convert.ToInt32(GrdViewManualBook.DataKeys[rowIndex].Value.ToString()); sDataSource = ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString(); BusinessLogic bl = new BusinessLogic(sDataSource); DataSet ds = bl.ListManualSalesBookInfo(sDataSource, BookId); gridViewUnUsedLeafs.DataSource = ds; gridViewUnUsedLeafs.DataBind(); ModalPopupUnused.Show(); } else if (((System.Web.UI.WebControls.Image)(e.CommandSource as ImageButton)).ID == "btnAddDamagedLeaf") { //frmViewAdd.Visible = true; //frmViewAdd.ChangeMode(FormViewMode.Edit); //GrdViewBranches.Columns[8].Visible = false; //lnkBtnAdd.Visible = false; divDamangedLeaf.Visible = true; ModalPopupAddDamaged.Show(); //ModalPopupExtender1.Hide(); GridViewRow row = (GridViewRow)((Control)e.CommandSource).NamingContainer; int rowIndex = row.RowIndex; hdBookID.Value = GrdViewManualBook.DataKeys[rowIndex].Value.ToString(); //if (frmViewAdd.CurrentMode == FormViewMode.Edit) // Accordion1.SelectedIndex = 1; } else if (((System.Web.UI.WebControls.Image)(e.CommandSource as ImageButton)).ID == "btnEdit") { GridViewRow row = GrdViewManualBook.SelectedRow; try { int BookId = Convert.ToInt32(GrdViewManualBook.SelectedDataKey.Value); sDataSource = ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString(); BusinessLogic bl = new BusinessLogic(sDataSource); DataSet ds = bl.GetManualSaleBookInfoForId(sDataSource, BookId); if (ds != null) { hdVisitID.Value = Convert.ToString(BookId); txtBookNameAdd.Text = ds.Tables[0].Rows[0]["BookName"].ToString(); txtFromNoAdd.Text = ds.Tables[0].Rows[0]["BookFrom"].ToString(); txtBookToAdd.Text = ds.Tables[0].Rows[0]["BookTo"].ToString(); UpdateButton.Visible = true; SaveButton.Visible = false; CancelButton.Visible = true; lnkBtnAdd.Visible = false; //MyAccordion.Visible = false; GrdViewManualBook.Visible = false; pnlVisitDetails.Visible = true; ModalPopupExtender1.Show(); } } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } } }