public string ToPostData() { string postData = ""; postData += HttpUtility.UrlEncode("PAYMENTREQUEST_0_PAYMENTACTION") + "=" + HttpUtility.UrlEncode(PaymentAction) + "&"; if (Amt != 0) { postData += HttpUtility.UrlEncode("PAYMENTREQUEST_0_AMT") + "=" + Amt.ToString("F", CultureInfo.InvariantCulture) + "&"; } if (CurrencyCode != string.Empty) { postData += HttpUtility.UrlEncode("PAYMENTREQUEST_0_CURRENCYCODE") + "=" + HttpUtility.UrlEncode(CurrencyCode) + "&"; } if (Desc != string.Empty) { postData += HttpUtility.UrlEncode("PAYMENTREQUEST_0_DESC") + "=" + HttpUtility.UrlEncode(Desc) + "&"; } if (ItemAmt != 0) { postData += HttpUtility.UrlEncode("PAYMENTREQUEST_0_ITEMAMT") + "=" + ItemAmt.ToString("F", CultureInfo.InvariantCulture) + "&"; } if (TaxAmt != 0) { postData += HttpUtility.UrlEncode("PAYMENTREQUEST_0_TAXAMT") + "=" + TaxAmt.ToString("F", CultureInfo.InvariantCulture) + "&"; } if (HandlingAmt != 0) { postData += HttpUtility.UrlEncode("PAYMENTREQUEST_0_HANDLINGAMT") + "=" + HandlingAmt.ToString("F", CultureInfo.InvariantCulture) + "&"; } if (ShippingAmt != 0) { postData += HttpUtility.UrlEncode("PAYMENTREQUEST_0_SHIPPINGAMT") + "=" + ShippingAmt.ToString("F", CultureInfo.InvariantCulture) + "&"; } if (InvNum != string.Empty) { postData += HttpUtility.UrlEncode("PAYMENTREQUEST_0_INVNUM") + "=" + HttpUtility.UrlEncode(InvNum) + "&"; } return(postData); }
protected void GridInwordDetails_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.DataRow && !string.IsNullOrEmpty(Convert.ToString(DataBinder.Eval(e.Row.DataItem, "InwardNo")))) { // Taxamt += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "DiscAmnt")); Amount += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Amount")); TaxPer += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "TaxPer")); TaxAmt += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "TaxAmount")); DiscPer += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "DiscPer")); DiscAmt += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "DiscAmt")); // amt += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "NetAmnt")); NetAmt += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "NetAmount")); if ((Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "InwardRate")) > Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "PORate"))) || (Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "InwardRate")) < Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "PORate")))) { //e.Row.ForeColor = Color.Red; for (int y = 0; y < e.Row.Cells.Count; y++) { e.Row.Cells[y].ForeColor = System.Drawing.Color.FromName("Red"); } } } if (e.Row.RowType == DataControlRowType.Footer) { e.Row.Cells[13].Text = "Total :"; e.Row.Cells[14].Text = Amount.ToString("0.00"); //e.Row.Cells[13].Text = TaxPer.ToString("0.00"); e.Row.Cells[16].Text = TaxAmt.ToString("0.00"); //e.Row.Cells[15].Text = DiscPer.ToString("0.00"); e.Row.Cells[18].Text = DiscAmt.ToString("0.00"); e.Row.Cells[19].Text = NetAmt.ToString("0.00"); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public string ToPostData(int index) { string postData = ""; if (Name != null) { postData += HttpUtility.UrlEncode("L_PAYMENTREQUEST_0_NAME" + index.ToString()) + "=" + HttpUtility.UrlEncode(Name) + "&"; } if (Desc != null) { postData += HttpUtility.UrlEncode("L_PAYMENTREQUEST_0_DESC" + index.ToString()) + "=" + HttpUtility.UrlEncode(Desc) + "&"; } if (Amt != 0) { postData += HttpUtility.UrlEncode("L_PAYMENTREQUEST_0_AMT" + index.ToString()) + "=" + Amt.ToString("F", CultureInfo.InvariantCulture) + "&"; } if (TaxAmt != 0) { postData += HttpUtility.UrlEncode("L_PAYMENTREQUEST_0_TAXAMT" + index.ToString()) + "=" + TaxAmt.ToString("F", CultureInfo.InvariantCulture) + "&"; } if (Number != 0) { postData += HttpUtility.UrlEncode("L_PAYMENTREQUEST_0_NUMBER" + index.ToString()) + "=" + Number.ToString(CultureInfo.InvariantCulture) + "&"; } if (Qty != 0) { postData += HttpUtility.UrlEncode("L_PAYMENTREQUEST_0_QTY" + index.ToString()) + "=" + Qty.ToString(CultureInfo.InvariantCulture) + "&"; } return(postData); }