Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
XML
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="demos.aspx.cs" Inherits="ADMIN_demos" %>

<!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 id="Head1" runat="server">
   <title>CMPSS</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="imagetoolbar" content="no" />
<link rel="stylesheet" href="../styles/layout.css" type="text/css" />
 <link type="text/css" href="../css1/ui-lightness/jquery-ui-1.8.19.custom.css" rel="stylesheet" />
<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="../js/jquery-ui-1.8.19.custom.min.js"></script>
<script type="text/javascript">
    function getValues(val) {

        var numVal1 = parseInt(document.getElementById("txtmrp").value);
        var numVal2 = parseInt(document.getElementById("txtptr").value);
        var numVal3 = parseInt(document.getElementById("txtpts").value);

        var totalValue = numVal1 + numVal2 + numVal3;

        document.getElementById("txtOqnty").value = totalValue;
    }
</script>

<style>
input.numbox{
    width:30px;
    height:20px;
}
textarea.mainbox{
    width:200px;
    height:100px;
}
</style>
    <style type="text/css">

table{
    width:100%;
    border-collapse:collapse;
    table-layout:auto;
    vertical-align:top;
    margin-bottom:15px;
    border:1px solid #CCCCCC;
            margin-right: 0px;
        }

table thead th, table tbody td{
    padding:5px;
    border-collapse:collapse;
    }

table tbody td{
    vertical-align:top;
    border-collapse:collapse;
    border-left:1px solid #CCCCCC;
    border-right:1px solid #CCCCCC;
    }

    </style>
</head>
<body id="top" style="background-color:White">
    <form action="" id="cakeform" onsubmit="return false;" runat="server">
<div class="wrapper col1">
  <div id="topbar">
     <p>Mobile: 91 44 2474 5051 | Mail: admin@cydex.co.in</p>
    <ul>
      <li><p>Fax: 91 44 2471 1789&nbsp; </p></li>
      <li class="last"><a href="../Default.aspx">Logout</a></li>
    </ul>
    <br class="clear" />
  </div>
</div>
<!-- ####################################################################################################### -->
<div class="wrapper col2">
  <div id="header">
    <div class="fl_left">
      <h1><asp:Label ID="Label4" runat="server"
              Text="Label">CMPSS</asp:Label></h1>
      <p></p>
    </div>
      <%-- <div class="fl_right"> <a href="#"><img src="images/demo/468x60.gif" alt="" /></a> </div>--%>
    <br class="clear" />
     <br class="clear" />
      <br class="clear" />
  </div>
</div>
<!-- ####################################################################################################### -->
<div class="wrapper col3">
  <div id="topnav">
    <ul>
      <li class="active"><a href="#">Home</a><span></span></li>
      <li><a href="demos.aspx">Order Form</a><span></span>
        <%--<ul>
          <li><a href="/KB/answers/RawMaterial.aspx">Raw Material</a></li>
          <li><a href="/KB/answers/BricksType.aspx">Bricks Type</a></li>
          <li><a href="/KB/answers/Bricksizes.aspx">Bricks Sizes</a></li>
          <li><a href="/KB/answers/AEmployee.aspx">Employee</a></li>
          <li><a href="/KB/answers/Suppliers.aspx">Suppliers</a></li>
          <li><a href="/KB/answers/Customer.aspx">Customers</a></li>
         </ul>--%>
      </li>
     <li><a href="../login.aspx">Sign IN</a><span></span>
        <%--<ul>
          <li><a href="/KB/answers/Sale.aspx">Sales</a></li>
          <li><a href="/KB/answers/Purchas.aspx">Purchase</a></li>
          <li><a href="/KB/answers/AExpanses.aspx">Expanses</a></li>
          <li><a href="/KB/answers/IssueRawM.aspx">Issue Raw Materials</a></li>
          <li><a href="/KB/answers/BricksReceiptI.aspx">Issue Bricks</a></li>
        </ul>
      </li>--%>
      <li><a href="Signup.aspx">REGISTARTION</a><span></span>
        <%--<ul>
          <li><a href="/KB/answers/SaleReport.aspx">Sales</a></li>
          <li><a href="/KB/answers/BrickStocks.aspx">Bricks Stock</a></li>
          <li><a href="/KB/answers/RawStock.aspx">Raw Material Stock</a></li>
        </ul>--%>
      </li>
    </ul>
    <br class="clear" />
  </div>
</div>
    <%--<form id="form1" runat="server">--%>
    <p>
        <asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="Large"
            ForeColor="#FF3300" Text="Order Form Details"></asp:Label>
        <br />
    </p>
    <div>

        <asp:GridView ID="grvStudentDetails" runat="server" AutoGenerateColumns="False"
            CellPadding="4" ForeColor="#333333" GridLines="None"
            OnRowDeleting="grvStudentDetails_RowDeleting" ShowFooter="True"
            Style="text-align: left" Width="97%">
            <Columns>
                <asp:BoundField DataField="RowNumber" HeaderText="SNo" />
               <asp:TemplateField HeaderText="Product">
                    <ItemTemplate>
                        <asp:DropDownList ID="drpproduct" runat="server">
                            <asp:ListItem>Select</asp:ListItem>
                            <asp:ListItem Value="G">abc</asp:ListItem>
                            <asp:ListItem Value="P">bcd</asp:ListItem>
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                            ControlToValidate="drpproduct" ErrorMessage="*" InitialValue="Select"></asp:RequiredFieldValidator>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="seats">
                    <ItemTemplate>
                        <asp:DropDownList ID="drpseats" runat="server">
                            <asp:ListItem>Select</asp:ListItem>
                            <asp:ListItem Value="G">10</asp:ListItem>
                            <asp:ListItem Value="P">20</asp:ListItem>
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
                            ControlToValidate="drpseats" ErrorMessage="*" InitialValue="Select"></asp:RequiredFieldValidator>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="MRP">
                    <ItemTemplate>
                        <asp:TextBox ID="txtmrp" runat="server" MaxLength="3" Width="66px" onkeyup="getValues()" ></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                            ControlToValidate="txtmrp" ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="PTR">
                    <ItemTemplate>
                        <asp:TextBox ID="txtptr" runat="server" MaxLength="3" Width="66px" onkeyup="getValues()" ></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
                            ControlToValidate="txtptr" ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="PTS">
                    <ItemTemplate>
                        <asp:TextBox ID="txtpts" runat="server" MaxLength="3" Width="66px" onkeyup="getValues()"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
                            ControlToValidate="txtpts" ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Order Quantity">
                    <ItemTemplate>
                        <asp:TextBox ID="txtOqnty" runat="server" MaxLength="50" Width="66px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server"
                            ControlToValidate="txtOqnty" ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Free Quantity">
                    <ItemTemplate>
                        <asp:DropDownList ID="drpQualification" runat="server">
                            <asp:ListItem>Select</asp:ListItem>
                            <asp:ListItem Value="G">10%</asp:ListItem>
                            <asp:ListItem Value="P">20%</asp:ListItem>
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server"
                            ControlToValidate="drpQualification" ErrorMessage="*" InitialValue="Select"></asp:RequiredFieldValidator>
                    </ItemTemplate>
                </asp:TemplateField>
                 <asp:TemplateField HeaderText="Bill Value">
                    <ItemTemplate>
                        <asp:TextBox ID="txtbill" runat="server" MaxLength="50" Width="66px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server"
                            ControlToValidate="txtbill" ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Margin">
                    <ItemTemplate>
                        <asp:TextBox ID="txtmargin" runat="server" MaxLength="50" Width="66px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server"
                            ControlToValidate="txtmargin" ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
                    </ItemTemplate>
                    <FooterStyle HorizontalAlign="Right" />
                    <FooterTemplate>
                        <asp:Button ID="ButtonAdd" runat="server" OnClick="ButtonAdd_Click"
                            Text="Add New Row" />
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:CommandField ShowDeleteButton="True" />
            </Columns>
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#EFF3FB" />
            <EditRowStyle BackColor="#2461BF" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>

    </div>
    <p>
                        <%--<asp:Button ID="Button2" runat="server" BackColor="Transparent"
                            onclick="Button2_Click" BorderStyle="None" />--%>
                        <asp:TextBox ID="txtTamount" runat="server" BackColor="#FFFFCC" Width="167px"
                            MaxLength="150" Height="20px" onblur="totalamt()"></asp:TextBox>
                        <asp:HiddenField ID="Hiddenrowtot" runat="server" />
                        </p>
    </form>
</body>
</html>
Posted
Comments
King Fisher 31-Mar-14 0:21am    
not clear .
lukeer 31-Mar-14 3:56am    
Please edit your question[^] to provide more insight into
- what values you want to calculate
- what you expect to happen
- what happens instead
Oshtri Deka 31-Mar-14 3:56am    
Bad question.
First there is too much code. We don't need entire html.
What kind of calculation do you need? +-/*%?!?
Which columns should be involved in calculation?

Improve it!
Guruprasad.K.Basavaraju 31-Mar-14 10:57am    
Vedakumar, could you please refine your question? I guess we are getting lost in the long code lines above. Calc on grid is fairly simple , so if you could get the right question posted you will get a quick answer.

-Guru
vedakumar 2-Apr-14 9:03am    
formula is (order quantity+free quantity)+ptr=margin

actually "free quantity" is 10 to 60 number and "order quantity" user manually enter in textbox, ptr is already stored db it get database value. this three calcute and show to result in textbox "margin"

-Plz
Veda

Vedakumar, could you please refine your question? I guess we are getting lost in the long code lines above. Calc on grid is fairly simple , so if you could get the right question posted you will get a quick answer.

-Guru
 
Share this answer
 
Comments
[no name] 31-Mar-14 10:53am    
At best this is a comment. It is not a solution to whatever it is that they are asking.
Guruprasad.K.Basavaraju 31-Mar-14 10:57am    
Sorry, :) new to code project.. moved it over to the comment section. Thanks "InsertCleverUserName" :)
check your textbox id's when u do calculations at client side using javascript or jquery the id will be changed bcoz the contrls i.e textboxes are nested inside the gridview check page source on the browser and see the textbox is

for eg: it coluld be like gridview1_textbox1...........................

and also call your function getValues() where it is nescessary



but it would be easy to code to do on server side rather than client side bcoz the controls nested inside other controls
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900