I need help to calculate resulted amount after applying coupon code, the thing is when user enter the coupon code, it can be of two type 0/1, suppose this is the table
Voucher Code |
Amount |
Off_type |
Test |
50 |
0 |
Demo |
10 |
1 |
Now if the Off_type is 1, then Amount to be deducted should be as rupees, and if Off_type 0, then amount to be deducted should be percent of total.
For example: If total amount(without discount) is 100, and Coupon code is "Demo", then after discount total amount to be paid will be 90, as 100 - 10% Of (Total) =90
So I am not able to implement this functionality using jQuery and WebMethod, here is my current code
jQuery
...Hello Guys !!
I have already asked the same question but now I am again asking with the new requirement, so please read carefully and solve my issues.
My Requirement:
Explaining my Requirement
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="N-level-Treeview.aspx.cs"
Inherits="N_level_Treeview" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TreeView ID="TreeView1" runat="server" ImageSet="XPFileExplorer" NodeIndent="15">
<HoverNodeStyle Font-Underline="True" ForeColor="#6666AA" />
<NodeStyle Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black" HorizontalPadding="2px"
NodeSpacing="0px" VerticalPadding="2px"></NodeStyle>
<ParentNodeStyle Font-Bold="False" />
<SelectedNodeStyle BackColor="#B5B5B5" Font-Underline="False" HorizontalPadding="0px"
VerticalPadding="0px" />
</asp:TreeView>
</div>
</form>
</body>
</html>?
: - I have a table and there are Srno,PId, Pname, CID, CName,Cqty columns in my table.
Suppose if CID is also in PID column, Node must be created on that CID and also must have expand button to show the child of that cID.
What i have done in coding let's see...
CS--------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
public partial class N_level_Treeview : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = this.GetData("SELECT cId, cName FROM TopBill");
this.PopulateTreeView(dt, 0, null);
}
}
private void PopulateTreeView(DataTable dtParent, int parentId, TreeNode treeNode)
{
foreach (DataRow row in dtParent.Rows)
{
TreeNode child = new TreeNode
{
Text = row["cName"].ToString(),
Value = row["cId"].ToString()
};
if (parentId == 0)
{
TreeView1.Nodes.Add(child);
DataTable dtChild = this.GetData("SELECT srNo,cid, cName FROM TopBill WHERE pid = " + child.Value);
PopulateTreeView(dtChild, int.Parse(child.Value), child);
}
else
{
treeNode.ChildNodes.Add(child);
}
}
}
private DataTable GetData(string query)
{
DataTable dt = new DataTable();
string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand(query))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.CommandType = CommandType.Text;
cmd.Connection = con;
sda.SelectCommand = cmd;
sda.Fill(dt);
}
}
return dt;
}
}
}
-------------- Current Output of my Code is ...
...
Hi, i am getting this issue while running a page in MVC, it was working fine previously, but i now i am getting the error as below
...How can I edit/update value using pop-up modal in knockout js and MVC?
My data is being displayed in a table using knockout but when the user clicks on edit button, text boxes, values should prefill with data in pop up model against particular id, but I am not able to achieve this.
...How to create Dropdown list using Option group in MVC Razor syntax in View, like below iimage
...
I have to create shopping cart in Asp.net MVC ,i don't know from where I should start
As i am a beginner, I saw various Youtube videos online but i am not able understand coding in those videos, so Please give me some other appropriate recommendation or advise???
Thanks
...