protected void ctlBtnAddBank_Click(object sender, ImageClickEventArgs e) { BankLangGridViewFinish(); ctlBankFormView.DataSource = null; ctlBankFormView.ChangeMode(FormViewMode.Insert); UpdatePanelBankForm.Update(); ctlBankModalPopupExtender.Show(); }
protected void ctlBankFormView_ItemCommand(object sender, FormViewCommandEventArgs e) { if (e.CommandName == "Cancel") { ctlBankModalPopupExtender.Hide(); UpdatePanelBankForm.Update(); ctlGridBank.DataCountAndBind(); } }
protected void ctlGridBank_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "BankEdit") { int rowIndex = ((GridViewRow)((ImageButton)e.CommandSource).NamingContainer).RowIndex; short bankId = UIHelper.ParseShort(ctlGridBank.DataKeys[rowIndex].Value.ToString()); ctlGridBank.EditIndex = rowIndex; IList <DbBank> bankList = new List <DbBank>(); DbBank bank = DbBankService.FindByIdentity(bankId); bankList.Add(bank); ctlBankFormView.DataSource = bankList; ctlBankFormView.PageIndex = 0; ctlBankFormView.ChangeMode(FormViewMode.Edit); ctlBankFormView.DataBind(); UpdatePanelBankForm.Update(); ctlBankModalPopupExtender.Show(); BankLangGridViewFinish(); } else if (e.CommandName == "Select") { int rowIndex = ((GridViewRow)((LinkButton)e.CommandSource).NamingContainer).RowIndex; short bankId = UIHelper.ParseShort(ctlGridBank.DataKeys[rowIndex].Value.ToString()); ctlBankLangGrid.DataSource = DbBankLangService.FindByBankId(bankId); ctlBankLangGrid.DataBind(); if (ctlBankLangGrid.Rows.Count > 0) { ctlSubmit.Visible = true; ctlCancel.Visible = true; ctlBankLangLangFds.Visible = true; } else { ctlSubmit.Visible = false; ctlCancel.Visible = false; ctlBankLangLangFds.Visible = false; } ctlBankLangUpdatePanel.Update(); } }