private void processPayemnt(string status) { int receiverID = 0; receiverID = selecetedGridRow(); if (gvRECEIVER.Visible) { //update the sender RECEIVER tempRECEIVER = new RECEIVER(); tempRECEIVER.RECEIVERID = int.Parse(txtMemberID.Text); tempRECEIVER.USERNAME = ""; tempRECEIVER.RECEIVERFNAME = txtRECEIVERFNAME.Text; tempRECEIVER.RECEIVERMNAME = txtRECEIVERMNAME.Text; tempRECEIVER.RECEIVERLNAME = txtRECEIVERLNAME.Text; tempRECEIVER.RECEIVERADDRESS1 = txtAddress.Text; tempRECEIVER.RECEIVERADDRESS2 = ""; tempRECEIVER.RECEIVERCITY = txtCity.Text; tempRECEIVER.RECEIVERSTATE = txtState.Text; tempRECEIVER.RECEIVERZIP = txtZIP.Text; tempRECEIVER.RECEIVERPHONE = txtPhoneNumber.Text; tempRECEIVER.CREATEDBY = 1; tempRECEIVER.SCANURL = ""; tempRECEIVER.CREATEDON = DateTime.Now; tempRECEIVER.UPDATEDBY = int.Parse(Session["userInfoID"].ToString()); tempRECEIVER.UPDATEDON = DateTime.Now; bool result = RECEIVERManager.UpdateRECEIVER(tempRECEIVER); } else { //add receiver RECEIVER rECEIVER = new RECEIVER(); rECEIVER.USERNAME = User.Identity.Name.ToString(); rECEIVER.RECEIVERFNAME = txtRECEIVERFNAME.Text; rECEIVER.RECEIVERMNAME = txtRECEIVERMNAME.Text; rECEIVER.RECEIVERLNAME = txtRECEIVERLNAME.Text; rECEIVER.RECEIVERADDRESS1 = txtAddress.Text; rECEIVER.RECEIVERADDRESS2 = ""; rECEIVER.RECEIVERCITY = txtCity.Text; rECEIVER.RECEIVERSTATE = txtState.Text; rECEIVER.RECEIVERZIP = txtZIP.Text; rECEIVER.RECEIVERPHONE = txtPhoneNumber.Text; rECEIVER.CREATEDBY = int.Parse(Session["userInfoID"].ToString()); rECEIVER.CREATEDON = DateTime.Now; rECEIVER.UPDATEDBY = int.Parse(Session["userInfoID"].ToString()); rECEIVER.UPDATEDON = DateTime.Now; rECEIVER.SCANURL = ""; txtMemberID.Text = RECEIVERManager.InsertRECEIVER(rECEIVER).ToString(); } //Process payment TRANS tempTRANS = new TRANS(); tempTRANS.TRANSID = int.Parse(hfTransID.Value); tempTRANS.RECEIVERPHONENO = txtPhoneNumber.Text; tempTRANS.SENDEREMAILADDRESS = txtReceiverEmail.Text; //basically in DB there is no Receiver email id that is why we have given that here it will be the receiver id tempTRANS.CAUSETRANSOTHERFEES = hfCauseOtherServiceChages.Value + "\n" + txtCauseOtherServiceCharges.Text; tempTRANS.TRANSSTATUS = status; tempTRANS.TRANSRECEIVEDID = txtMemberID.Text; tempTRANS.TRANSRECEIVEDATE = DateTime.Now; tempTRANS.UPDATEDBY = int.Parse(Session["userInfoID"].ToString());//Session["lOCATION"] != null ? ((LOCATIONGROUP)Session["lOCATION"]).LOCATIONGROUPID : ((AGENT)Session["aGENT"]).AGENTID; tempTRANS.UPDATEDON = DateTime.Now; if (TRANSManager.UpdateTRANS_Paid(tempTRANS)) { lblmessage.Text = "Payment done successfully..."; lblmessage.ForeColor = System.Drawing.Color.Green; lblSubTotalSendingAmountTotal.Text = "0"; lblSubTotalFeesTotal.Text = "0"; lblSubTotalDiscountTotal.Text = "0"; lblSubTotalTotalAmountTotal.Text = "0"; if (txtRefCodeForSearch.Text != "") { txtRefCodeForSearch.Text = ""; return; } loadReport(); txtReceiverEmail.Text = ""; divPayment.Visible = false; } else { lblmessage.Text = "Error found.."; lblmessage.ForeColor = System.Drawing.Color.Red; } }
private void updateTRANS(string status) { if (hfReferenceCode.Value == txtReferenceCode.Text) { int agnetID = 4; if (Session["role"].ToString() == "Agent") { agnetID = ((AGENT)Session["aGENT"]).AGENTID; } else if (Session["role"].ToString() == "Location") { agnetID = (-1) * ((LOCATIONGROUP)Session["lOCATION"]).LOCATIONGROUPID; } calculateTotal(); DateTime nullDate = DateTime.Parse(ConfigurationManager.AppSettings["NULL_DATE"].ToString()); TRANS tRANS = new TRANS(); tRANS = TRANSManager.GetTRANSByRefCode(txtReferenceCode.Text); TRANS tempTRANS = new TRANS(); tempTRANS.TRANSID = tRANS.TRANSID; #region Edit Receiver info if (!btnEditReceiver.Visible) //it it invisible that means the Receiver is going to be edited { txtFirstName.Enabled = true; txtMiddleName.Enabled = true; txtLastName.Enabled = true; txtReceiverCity.Enabled = true; txtReceiverCountry.Enabled = true; RECEIVER rECEIVER = new RECEIVER(); rECEIVER.USERNAME = User.Identity.Name.ToString(); rECEIVER.RECEIVERFNAME = txtFirstName.Text; rECEIVER.RECEIVERMNAME = txtMiddleName.Text; rECEIVER.RECEIVERLNAME = txtLastName.Text; rECEIVER.RECEIVERADDRESS1 = ""; rECEIVER.RECEIVERADDRESS2 = ""; rECEIVER.RECEIVERCITY = txtReceiverCity.Text; rECEIVER.RECEIVERSTATE = txtReceiverCountry.Text; rECEIVER.RECEIVERZIP = ""; rECEIVER.RECEIVERPHONE = ""; rECEIVER.SCANURL = ""; rECEIVER.CREATEDBY = int.Parse(Session["userInfoID"].ToString()); rECEIVER.CREATEDON = DateTime.Now; rECEIVER.UPDATEDBY = int.Parse(Session["userInfoID"].ToString()); rECEIVER.UPDATEDON = DateTime.Now; rECEIVER.SCANURL = "~/Uploads/Receiver/no_image.jpeg"; tRANS.RECEIVERID = RECEIVERManager.InsertRECEIVER(rECEIVER); editReceiver(false); } #endregion tempTRANS.CUSTID = tRANS.CUSTID; tempTRANS.RECEIVERID = tRANS.RECEIVERID; tempTRANS.LOCATIONID = tRANS.LOCATIONID; tempTRANS.TRANSDT = DateTime.Parse(txtDate.Text); tempTRANS.TRANSAMOUNT = Decimal.Parse(txtSendingAmount.Text); tempTRANS.TRANSFEES = Decimal.Parse(txtServiceCharge.Text); tempTRANS.TRANSOTHERFEES = Decimal.Parse(txtOtherServiceCharge.Text); tempTRANS.CAUSETRANSOTHERFEES = txtCauseOtherServiceCharges.Text; tempTRANS.TRANSPROMOCODE = txtDiscount.Text; tempTRANS.TRANSPROMO = 0; tempTRANS.TRANSTOTALAMOUNT = Decimal.Parse(txtTotalCharge.Text); tempTRANS.FLAG_SM_RECEIVER = 'N'; tempTRANS.SM_RECEIVER = ""; tempTRANS.FLAG_CALL_RECEIVER = 'N'; tempTRANS.RECEIVERPHONENO = tRANS.RECEIVERPHONENO; tempTRANS.FLAG_DD = 'N'; tempTRANS.FLAG_TESTQUESTION = 'N'; tempTRANS.TESTQUESTION = txtTestQuestion.Text; tempTRANS.TESTANSWER = txtTestAnswer.Text; tempTRANS.FLAG_CALLSENDER = 'N'; tempTRANS.FLAG_SMSSENDER = 'N'; tempTRANS.FLAG_EMAILSENDER = 'N'; tempTRANS.SENDEREMAILADDRESS = ""; tempTRANS.TRANSSTATUS = status != "SAME" ? status : tRANS.TRANSSTATUS; tempTRANS.TRANSRECEIVEDID = ""; tempTRANS.TRANSRECEIVEDATE = nullDate; tempTRANS.CREATEDBY = tRANS.CREATEDBY; tempTRANS.CREATEDON = tRANS.CREATEDON; tempTRANS.UPDATEDBY = int.Parse(Session["userInfoID"].ToString()); //agnetID; //for location it will be -ve tempTRANS.UPDATEDON = DateTime.Now; tempTRANS.AGENTID = tRANS.AGENTID; tempTRANS.REFCODE = tRANS.REFCODE; bool result = TRANSManager.UpdateTRANS(tempTRANS); lblMessage.Text = "Update Successfully"; lblMessage.ForeColor = System.Drawing.Color.Green; //divEditTrans.Visible = false; } else { lblMessage.Text = "Update Error: You should not change the Ref Code."; lblMessage.ForeColor = System.Drawing.Color.Red; } }
protected void btnSave_Click(object sender, EventArgs e) { if (txtRECEIVERFNAME.Text != "" && txtRECEIVERLNAME.Text != "") { RECEIVER rECEIVER = new RECEIVER(); rECEIVER.USERNAME = User.Identity.Name.ToString(); rECEIVER.RECEIVERFNAME = txtRECEIVERFNAME.Text; rECEIVER.RECEIVERMNAME = txtRECEIVERMNAME.Text; rECEIVER.RECEIVERLNAME = txtRECEIVERLNAME.Text; rECEIVER.RECEIVERADDRESS1 = txtRECEIVERADDRESS1.Text; rECEIVER.RECEIVERADDRESS2 = txtRECEIVERADDRESS2.Text; rECEIVER.RECEIVERCITY = txtRECEIVERCITY.Text; rECEIVER.RECEIVERSTATE = txtRECEIVERSTATE.Text; rECEIVER.RECEIVERZIP = txtRECEIVERZIP.Text; rECEIVER.RECEIVERPHONE = txtRECEIVERPHONE.Text; rECEIVER.SCANURL = ""; rECEIVER.CREATEDBY = 1; rECEIVER.CREATEDON = DateTime.Now; rECEIVER.UPDATEDBY = 1; rECEIVER.UPDATEDON = DateTime.Now; if (uplFile.PostedFile != null && uplFile.PostedFile.ContentLength > 0) { try { string dirUrl = "~/Uploads/Receiver"; string dirPath = Server.MapPath(dirUrl); if (!Directory.Exists(dirPath)) { Directory.CreateDirectory(dirPath); } string fileName = Path.GetFileName(uplFile.PostedFile.FileName); string fileUrl = dirUrl + "/" + Path.GetFileName(uplFile.PostedFile.FileName); string filePath = Server.MapPath(fileUrl); uplFile.PostedFile.SaveAs(filePath); rECEIVER.SCANURL = dirUrl + "/" + fileName; } catch (Exception ex) { lblMessage.Text = ex.Message.ToString(); } } else { rECEIVER.SCANURL = "~/Uploads/Receiver/no_image.jpeg"; } int resutl = RECEIVERManager.InsertRECEIVER(rECEIVER); if (resutl > 0) { Session["snreceiverID"] = resutl.ToString(); Response.Redirect("SearchLocation.aspx"); } } else { lblMessage.Text = "Please enter the First Name and Last Name..."; lblMessage.ForeColor = System.Drawing.Color.Red; } }