protected void btnUpdate_Click(object sender, EventArgs e) { Conv_Registration tempConv_Registration = new Conv_Registration(); tempConv_Registration = Conv_RegistrationManager.GetConv_RegistrationByID(Int32.Parse(Request.QueryString["conv_RegistrationID"])); Conv_Registration conv_Registration = new Conv_Registration(); conv_Registration.Conv_RegistrationID = tempConv_Registration.Conv_RegistrationID; conv_Registration.Conv_ConventionID = Int32.Parse(txtConv_ConventionID.Text); conv_Registration.Mem_MemberID = Int32.Parse(txtMem_Member.Text); conv_Registration.RegistrationFee = Int32.Parse(txtRegistrationFee.Text); conv_Registration.Lunch1No = Int32.Parse(txtLunch1No.Text); conv_Registration.Lunch1Amount = Int32.Parse(txtLunch1Amount.Text); conv_Registration.Lunch2No = Int32.Parse(txtLunch2No.Text); conv_Registration.Lunch2Amount = Int32.Parse(txtLunch2Amount.Text); conv_Registration.Dinner1 = Int32.Parse(txtDinner1.Text); conv_Registration.Dinner2 = Int32.Parse(txtDinner2.Text); conv_Registration.LadiesBag = Int32.Parse(txtLadiesBag.Text); conv_Registration.IEBTie = Int32.Parse(txtIEBTie.Text); conv_Registration.TotalIEBFee = Int32.Parse(txtTotalIEBFee.Text); conv_Registration.BKashFees = Int32.Parse(txtBKashFees.Text); conv_Registration.TotalPayable = Int32.Parse(txtTotalPayable.Text); conv_Registration.TrxID = txtTrx.Text; conv_Registration.AddedDate = tempConv_Registration.AddedDate; conv_Registration.TypeID = Int32.Parse(txtType.Text); conv_Registration.StatusID = Int32.Parse(txtStatus.Text); conv_Registration.ExtraField1 = "";// tempConv_Registration.ExtraField1; if (tempConv_Registration.ExtraField2 != "") { conv_Registration.ExtraField2 = tempConv_Registration.ExtraField2.Replace("EnterTrxID", conv_Registration.TrxID); } else { conv_Registration.ExtraField2 = tempConv_Registration.ExtraField1.Replace( @"<tr> <td style='border:1px solid black; text-align:left;' colspan='3'>Please write down here the Transaction ID(TraxID) which you will receive from bKash by SMS</td> <td style='border:1px solid black;' colspan='2'> </td> </tr>", "<td style='border:1px solid black; text-align:right;' colspan='3'>Transaction ID(TrxID)</td> <td style='border:1px solid black;' colspan='2'>" + txtTrx.Text + "</td>").Replace( "<img src='http://iebbd.org/images/Convention/55/formHeader.png' width='400px'/>", "<img src='http://iebbd.org/images/Convention/55/formHeader.png' width='400px'/><br/>Money Receipt"); } conv_Registration.ExtraField3 = txtExtraField3.Text; conv_Registration.ExtraField4 = txtExtraField4.Text; conv_Registration.ExtraField5 = txtExtraField5.Text; bool result = Conv_RegistrationManager.UpdateConv_Registration(conv_Registration); Response.Redirect("AdminConv_RegistrationDisplayAdmin.aspx"); }
protected void btnConventionFee_Click(object sender, EventArgs e) { string sql = ""; foreach (GridViewRow gvr in gvbKash.Rows) { try { TextBox txtCorrctReferenceNo = (TextBox)gvr.FindControl("txtCorrctReferenceNo"); TextBox txtMemberShipNo = (TextBox)gvr.FindControl("txtMemberShipNo"); Label lblTransactionID = (Label)gvr.FindControl("lblTransactionID"); Label lblAmount = (Label)gvr.FindControl("lblAmount"); Label lblTrancsactionTime = (Label)gvr.FindControl("lblTrancsactionTime"); Label lblMobile = (Label)gvr.FindControl("lblMobile"); Label lblEmail = (Label)gvr.FindControl("lblEmail"); CheckBox chkSelect = (CheckBox)gvr.FindControl("chkSelect"); RadioButtonList rbtnPaidUpto = (RadioButtonList)gvr.FindControl("rbtnPaidUpto"); if (chkSelect.Checked && txtMemberShipNo.Text.Trim() != "") { sql = @" update Acc_bKash_Final set ExtraField1=(Select cast(Mem_MemberID as nvarchar) from Mem_Member where MemberShipNo ='" + txtMemberShipNo.Text + @"') where TransactionID=" + lblTransactionID.Text + @" SELECT Conv_RegistrationID FROM [Conv_Registration] where Mem_MemberID =(Select Mem_MemberID from Mem_Member where MemberShipNo='" + txtMemberShipNo.Text + @"') "; DataSet dstmp = DatabaseManager.ExecSQL(sql); Conv_Registration tempConv_Registration = new Conv_Registration(); tempConv_Registration = Conv_RegistrationManager.GetConv_RegistrationByID(Int32.Parse(dstmp.Tables[0].Rows[0][0].ToString())); if (tempConv_Registration.ExtraField2 != "") { if (!tempConv_Registration.TrxID.Contains(lblTransactionID.Text)) { tempConv_Registration.TrxID += (tempConv_Registration.TrxID.Trim() == "" ? "" : ", ") + lblTransactionID.Text; } if (tempConv_Registration.ExtraField2.Contains("Money Receipt")) { tempConv_Registration.ExtraField2 = tempConv_Registration.ExtraField2.Replace("EnterTrxID", lblTransactionID.Text); } Conv_RegistrationManager.UpdateConv_Registration(tempConv_Registration); } else if (!tempConv_Registration.ExtraField2.Contains("Transaction ID(TrxID)</td>")) { if (!tempConv_Registration.TrxID.Contains(lblTransactionID.Text)) { tempConv_Registration.TrxID += (tempConv_Registration.TrxID.Trim() == "" ? "" : ", ") + lblTransactionID.Text; } if (!tempConv_Registration.ExtraField2.Contains("Money Receipt")) { tempConv_Registration.ExtraField2 = tempConv_Registration.ExtraField1.Replace( @"<tr> <td style='border:1px solid black; text-align:left;' colspan='3'>Please write down here the Transaction ID(TraxID) which you will receive from bKash by SMS</td> <td style='border:1px solid black;' colspan='2'> </td> </tr>", "<td style='border:1px solid black; text-align:right;' colspan='3'>Transaction ID(TrxID)</td> <td style='border:1px solid black;' colspan='2'>" + lblTransactionID.Text + "</td>").Replace( "<img src='http://iebbd.org/images/Convention/55/formHeader.png' width='400px'/>", "<img src='http://iebbd.org/images/Convention/55/formHeader.png' width='400px'/><br/>Money Receipt"); } Conv_RegistrationManager.UpdateConv_Registration(tempConv_Registration); } //SMS if (lblMobile.Text.Trim() != "") { try { string SMS = "Thanks for bKash payment to IEB.Your registration for Convention 55 is Confirmed. Your payment amount(" + lblAmount.Text + ") and trxID: " + lblTransactionID.Text; MyWebRequest myRequest = new MyWebRequest("http://cbsms.grameenphone.com/send_sms_api/send_sms_from_api.php?user_name=IEBadmin&password=IEBadmin123&subscriber_no=" + lblMobile.Text.Trim().Substring(1, 10) + "&mask=IEB&sms=" + SMS); //MyWebRequest myRequest = new MyWebRequest("http://cbsms.grameenphone.com/send_sms_api/send_sms_from_api.php?user_name=IEBadmin&password=IEBadmin123&subscriber_no=1818619647&mask=IEB&sms=" + SMS); XmlDocument doc = new XmlDocument(); //doc.LoadXml(myRequest.GetResponse()); } catch (Exception ex) { } } //Mail if (lblEmail.Text.Trim() != "") { try { string mialMessage = "Dear Engr,<br/><br/>Thanks for bKash payment.Your registration for Convention 55 is Confirmed.. Your payment amount(" + lblAmount.Text + ") and trxID: " + lblTransactionID.Text + "<br/>This is system generated payment confirmation mail.<hr/>We will send you the money receipt before 27th April<hr/>With regards<br/>IT Section, IEB<br/>01766674142"; //Sendmail.sendEmail(lblEmail.Text, "IEB Convention 55 Regsitration fee payment confirmation", mialMessage); } catch (Exception ex) { } } } } catch (Exception ex) { } } btnSearch_Click(this, new EventArgs()); }