Beispiel #1
0
        public LoanTo(ThumbItem thumbitem)
        {
            InitializeComponent();

            if (thumbitem == null)
            {
                return;
            }

            _strId         = thumbitem.Id;
            _selectedItems = thumbitem.EType;

            cboAlias.ItemsSource       = FriendServices.Gets();
            cboAlias.DisplayMemberPath = "Alias";
            imgTitle.Source            = Util.CreateSmallImage(thumbitem.Cover);
            lblTitle.Text = thumbitem.Name;

            Loan objLoan = LoanServices.Get(_strId);

            if (objLoan != null)
            {
                txtEndDate.Text = objLoan.EndDate.ToShortDateString();

                //Fix since 2.7.12.0
                if (objLoan.Friend != null)
                {
                    cboAlias.Text = objLoan.Friend.Alias;
                }

                txtStartDate.Text = objLoan.StartDate.ToShortDateString();
            }
            else
            {
                txtStartDate.Text = DateTime.Now.ToShortDateString();
                txtEndDate.Text   = DateTime.Now.AddDays(10).ToShortDateString();
            }
        }
 private void Bind()
 {
     lstUsers.ItemsSource = FriendServices.Gets();
 }