public void PopulateForm() { ResetForm(); // save the entryid hldOrderId.Value = GalaOrderId.ToString(); go = GalaOrder.GetGalaOrder(GalaOrderId); total = go.Amount + go.FeeShipping + go.Fee + go.Tax; lblInvoice.Text = go.Invoice; txtRemarks.Text = go.RemarksPayment; if (go.DatePaidString != "") { dpDateReceived.SelectedDate = go.DatePaid; } else { dpDateReceived.SelectedDate = DateTime.Now; } //BindGrid(); lblAmount.Text = total.ToString("N"); lblPrevReceived.Text = received.ToString("N"); //lnkAmountReceived.NavigateUrl = "../AmountReceived.aspx?pgId=" + entry.PayGroupId.ToString(); chkPaid.Checked = (go.PayStatus == StatusPaymentEntry.Paid); //string lastdatesent = GeneralFunction.CleanDateTimeToString(entry.LastSendPaidEmailDate, "dd/MM/yy HH:mm tt"); //if (lastdatesent == "") lastdatesent = "-"; //lbLastSendPaidEmailDate.Text = "(Last Sent:" + lastdatesent + ")"; }
protected void Page_Load(object sender, EventArgs e) { id = Request.QueryString["Id"]; if (id != null && id != "") { go = GalaOrder.GetGalaOrder(new Guid(id)); } else { go = GalaOrder.NewGalaOrder(); } if (!IsPostBack) { LoadForm(); PopulateForm(); } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (ValidateForm()) { Guid goId = new Guid(hldOrderId.Value); go = GalaOrder.GetGalaOrder(goId); // save the amount to the first entry or this default entry //go.AmountReceived += decimal.Parse(txtAmountRecieved.Text); //go.Save(); go.DatePaidString = dpDateReceived.DateInput.SelectedDate.ToString(); go.RemarksPayment = txtRemarks.Text; // paid? bool isPaid = false; //Guid paymentGroupId = entry.PayGroupId; //EntryList list = EntryList.GetEntryList(paymentGroupId, Guid.Empty, ""); //foreach (Entry ent in list) //{ string paidstatus_org = go.PayStatus; // make the change only if the status has changed. // if not do not change it if (chkPaid.Checked && paidstatus_org == StatusPaymentEntry.NotPaid) { go.PayStatus = StatusPaymentEntry.Paid; isPaid = true; } if (!chkPaid.Checked && paidstatus_org == StatusPaymentEntry.Paid) { go.PayStatus = StatusPaymentEntry.NotPaid; } go.Save(); //} //// send email? //if (chkSendPaidEmail.Checked) //{ // if (go.PaymentMethod == PaymentType.PayPal) // there shouldnt be any PP, its disabled on the list, it can never come here // GeneralFunction.CompleteNewGalaOrderPayPal(go.Id); // else // GeneralFunction.CompleteNewGalaOrderOthers(go.Id); //} // Always send email if paid if (isPaid) { GeneralFunction.CompleteNewGalaOrderOthers(go.Id); } //// history //AmountReceived amt = AmountReceived.NewAmountReceived(); //amt.Amount = decimal.Parse(txtAmountRecieved.Text); //amt.DateReceivedString = dpDateReceived.DateInput.SelectedDate.ToString(); //amt.PaygroupId = entry.PayGroupId; //amt.Invoice = ""; //amt.Remarks = txtRemarks.Text; //amt.IsSetPaid = isPaid; //amt.DateCreatedString = DateTime.Now.ToString(); //amt.Save(); if (Save_Clicked != null) { Save_Clicked(this, EventArgs.Empty); } } }