<%@ Page Language="C#" MasterPageFile="~/MasterPages/Main.master" AutoEventWireup="true"
    CodeFile="sysparams.aspx.cs" Inherits="sysparams"  %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<script language="javascript" type="text/javascript">
    function KeyPressFuncNumberOnly() {
        if (event.keyCode > 31 && (event.keyCode < 48 || event.keyCode > 57)) {
            return false;
        }
        return true;
    }
function validate()
{
    var message = "";
    if (document.getElementById("<%=txtName.ClientID%>").value=="")
    {
        message += "Group Name Feild can not be blank\n";
        document.getElementById("<%=txtName.ClientID%>").style.backgroundColor = "#c8d1e4";
    }
        
    
    if(message.length >0)
    {
        message = "please notice the following requirments:\n\n" + message;
        alert(message);
        return false;
    }
      return true;
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
                   <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                <ContentTemplate>
                                  
    <table class="body_MainTB" border="0" cellpadding="0" cellspacing="0">
        <tr align="center">
            <td valign="top">
                <!------------------------------------body St  ---------------------------------------------->
                <table border="0" cellpadding="0" cellspacing="0" class="body_formTitle">
                    <tr>
                        <td>
                            System Parameters
                        </td>
                    </tr>
                </table>
                <br>
                <!------------------------------------body End1 ----------------------------------------------->
                <table border="0" cellpadding="0" cellspacing="0" class="contTB">
                    <tr>
                        <td align="center">
                            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="Frow">
                                <tr>
                                    <td>
                                    </td>
                                </tr>
                            </table>
                            <br />
                            <asp:Panel ID="pnlGrid" runat="server" Width="100%">
                             <asp:Label ID="lblError" runat="server" Text="" class="fieldError"></asp:Label>
                                <table border="0" cellpadding="0" cellspacing="0" class="grid_TitleBG_B">
                                    <tr>
                                        <td>
                                            System Parameters
                                        </td>
                                    </tr>
                                </table>
                 
                   <asp:UpdateProgress ID="UpdateProgress1" runat="server" 
                                        AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="0">
                                        <ProgressTemplate>
                                        <img alt="Loading" src="../Images/ajax-loader.gif" />
                                        </ProgressTemplate>
                                    </asp:UpdateProgress>
                                <asp:GridView ID="GridView1" CssClass="gridMaster" Width ="100%"  
                                    runat="server" AutoGenerateColumns="False"
                                    OnRowCommand="GridView1_RowCommand" AllowSorting="True" CellPadding="4" ForeColor="#333333" 
                                    GridLines="None" OnRowCreated="GridView1_RowCreated" DataKeyNames="sys_parmtr_id"
                                     AllowPaging="true" onpageindexchanging="GridView1_PageIndexChanging" onrowdatabound="GridView1_RowDataBound" 
                                     >
                                    
                                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                    
                                    <Columns>
                                        <asp:BoundField DataField="sys_parmtr_name" ItemStyle-Width="20%" HeaderText="Name"/>
                                        <asp:BoundField DataField="sys_parmtr_value" HeaderText="Value" />
                                        <asp:BoundField DataField="app_status" HeaderText="app_status"/>
                                        <asp:BoundField DataField="status" HeaderText="Status"/>
                                        <asp:ButtonField ButtonType="Image" ItemStyle-Width="30px" CommandName="vm" Text="View Modification" ImageUrl="~/Images/view.jpg" />
                                        <asp:ButtonField ButtonType="Image" ItemStyle-Width="30px" CommandName="u" Text="Update" ImageUrl="~/Images/edit.jpg" />
                                        <asp:ButtonField ButtonType="Image" ItemStyle-Width="30px" CommandName="d" Text="Delete" ImageUrl="~/Images/delete.jpg" />
                                        <asp:BoundField DataField="SYS_PARMRT_VALUE_TYPE" HeaderText="" />
                                        <asp:BoundField DataField="SYS_PARMTR_VALUE_LKP" HeaderText="" />
                                        <asp:ButtonField ButtonType="Image" ItemStyle-Width="20px" CommandName="p" Text="Edit Value" ImageUrl="~/Images/edit1.jpg" />
                                    </Columns>
                                    
                                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="Black" />
                                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                </asp:GridView>
                            </asp:Panel>
                                <table border="0" cellpadding="0" cellspacing="0" class="action_TB_BgForm">
                                    <tr>
                                        <td>
                                            <asp:Button ID="btnAdd" runat="server" Text="     Add     " OnClick="btnAdd_Click"
                                                class="Btn_M_Normal" />
                                    </tr>
                                </table>
                            <br />
                            <!------------------------------------body End1 ----------------------------------------------->
                            <asp:Panel ID="pnlControls" runat="server" Width="100%">
                                <fieldset id="addItem">
                                    <legend id="addItem">Parameter Details</legend>
                                </fieldset>
                                <table border="0" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                    <tr>
                                        <td class="tdNormal" style="width:15%">
                                            Name
                                        </td>
                                        <td class="tdNormal" style="width:30%">
                                            <asp:TextBox ID="txtName" runat="server" Width="100%" class="fieldNormal" MaxLength="100"></asp:TextBox>
                                        </td>
                                        <td class="tdNormal" style="width:10%">
                                            &nbsp;
                                        </td>
                                        <td class="tdNormal" style="width:15%">
                                            Value Type
                                        </td>
                                        <td class="tdNormal" style="width:30%">
                                            <asp:DropDownList ID="ddlRecordType" runat="server" Width="250px" class="fieldNormal" >
                                                <asp:ListItem Value="0">TextBox</asp:ListItem>
                                                <asp:ListItem Value="1">CheckBox</asp:ListItem>
                                                <asp:ListItem Value="2">List</asp:ListItem>                                                           
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    
                                    <tr>
                                        <td>
                                            Value Lookup
                                        </td>
                                        <td colspan="4">
                                            <asp:TextBox ID="txtDesc" runat="server" Width="100%" Rows="4" class="fieldMultiLine" MaxLength="100"
                                                TextMode="MultiLine"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            &nbsp;
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>
                                    </tr>
                                </table>
                                <table border="0" cellpadding="0" cellspacing="0" class="action_TB_BgaddItem">
                                    <tr>
                                        <td>
                                            <asp:Button ID="btnCancel" runat="server" Text="   Cancel   " OnClick="btnCancel_Click"
                                                class="Btn_M_Normal" CausesValidation="False" />
                                            <asp:Button ID="btnSave" OnClientClick="return validate()" runat="server" Text="   Save   "
                                                OnClick="btnSave_Click" class="Btn_M_Normal" />
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <asp:Panel ID="pnlCOntrols2" runat="server" Width="100%">
                                <fieldset id="addItem">
                                    <legend id="addItem">Parameter Value</legend>
                                </fieldset>
                                <table border="0" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                    <tr>
                                        <td class="tdNormal" style="width:15%">
                                            Value
                                        </td>
                                        <td class="tdNormal" style="width:30%">
                                            <asp:TextBox ID="txtValue" runat="server" Width="100%" class="fieldNormal" MaxLength="100"></asp:TextBox>
                                            <asp:DropDownList ID="ddlValue" runat="server" Width="250px" class="fieldNormal" >
                                            </asp:DropDownList>
                                            <asp:CheckBox ID="chkBox" runat="server" class="fieldNormal" />
                                        </td>
                                        <td class="tdNormal" style="width:10%">
                                        </td>
                                        <td class="tdNormal" style="width:15%">
                                        </td>
                                        <td class="tdNormal" style="width:30%">
                                            
                                        </td>
                                    </tr>
                                </table>
                                <table border="0" cellpadding="0" cellspacing="0" class="action_TB_BgaddItem">
                                    <tr>
                                        <td>
                                            <asp:Button ID="btnCancelValue" runat="server" Text="   Cancel   " OnClick="btnCancelValue_Click"
                                                class="Btn_M_Normal" CausesValidation="False" />
                                            <asp:Button ID="btnSaveValue" runat="server" Text="   Save   "
                                                OnClick="btnSaveValue_Click" class="Btn_M_Normal" />
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <!------------------------------------body End2 ----------------------------------------------->
                            <br>
                        </td>
                    </tr>
                </table>
                <!------------------------------------body End2 ----------------------------------------------->
            </td>
        </tr>
    </table>

    </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
