<?xml version="1.0" encoding="utf-8" ?>
<c:Screen xmlns:c="BitMobile.Controls" xmlns:s="BitMobile.ValueStack" StyleSheet="Visit_SKUs.css">

	<s:Push Id="outlet" Value="$param1"></s:Push>

	<c:DockLayout>

		<c:DockLayout CssClass="top_navigator">
			<c:DockLayout Id="btnBack" CssClass="btn_back" OnEvent="Back" OnClickAction="$DoBack()">
				<c:Image />
				<c:TextView Text="@back" />
			</c:DockLayout>
			<c:DockLayout Id="btnForward" CssClass="btn_forward" />
			<c:HorizontalLayout>
				<c:TextView Text="#contacts#" />
			</c:HorizontalLayout>
		</c:DockLayout>

		<c:HorizontalLine />

		<s:If Test="$AddEnabled() &amp;&amp; @DateAddTru == false">
			<c:HorizontalLayout Id="btnAdd" CssClass="bottom_btn" OnClickAction="$DoAction(Select, null, null)">
				<c:TextView Text="#add#"></c:TextView>
			</c:HorizontalLayout>
			<c:HorizontalLine CssClass="b_line" />
		</s:If>

		<c:ScrollView Id="grScrollView">

			<s:If Test="$HasContacts($outlet)">

				<s:If Test="@hasOutletContacts">

					<c:HorizontalLayout CssClass="caption_grid">
						<c:TextView Text="#outletContacts#:"></c:TextView>
					</c:HorizontalLayout>
					<c:HorizontalLine />

					<s:Iterator Id="contact" Value="$GetOutletContacts($outlet)" Status="statusCount">
						<s:If Test="@DateAddTru == false">
							<c:SwipeHorizontalLayout CssClass="swipe_layout">
								<c:DockLayout CssClass="parameter_grid" OnClickAction="$DoAction(Select, $contact.Id, $contact.OutletContact)">
									<c:Image />
									<c:TextView Text="$contact.ContactName"></c:TextView>
								</c:DockLayout>
								<s:If Test="@DateAddTru == false">
									<c:HorizontalLayout CssClass="red_swipe" OnClickAction="$DeleteContact($contact.OutletContact)">
										<c:TextView Text="#delete#"></c:TextView>
									</c:HorizontalLayout>
							</s:If>
							</c:SwipeHorizontalLayout>
						</s:If>
						<s:Else>
							<c:DockLayout CssClass="parameter_grid" OnClickAction="$DoAction(Select, $contact.Id, $contact.OutletContact)">
								<c:Image />
								<c:TextView Text="$contact.ContactName"></c:TextView>
							</c:DockLayout>
						</s:Else>
						<c:HorizontalLine />
					</s:Iterator>
				</s:If>


				<s:If Test="@hasPartnerContacts">

					<c:HorizontalLayout CssClass="caption_grid">
						<c:TextView Text="#partnerContacts#:"></c:TextView>
					</c:HorizontalLayout>
					<c:HorizontalLine />

					<s:Iterator Id="contact" Value="$GetPartnerContacts($outlet)" Status="statusCount">
						<c:SwipeHorizontalLayout CssClass="swipe_layout">
							<c:DockLayout CssClass="parameter_grid" OnClickAction="$DoAction(Select, $contact.Id, $contact.PartnerContact)">
								<c:Image />
								<c:TextView Text="$contact.ContactName"></c:TextView>
							</c:DockLayout>
							<s:If Test="$sessionConst.outletContactEditable &amp;&amp; @DateAddTru == false">
								<c:HorizontalLayout CssClass="red_swipe" OnClickAction="$DeleteContact($contact.PartnerContact)">
									<c:TextView Text="#delete#"></c:TextView>
								</c:HorizontalLayout>
							</s:If>
						</c:SwipeHorizontalLayout>
						<c:HorizontalLine />
					</s:Iterator>

				</s:If>

			</s:If>

			<s:Else>
				<c:HorizontalLayout CssClass="margin_top" />
				<c:TextView Text="#no_contacts#" CssClass="no_items" />
			</s:Else>

			<c:HorizontalLayout CssClass="end_of_block" />

		</c:ScrollView>

	</c:DockLayout>

</c:Screen>
