protected void btnUpdate_Click(object sender, EventArgs e) { RECEIVER rECEIVER = new RECEIVER(); rECEIVER = RECEIVERManager.GetRECEIVERByID(Int32.Parse(Request.QueryString["rECEIVERID"])); RECEIVER tempRECEIVER = new RECEIVER(); tempRECEIVER.RECEIVERID = rECEIVER.RECEIVERID; tempRECEIVER.USERNAME = User.Identity.Name.ToString(); tempRECEIVER.RECEIVERFNAME = txtRECEIVERFNAME.Text; tempRECEIVER.RECEIVERMNAME = txtRECEIVERMNAME.Text; tempRECEIVER.RECEIVERLNAME = txtRECEIVERLNAME.Text; tempRECEIVER.RECEIVERADDRESS1 = txtRECEIVERADDRESS1.Text; tempRECEIVER.RECEIVERADDRESS2 = txtRECEIVERADDRESS2.Text; tempRECEIVER.RECEIVERCITY = txtRECEIVERCITY.Text; tempRECEIVER.RECEIVERSTATE = txtRECEIVERSTATE.Text; tempRECEIVER.RECEIVERZIP = txtRECEIVERZIP.Text; tempRECEIVER.RECEIVERPHONE = txtRECEIVERPHONE.Text; tempRECEIVER.SCANURL = rECEIVER.SCANURL; tempRECEIVER.CREATEDBY = 1; tempRECEIVER.CREATEDON = rECEIVER.CREATEDON; tempRECEIVER.UPDATEDBY = int.Parse(Session["userInfoID"].ToString()); tempRECEIVER.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); tempRECEIVER.SCANURL = dirUrl + "/" + fileName; } catch (Exception ex) { lblMessage.Text = ex.Message.ToString(); } } else { tempRECEIVER.SCANURL = rECEIVER.SCANURL; } bool result = RECEIVERManager.UpdateRECEIVER(tempRECEIVER); Session["snFoodreceiverID"] = Request.QueryString["rECEIVERID"]; Response.Redirect("SearchFoodLocation.aspx"); }
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; } }