<%--Date Created : 10/08/2012 Description : Product Master --%> <%@ Page Title="Product Master" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="ProductMaster.aspx.cs" Inherits="ProductMaster" %> <asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server"> <script src="Scripts/popup_win.js" language="javascript" type="text/javascript"></script> <script language="javascript" type="text/javascript"> function ProdGrpHelp() { open_popup('ProdGrpHelp.aspx', 320, 320, 'win1'); '<%=Session["url"]="ProductMaster.aspx" %>' // window.open('UOMHelp.aspx', 'Help', 'height=320,width=320'); return false; } function ProdHelp() { // open_popup('ProdHelp.aspx', 320, 320, 'win1'); var popup = window.open('ProdHelp.aspx', "_blank", 'height=320,width=320'); //alert('s'); // var cel1 = popup.document.getElementById('txtsearch').value; // alert(cel1); return false; } function UOMHelp() { open_popup('UOMHelp.aspx', 320, 320, 'win1'); // window.open('UOMHelp.aspx', 'Help', 'height=320,width=320'); return false; } function onlyNumbers(e) { var key = window.event ? e.keyCode : e.which; var keychar = String.fromCharCode(key); var reg = new RegExp("[0-9]"); if (key == 13 && document.getElementById('<%=txtProdGrpId.ClientID%>').value == "") { alert('Enter Product Group Id'); document.getElementById('<%=txtProdGrpId.ClientID%>').focus(); } else if (key == 13 && document.getElementById('<%=txtProdGrpId.ClientID%>').value != "") { document.getElementById('<%=txtProdId.ClientID %>').focus(); if (key == 13 && document.getElementById('<%=txtProdId.ClientID%>').value == "") { alert('Enter Product Id'); document.getElementById('<%=txtProdId.ClientID%>').focus(); } else if (key == 13 && document.getElementById('<%=txtProdId.ClientID%>').value != "") document.getElementById('<%=btnAdd.ClientID%>').focus(); } if (key == 8) { keychar = String.fromCharCode(key); } return reg.test(keychar); } function onlyChars(e) { var key = window.event ? e.keyCode : e.which; var keychar = String.fromCharCode(key); var reg = new RegExp("[a-zA-Z ]"); if (key == 13 && document.getElementById('<%=txtProdName.ClientID%>').value == "") { alert('Enter Product Name'); document.getElementById('<%=txtProdName.ClientID%>').focus(); } else if (key == 13 && document.getElementById('<%=txtProdName.ClientID%>').value != "") { document.getElementById('<%=txtBrand.ClientID%>').focus(); if (key == 13 && document.getElementById('<%=txtBrand.ClientID%>').value == "") { alert('Enter Brand'); document.getElementById('<%=txtBrand.ClientID%>').focus(); } else if (key == 13 && document.getElementById('<%=txtBrand.ClientID%>').value != "") { document.getElementById('<%=txtUOMId.ClientID%>').focus(); if (key == 13 && document.getElementById('<%=txtUOMId.ClientID%>').value == "") { alert('Enter UOM'); document.getElementById('<%=txtUOMId.ClientID%>').focus(); } else if (key == 13 && document.getElementById('<%=txtUOMId.ClientID%>').value != "") { document.getElementById('<%=txtHSCode.ClientID%>').focus(); } } } return reg.test(keychar); } function alphaNumeric(e) { var key = window.event ? e.keyCode : e.which; var keychar = String.fromCharCode(key); var reg = new RegExp("[a-zA-Z0-9]"); if (key == 13 && document.getElementById('<%=txtHSCode.ClientID%>').value == "") { alert('Enter HS Code'); document.getElementById('<%=txtHSCode.ClientID%>').focus(); } else if (key == 13 && document.getElementById('<%=txtHSCode.ClientID%>').value != "") { document.getElementById('<%=btnSave.ClientID%>').focus(); } if (key == 8) { keychar = String.fromCharCode(key); } return reg.test(keychar); } function confirmDelete() { if (document.getElementById('<%=txtProdGrpId.ClientID%>').value == "") { alert('Enter Product Group Id'); document.getElementById('<%=txtProdGrpId.ClientID%>').focus(); } else if (document.getElementById('<%=txtProdId.ClientID%>').value == "") { alert('Enter Product Id'); } else return confirm("Are you sure you want to Delete?"); } function sss() { alert('sss'); // var s = win1.document.getElementById('CellValue1').value; // document.getElementById('txtProdGrpId').value = s; } </script> <table id="Table1" runat="server"> <tr> <td align="right" style="color: #000000; font-weight: bold"> <span style="color:Red">*</span>Product Group Id </td> <td style="color: #000000; font-weight: bold"> <asp:TextBox runat="server" ID="txtProdGrpId" MaxLength="3" Width="40px" AutoPostBack="True" ontextchanged="txtProdGrpId_TextChanged" TabIndex="1"></asp:TextBox> <asp:ImageButton ID="btnProdGrpHelp" runat="server" ImageUrl="~/help.gif" onclick="btnProdGrpHelp_Click" TabIndex="2" Width="20px" /> Search <asp:Label runat="server" ID="lblProdGrpName" Text="Product Group Name"></asp:Label> <asp:Button ID="btnSearchCriteria" runat="server" Text="button" onclientclick="sss()" /> </td> </tr> <tr> <td align="right" style="color: #000000; font-weight: bold"> <span style="color:Red">*</span>Product Id </td> <td align="left" style="color: #000000; font-weight: bold"> <asp:TextBox runat="server" ID="txtProdId" MaxLength="6" Width="50px" AutoPostBack="True" ontextchanged="txtProdId_TextChanged" TabIndex="3" ViewStateMode="Enabled"></asp:TextBox> <asp:ImageButton ID="btnProductHelp" runat="server" ImageUrl="~/help.gif" Width="20px" OnClientClick="ProdHelp()" /> Search </td> </tr> <tr> <td align="right" style="color: #000000; font-weight: bold"> <span style="color:Red">*</span>Product Name </td> <td align="left" style="color: #000000; font-weight: bold"> <asp:TextBox ID="txtProdName" runat="server" Width="400px" MaxLength="30" TabIndex="4" ViewStateMode="Enabled"></asp:TextBox> </td> </tr> <tr> <td align="right" style="color: #000000; font-weight: bold"> <span style="color:Red">*</span>Brand </td> <td align="left" style="color: #000000; font-weight: bold"> <asp:TextBox ID="txtBrand" runat="server" Width="400px" MaxLength="30" TabIndex="5"></asp:TextBox> </td> </tr> <tr> <td align="right" style="color: #000000; font-weight: bold"> <span style="color:Red">*</span>UOM Id </td> <td align="left" style="color: #000000; font-weight: bold"> <asp:TextBox runat="server" ID="txtUOMId" MaxLength="3" Width="30" AutoPostBack="True" ontextchanged="txtUOMId_TextChanged" TabIndex="6"></asp:TextBox> <asp:Image ID="btnUOMHelp" runat="server" ImageUrl="~/help.gif" TabIndex="7" Width="20px" /> Search <asp:Label runat="server" ID="lblUOMDesc" Text="UOM"></asp:Label> </td> </tr> <tr> <td align="right" style="color: #000000; font-weight: bold"> <span style="color:Red">*</span>HS Code </td> <td align="left" style="color: #000000; font-weight: bold"> <asp:TextBox ID="txtHSCode" runat="server" Width="100px" MaxLength="10" TabIndex="8"></asp:TextBox> </td> </tr> </table><br /> <table> <tr> <td> <%-- <input type="button" id="btnAdd" onclick="validate()" value="Add" />--%> <asp:Button ID="btnAdd" runat="server" text="Add" Width="70px" TabIndex="2" onclick="btnAdd_Click" Font-Bold="True" /> </td> <td> <asp:Button ID="btnSave" runat="server" text="Save" Width="70px" TabIndex="9" Font-Bold="True" onclick="btnSave_Click"/> </td> <td> <asp:Button ID="btnDelete" runat="server" text="Delete" Width="70px" TabIndex="10" OnClientClick="return confirmDelete();" Font-Bold="True" onclick="btnDelete_Click"/> </td> <td> <asp:Button ID="btnCancel" runat="server" text="Cancel" Width="70px" Font-Bold="True" TabIndex="11"/> </td> <td> <asp:Button ID="btnExit" runat="server" text="Exit" Width="70px" PostBackUrl="~/Default.aspx" Font-Bold="True" TabIndex="12" /> </td> </tr> </table> </asp:Content>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ProdHelp.aspx.cs" Inherits="ProdHelp" %> <!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> <script type="text/javascript"> var SelectedRow = null; var SelectedRowIndex = null; var UpperBound = null; var LowerBound = null; window.onload = function () { UpperBound = parseInt('<%= this.grdsearch.Rows.Count %>') - 1; LowerBound = 0; SelectedRowIndex = -1; return false; // var s = window.opener.document.getElementById('txtBrand').value; // alert(s); } function SelectRow(CurrentRow, RowIndex) { if (SelectedRow == CurrentRow || RowIndex > UpperBound || RowIndex < LowerBound) return; if (SelectedRow != null) { SelectedRow.style.backgroundColor = SelectedRow.originalBackgroundColor; SelectedRow.style.color = SelectedRow.originalForeColor; } if (CurrentRow != null) { CurrentRow.originalBackgroundColor = CurrentRow.style.backgroundColor; CurrentRow.originalForeColor = CurrentRow.style.color; CurrentRow.style.backgroundColor = '#DCFC5C'; CurrentRow.style.color = 'Black'; } SelectedRow = CurrentRow; SelectedRowIndex = RowIndex; setTimeout("SelectedRow.focus();", 0); } function RefreshParentPage() { // var s = document.getElementById('TextBox2').value; // alert(s); // window.opener.document.getElementById('TextBox1').value=s; window.opener.sss(); window.opener.document.getElementById('btnSave').click(); window.close(); return false; } function GetValues() { // alert('ssss'); var table = document.getElementById('<%=grdsearch.ClientID %>'); var Row = table.rows[SelectedRowIndex + 1]; var CellValue1 = Row.cells[0].innerText; var CellValue2 = Row.cells[1].innerText; // document.getElementById('txtsearch').value = CellValue1; // alert(CellValue1); // alert(CellValue2); // var s = window.opener.document.getElementById('txtBrand').value; alert('s'); window.opener.document.getElementById('btnSearchCriteria').click(); // window.parent.document.getElementById('btnExit').click(); //window.opener.document.getElementById('btnExit').click(); alert('r'); return false; } function SelectSibling(e) { var e = e ? e : window.event; var keyCode = e.which ? e.which : e.keyCode; if (keyCode == 40) SelectRow(SelectedRow.nextSibling, SelectedRowIndex + 1); else if (keyCode == 38) SelectRow(SelectedRow.previousSibling, SelectedRowIndex - 1); if (keyCode == 13) { GetValues(); } return false; } function sss() { alert('sss'); window.opener.sss(); window.opener.document.getElementById('btnSearchCriteria').click(); return false; } </script> <style type="text/css"> .style1 { width: 60px; } .style2 { width: 236px; } .style3 { width: 210px; } </style> </head> <body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <table style="width: 100%;"> <tr> <td class="style1"> </td> <td class="style3"> <asp:TextBox ID="txtsearch" runat="server" Width="196px" AutoPostBack="True" ontextchanged="txtsearch_TextChanged"></asp:TextBox> </td> <td> <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/search.gif" onclick="ImageButton1_Click" /> </td> </tr> <tr> <td class="style1"> </td> <td class="style3" colspan="2"> <asp:GridView ID="grdsearch" runat="server" AutoGenerateColumns="False" onrowcreated="grdsearch_RowCreated" Width="218px"> <Columns> <asp:BoundField DataField="prod_id" HeaderText="Product Id" /> <asp:BoundField DataField="prod_name" HeaderText="Product Name" /> </Columns> <SelectedRowStyle CssClass="grdselectback" /> </asp:GridView> </td> <td> </td> </tr> <tr> <td class="style1"> </td> <td class="style3"> <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /> </td> <td> </td> </tr> </table> </ContentTemplate> </asp:UpdatePanel> </div> </form> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)