I am working in a project called ERP Systems.
I had a question about a SQL stored procedure.
Currently I designed a masters page for entering the product details... i.e. using ajax tab container I designed product id, product name in one tab and product name, purchase rate, selling price in another tab.
I created a table for the page and I create two stored procedures for inserting the values separately in the table i.e. in first tab product id and product name is used to insert in that table and in second tab using product name (dynamically added) I should insert purchase rate, selling price etc...
is it possible for do like this.
We can insert the two different values in two different times in one table.
I am using sql server 2005, .net 2.0.
I had only one table named tblmasters in sql & after inserting products, have to enter purchase rate, selling price,etc.. at two different times, using two insert query (stored procedures).. I am using ajax tab container so that the tab panel has two design forms....
I don't know whether it is possible... i am just asking you friends.
What I have tried:
<ajax:tabcontainer style="Z-INDEX:1" id="TC" runat="server" activetabindex="0" width="346px">
<br mode="hold" xmlns:ajax="#unknown" /><ajax:tabpanel runat="server" id="tp1">
<br mode="hold" xmlns:ajax="#unknown" />
<HeaderTemplate>ADD PRODUCTS</HeaderTemplate>
<ContentTemplate>
<table style="BORDER-RIGHT: darkgray solid; BORDER-TOP: darkgray solid; BORDER-LEFT: darkgray solid" class="Border" cellSpacing=4 cellPadding=4>
<tr class="Heading" align="center" height="10%">
<td colspan="3">PRODUCTS</td></tr>
<tr>
<td>
<asp:Label id="lblpid" runat="server" CssClass="Labels" Text="Product ID"></asp:Label>
</td>
<td>:</td>
<td><asp:TextBox id="txtpid" runat="server"></asp:TextBox> </td></tr>
<tr>
<td>
<asp:Label id="lblproductname" runat="server" CssClass="Labels" Text="Product Name"></asp:Label>
</td>
<td>:</td>
<td>
<asp:TextBox id="txtpname" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="3" align="center"><asp:Label ID="lblmsg" runat="server" Font-Bold="True"></asp:Label></td>
<td align="right">
<asp:Button ID="addprobtn" runat="server" Text="Add" OnClick="addprobtn_Click" />
</td>
</tr>
<tr align="center">
<td colspan="3">
<asp:Panel ID="pan1" runat="server">
<asp:GridView ID="addpro_Grid2" runat="server" Width="276px" AutoGenerateColumns="False" AllowPaging="True" OnPageIndexChanging="addpro_Grid2_PageIndexChanging" PageSize="5">
<SelectedRowStyle CssClass="GridSelectedItem" /><AlternatingRowStyle CssClass="GridAlter" />
<EditRowStyle CssClass="GridEditItem" />
<Columns>
<asp:BoundField DataField="pid" HeaderText="Products ID" />
<asp:BoundField DataField="pname" HeaderText="Products Name" />
</Columns>
</asp:GridView>
</asp:Panel> </td></tr>
<tr> <td colspan="3">
<center>
<asp:ImageButton id="apbtnadd" runat="server" ImageUrl="~/admin/Images/addbtnrose.png" Height="50px" OnClick="apbtnadd_Click1" Width="60px"></asp:ImageButton>
<asp:ImageButton id="apbtnsave" runat="server" ImageUrl="~/admin/Images/savebtnrose.png" Height="50px" Width="60px" OnClick="apbtnsave_Click"></asp:ImageButton>
<asp:ImageButton id="apbtnedit" runat="server" ImageUrl="~/admin/Images/editbtnrose.png" Height="50px" Width="60px"></asp:ImageButton>
<asp:ImageButton id="apbtndelete" runat="server" ImageUrl="~/admin/Images/deletebtnrose.png" Height="50px" Width="60px"></asp:ImageButton>
</center></td></tr>
</table>
</ContentTemplate>
</Ajax:TabPanel>
<Ajax:TabPanel runat="server" ID="tp2">
<HeaderTemplate>PRODUCTS RATE</HeaderTemplate>
<ContentTemplate>
<div align="center">
<table style="BORDER-RIGHT: darkgray solid; BORDER-TOP: darkgray solid; BORDER-LEFT: darkgray solid" cellspacing="2" cellpadding="2" width=550>
<tr>
<td class="Heading" align=center>PRODUCTS RATE</td>
</tr>
</table>
<table style="BORDER-RIGHT: darkgray solid; BORDER-LEFT: darkgray solid" class="Border" width="550" align="center" >
<tr>
<td>
<asp:Label ID="lblprpid" runat="server" CssClass="Labels" Text="Product ID"></asp:Label>
</td>
<td>
<asp:TextBox id="txtprpid" runat="server"></asp:TextBox>
</td>
<td align="left">
<asp:Label id="lbldate" runat="server" CssClass="Labels" Text="Date"></asp:Label>
</td>
<td>
<asp:TextBox id="txtdate" runat="server"></asp:TextBox>
<Ajax:CalendarExtender id="cedate" runat="server" Enabled="True" TargetControlID="txtdate"></Ajax:CalendarExtender>
</td>
</tr>
<tr>
<td align="left">
<asp:Label id="lblpname" runat="server" CssClass="Labels" Text="Product Name"></asp:Label>
</td>
<td>
<asp:DropDownList id="ddlname" runat="server" Width="155px">
<asp:ListItem>--Select--</asp:ListItem>
</asp:DropDownList>
</td>
<td align="left">
<asp:Label id="lblrate" runat="server" CssClass="Labels" Text="Purchase Rate"></asp:Label>
</td>
<td>
<asp:TextBox id="txtrate" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td align="left">
<asp:Label id="lblqty" runat="server" CssClass="Labels" Text="Quantity"></asp:Label>
</td>
<td>
<asp:TextBox id="txtqty" runat="server"></asp:TextBox>
</td>
<td align="left">
<asp:Label id="lbltamt" runat="server" CssClass="Labels" Text="Total Amount"></asp:Label>
</td>
<td>
<asp:TextBox id="txttamt" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td align="left">
<asp:Label id="lblspamt" runat="server" CssClass="Labels" Text="Selling Price/Unit"></asp:Label>
</td>
<td>
<asp:TextBox id="txtspamt" runat="server"></asp:TextBox>
</td>
<td align="left">
<asp:Label id="lblstock" runat="server" CssClass="Labels" Text="Stock In Hand"></asp:Label>
</td>
<td>
<asp:TextBox id="txtstock" runat="server" ReadOnly="True"></asp:TextBox>
</td>
</tr>
<tr align="right">
<td colspan="4">
<asp:Button ID="praddbtn" runat="server" Text="Add" OnClick="praddbtn_Click1" />
</td>
</tr>
</table>
</div>
<table style="BORDER-RIGHT: darkgray solid; BORDER-LEFT: darkgray solid; BORDER-BOTTOM: darkgray solid" class="Border" width="550" align="center">
<tr align="center">
<td colspan="4">
<asp:GridView ID="pr_Grid" runat="server" AutoGenerateColumns="False">
<SelectedRowStyle CssClass="GridSelectedItem" /><AlternatingRowStyle CssClass="GridAlter" />
<EditRowStyle CssClass="GridEditItem" />
<Columns>
<asp:BoundField DataField="pname" HeaderText="Product Name" />
<asp:BoundField DataField="prate" HeaderText="Purchase Rate" />
<asp:BoundField DataField="qty" HeaderText="Quantity" />
<asp:BoundField DataField="tamt" HeaderText="Total Amount" />
<asp:BoundField DataField="spamt" HeaderText="Selling Price" />
</Columns>
</asp:GridView>
</td>
</tr>
<tr align="center">
<td colspan="4">
<center>
<asp:ImageButton id="prbtnadd" runat="server" ImageUrl="~/admin/Images/addbtnrose.png" Height="50px" önClick="prbtnadd_Click"></asp:ImageButton>
<asp:ImageButton id="prbtnsave" runat="server" ImageUrl="~/admin/Images/savebtnrose.png" Height="50px"></asp:ImageButton>
<asp:ImageButton id="prbtnedit" runat="server" ImageUrl="~/admin/Images/editbtnrose.png" Height="50px"></asp:ImageButton>
<asp:ImageButton id="prbtndelete" runat="server" ImageUrl="~/admin/Images/deletebtnrose.png" Height="50px"></asp:ImageButton>
</center>
</td>
</tr>
</ContentTemplate>
</Ajax:TabPanel>
</Ajax:TabContainer>