<%@ Page Title="Suppliers" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="Suppliers.aspx.cs" Inherits="ZFJINV.Definitions.Suppliers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

	<div class="row">

		<div class="col-md-12 mySpace">

			<div class="caption">
				<!-- <i class="icon-settings font-red"></i> -->
				<span class="caption-subject font-blue sbold" style="font-size: 150%;">Suppliers</span>				
			</div>
			<asp:UpdatePanel runat="server">
				<ContentTemplate>

					<div class="portlet-body">

						<div class="tabbable-line">
							<ul class="nav nav-tabs ">
								<li class="active">
									<a href="#tab_addSupplier" data-toggle="tab"
										style="font-size: 13px; color: #2E4053; font-weight: 700;">Add Supplier </a>
								</li>
								<li>
									<a href="#tab_supplierList" data-toggle="tab"
										style="font-size: 13px; color: #2E4053; font-weight: 700;">Supplier List </a>
								</li>

							</ul>
							<div class="tab-content">
								<div class="tab-pane active" id="tab_addSupplier">
									<div class="ui segment" style="min-height:260px;">
										<div class="ui stackable form">

											<div class="col-md-3">
												<label class="lbStyle">Supplier ID:</label>
												<asp:TextBox ID="txtSupplierID" runat="server" title="Supplier ID" CssClass="myInput" required="required"></asp:TextBox>
											</div>
											<div class="col-md-3">
												<label class="lbStyle">Supplier Name:</label>
												<asp:TextBox ID="txtSupplierName" runat="server" title="Supplier Name" CssClass="myInput" required="required"></asp:TextBox>
											</div>
											<div class="col-md-3">
												<label class="lbStyle">Description:</label>
												<asp:TextBox ID="txtDescription" runat="server" title="Description" CssClass="myInput" required="required"></asp:TextBox>
											</div>
											<div class="col-md-3">
												<label class="lbStyle">Reg. No:</label>
												<asp:TextBox ID="txtRegisterationNo" runat="server" title="Registeration Number" CssClass="myInput" required="required"></asp:TextBox>
											</div>
											<div class="col-md-3">
												<label class="lbStyle">Contact Person:</label>
												<asp:TextBox ID="txtContactPerson" runat="server" title="Contact Person" CssClass="myInput" required="required"></asp:TextBox>
											</div>
											<div class="col-md-3">
												<label class="lbStyle">Type:</label>
												<asp:TextBox ID="txtSupplierType" runat="server" title="Supplier Type" CssClass="myInput" required="required"></asp:TextBox>
											</div>
											<div class="col-md-3">
												<label class="lbStyle">Contact No.:</label>
												<asp:TextBox ID="txtContactNo" runat="server" title="Contact Number" TextMode="Number" CssClass="myInput" required="required"></asp:TextBox>
											</div>
											<div class="col-md-3">
												<label class="lbStyle">Supplier Account:</label>
												<asp:TextBox ID="txtSupplierAccount" runat="server" TextMode="Number" title="Supplier Bank Account Number" CssClass="myInput" required="required"></asp:TextBox>
											</div>
											<div class="col-md-3">
												<label class="lbStyle">Supplier Bank:</label>
												<asp:TextBox ID="txtSupplierBank" runat="server" title="Supplier Bank" CssClass="myInput" required="required"></asp:TextBox>

											</div>
											<div class="col-md-3">
												<label class="lbStyle">Contract Date:</label>
												<asp:TextBox ID="txtContractDate" runat="server" class="mydatepickerclass myInput" title="Contract Date" required="required">
							
												</asp:TextBox>

											</div>
											<div class="col-md-3">
												<label class="lbStyle">Contract Expiry:</label>
												<asp:TextBox ID="txtContractExpiry" runat="server" class="mydatepickerclass myInput" title="Contract Expiry"  required="required"></asp:TextBox>

											</div>
											<div class="col-md-3">
												<label class="lbStyle">Payment Mode:</label>
												<asp:TextBox ID="txtPaymentMode" runat="server" title="Payment Mode" CssClass="myInput" required="required"></asp:TextBox>

											</div>

											<asp:UpdatePanel UpdatePanelID="countrypanel" runat="server">
												<ContentTemplate>


													<div class="col-md-3">
														<label class="lbStyle">Country:</label>
														<asp:DropDownList ID="ddlcountry" runat="server" class="select2 form-control " required="required" AutoPostBack="true" 
                                                            AppendDataBoundItems="true" OnSelectedIndexChanged="ddlcountry_SelectedIndexChanged" onchange="showLoader('City')">
														</asp:DropDownList>

													</div>
												</ContentTemplate>

												<Triggers>
													<asp:AsyncPostBackTrigger ControlID="ddlcountry" />

												</Triggers>
											</asp:UpdatePanel>
											<br />

											<asp:UpdatePanel UpdatePanelID="citypanel" runat="server">
												<ContentTemplate>
													<div class="col-md-3">
														<label class="lbStyle">City:</label>
														<asp:DropDownList ID="ddlcity" runat="server" AutoPostBack="true" AppendDataBoundItems="true" class="select2 form-control "  required="required">
														</asp:DropDownList>
                                                         <img src="../assets/global/img/default.gif" style="display: none" id="loaderCity"  />
													</div>
                                                    
												</ContentTemplate>

												<Triggers>
													<asp:AsyncPostBackTrigger ControlID="ddlcity" />

												</Triggers>
                                                
											</asp:UpdatePanel>
                                           
											<div class="col-md-3">
												<label class="lbStyle">Address:</label>
												<asp:TextBox ID="txtAddress" runat="server" title="Address" CssClass="myInput"></asp:TextBox>

											</div>
                                            <div class="col-md-3">
												<label class="lbStyle"></label>												
											</div>
											 <div class="newButton">
                                                 <img src="../assets/global/img/ripples.gif" style="display: none; padding:0" id="loaderButton" />

												<asp:Button ID="btnAdd" runat="server" OnClick="btnAdd_OnClick" CssClass="btn green-meadow" Text="Save" onclientclick="showLoader('Button')" />
												
                                                 <asp:Button ID="btnCancel" runat="server" formnovalidate="formnovalidate" CssClass="btn red-mint " Text="Cancel" OnClick="btnCancel_OnClick" />
											</div>
                                                 
											

											<div class="row">
											</div>

										</div>
									</div>
                                     <div class="col-md-8 ">
                                                <div class="messagealert" id="alert_container">
                                                </div>
                                            </div>
								</div>



								<div class="tab-pane" id="tab_supplierList">
                                     <asp:TextBox ID="search_textbox" CssClass="myInput" runat="server" Font-Size="18px" onkeyup="Search_Gridview(this, 'gvTest')"></asp:TextBox><br />
									<div class="rounded-corners">
										<div style="width: 100%; overflow: auto;">

											<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
												GridLines="Horizontal" BorderColor="WhiteSmoke" AlternatingRowStyle-BackColor="#F2F3F4" RowStyle-Wrap="false"
												HeaderStyle-Wrap="false" RowStyle-BorderColor="#e8e8ec"
												
												CssClass="gridviewdesign table-responsive" RowStyle-CssClass="GV"
												OnSelectedIndexChanged="GridView1_OnSelectedIndexChanged"
												OnRowCommand="GridView1_OnRowCommand"
                                                PageSize="20"
												OnRowDeleting="GridView1_OnRowDeleting"
												OnPageIndexChanging="GridView1_OnPageIndexChanging"
												EmptyDataText="No suppliers to display">
												<Columns>
													<asp:CommandField
														 HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody"
														ButtonType="Image"
														HeaderText="Actions"
														SelectImageUrl="~/assets/global/img/edit.png"
													
														ShowHeader="True"
														ShowSelectButton="True" />
													<asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
													<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
													<asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
													<asp:BoundField DataField="Country" HeaderText="Country" SortExpression="Country" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
													<asp:BoundField DataField="City" HeaderText="City" SortExpression="City" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
													<asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
													<asp:BoundField DataField="Reg. No" HeaderText="Reg. No" SortExpression="Reg. No" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
													<asp:BoundField DataField="Contact Person" HeaderText="Contact Person" SortExpression="Contact Person" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
													<asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
													<asp:BoundField DataField="Contact No." HeaderText="Contact No." SortExpression="Contact No." HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
													<asp:BoundField DataField="Account No." HeaderText="Account No." SortExpression="Account No." HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
													<asp:BoundField DataField="Bank" HeaderText="Bank" SortExpression="Bank" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
													<asp:BoundField DataField="Contract Date" HeaderText="Contract Date" SortExpression="Contract Date" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
													<asp:BoundField DataField="Contract Expiry" HeaderText="Contract Expiry" SortExpression="Contract Expiry" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
													<asp:BoundField DataField="Payment Mode" HeaderText="Payment Mode" SortExpression="Payment Mode" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />

												</Columns>
												<PagerStyle CssClass="pagination-ys" />
											</asp:GridView>
										</div>

									</div>

									<br />



								</div>



							</div>

						</div>

					</div>
				</ContentTemplate>
				<Triggers>
					<asp:AsyncPostBackTrigger ControlID="GridView1" />
				</Triggers>
			</asp:UpdatePanel>
		</div>

	</div>


      <script type="text/javascript">
          function Search_Gridview(strKey, strGV) {
              var strGV = '<%= GridView1.ClientID %>';
             var strData = strKey.value.toLowerCase().split(" ");
             var tblData = document.getElementById(strGV);
             var rowData;
             for (var i = 1; i < tblData.rows.length; i++) {
                 rowData = tblData.rows[i].innerHTML;
                 var styleDisplay = 'me';
                 for (var j = 0; j < strData.length; j++) {
                     if (rowData.toLowerCase().indexOf(strData[j].toLowerCase()) != -1)
                         styleDisplay = '';
                     else {
                         styleDisplay = 'none';
                         break;
                     }
                 }
                 tblData.rows[i].style.display = styleDisplay;
             }
         }
</script>


</asp:Content>
