protected void btnSubmit_Click(object sender, EventArgs e) { string strMessage = ""; BL_VirtualCard objVirtual = new BL_VirtualCard(); int intResult = 0; foreach (GridViewRow row in GridView1.Rows) { RadioButton rb = (RadioButton)row.Cells[0].FindControl("RadioButton1"); if (rb != null) { if (rb.Checked) { int intProductID = Convert.ToInt32(GridView1.DataKeys[row.RowIndex].Values["ProductID"].ToString()); //intResult = objVirtual.AddPurchase(intProductID,1,Convert.ToInt32(Convert.ToDouble(row.Cells[3].Text.ToString())),strUserName); break; } } } if (intResult > 0) strMessage = "Card created successfully"; else strMessage = "Card not created. Please recheck the value and try again"; }
protected void btnSubmit_Click(object sender, EventArgs e) { string strMessage = ""; BL_VirtualCard objVirtual = new BL_VirtualCard(); int intResult = objVirtual.AddNewCard(txtCardNumber.Text, Convert.ToInt32(rdoBankList.SelectedValue), Convert.ToInt32(rdoCardType.SelectedValue), Convert.ToInt32(rdoAccountType.SelectedValue), Convert.ToInt32(txtPriority.Text), Convert.ToInt32(txtPercentage.Text)); if (intResult > 0) strMessage = "Card created successfully"; else strMessage = "Card not created. Please recheck the value and try again"; }
protected void btnAgree_Click(object sender, EventArgs e) { BL_VirtualCard objVirtual = new BL_VirtualCard(); if (rdoList.SelectedValue == "New Virtual card") { objVirtual.CreateVirtualCard(strUserName.Trim()); } else { //option to modify virtual card } }
protected void btnSubmit_Click(object sender, EventArgs e) { string strMessage = ""; BL_VirtualCard objVirtual = new BL_VirtualCard(); int intResult = objVirtual.AddNewCard(txtCardNumber.Text, Convert.ToInt32(rdoBankList.SelectedValue), Convert.ToInt32(rdoCardType.SelectedValue), Convert.ToInt32(rdoAccountType.SelectedValue), Convert.ToInt32(txtPriority.Text), Convert.ToInt32(txtPercentage.Text), Convert.ToInt32(rdoAutoPay.SelectedIndex) , strUserName, txtNameonCard.Text); if (intResult > 0) strMessage = "Card created successfully"; else strMessage = "Card not created. Please recheck the value and try again"; divAddCard.Visible = false; LoadExistingCards(strUserName); }
protected void btnSubmit_Click(object sender, EventArgs e) { string strMessage = ""; BL_VirtualCard objVirtual = new BL_VirtualCard(); string strResult = ""; if (rdoPayOptions.SelectedItem.Value == "1") { foreach (GridViewRow row in GridView1.Rows) { RadioButton rb = (RadioButton)row.Cells[0].FindControl("RadioButton1"); if (rb != null) { if (rb.Checked) { int intProductID = Convert.ToInt32(GridView1.DataKeys[row.RowIndex].Values["ProductID"].ToString()); strResult = objVirtual.AddPurchase(intProductID, 1, Convert.ToInt32(Convert.ToDouble(row.Cells[3].Text.ToString())), strUserName); break; } } } } else if (rdoPayOptions.SelectedItem.Value == "2") { foreach (GridViewRow row in GridView1.Rows) { RadioButton rb = (RadioButton)row.Cells[0].FindControl("RadioButton1"); if (rb != null) { if (rb.Checked) { int intProductID = Convert.ToInt32(GridView1.DataKeys[row.RowIndex].Values["ProductID"].ToString()); strResult = objVirtual.AddPurchaseSharing(intProductID, 1, Convert.ToInt32(Convert.ToDouble(row.Cells[3].Text.ToString())), strUserName,2 ); break; } } } } divMessage.Visible = true; divMessage.InnerText= strResult; LoadExistingCards(strUserName); }
protected void Page_Load(object sender, EventArgs e) { try { if(Session["UserName"] != null) strUserName = Session["UserName"] + ""; strUserName = "******"; Label lblPageHeading = (Label)Master.FindControl("lblPageHeading"); lblPageHeading.Text = "SecurePay"; Label lblBreadCrumb = (Label)Master.FindControl("lblBreadCrumb"); lblBreadCrumb.Text = "Home / VirtualCard"; BL_VirtualCard objVirtCard = new BL_VirtualCard(); string strResult = objVirtCard.CheckVirtualCard(strUserName); if (strResult == "1") { rdoList.SelectedIndex = 1; LoadExistingCards(strUserName); } else { rdoList.SelectedIndex = 0; divAgree.Visible = true; } } catch (Exception ex) { if (!ex.Message.ToString().Trim().Equals("Thread was being aborted.")) { Util.WriteToLog("Index_Page_Load", ex.Message.ToString(), UserSession.EmpID); Response.Redirect(FindLink.ToNotAuthorised("Error"), true); } } }
protected void btnAgree_Click(object sender, EventArgs e) { string strMessage = ""; BL_VirtualCard objVirtual = new BL_VirtualCard(); if (rdoList.SelectedValue == "New Virtual card") { int intCreate = objVirtual.CreateVirtualCard(strUserName.Trim()); if (intCreate > 0) strMessage = "Virtual Card Added successfully. Please proceed to add your card details."; else strMessage = "Card not created. Please try some time later..."; divMessage.Visible = true; divMessage.InnerText = strMessage.ToString(); divAdd.Visible = true; divAgree.Visible = false; } else { //option to modify virtual card } }
private void LoadExistingCards(string strUserName) { BL_VirtualCard objVC = new BL_VirtualCard(); DataTable dt = objVC.GetCards(strUserName); if (dt != null) { GridView1.DataSource = dt; GridView1.DataBind(); } else { } }
private void LoadExistingCards(string strUserName) { BL_VirtualCard objVC = new BL_VirtualCard(); GridView1.DataSource = objVC.GetCards(strUserName); GridView1.DataBind(); }