protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.PardakhtMainLayout); myToolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.PardakhtMainToolbar); SetSupportActionBar(myToolbar); FindElements(); SetCmbData(); SetFonts(); var names = CustomerBussines.GetAll().Select(q => q.Name).ToList(); ArrayAdapter adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerItem, names); txtPardakhtMainCustomerName.Adapter = adapter; var names_ = PardakhtBussines.GetAll().Select(q => q.BankName).ToList(); ArrayAdapter adapter_ = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerItem, names_); txtPardakhtMainBankName.Adapter = adapter_; cls = new PardakhtBussines(); txtPardakhtMainYear.Text = Calendar.GetYearOfDateSh(cls.DateSh).ToString(); txtPardakhtMainMounth.Text = Calendar.GetMonthOfDateSh(cls.DateSh).ToString(); txtPardakhtMainDay.Text = Calendar.GetDayOfDateSh(cls.DateSh).ToString(); lblPardakhtMainDateSh.Text = cls.DateSh; cmbSandouq.ItemSelected += CmbSandouq_ItemSelected; cmbBank.ItemSelected += CmbBank_ItemSelected; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.OrderMainLayout); FindElements(); SetSupportActionBar(myToolbar); BindList(); SetFonts(); order = new OrderBussines(); lblOrderCode.Text = OrderBussines.NextCode(); lblDateSh.Text = order?.DateSh; txtOrderMainLearningCount.Text = "1"; txtOrderMainDiscount.Text = order?.DetList?.Sum(q => q.Discount).ToString("N0"); SetLables(); var names = CustomerBussines.GetAll().Select(q => q.Name).ToList(); ArrayAdapter adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerItem, names); txtOrderMainCustomerName.Adapter = adapter; OrderBussines.OnDetailsChanged += OrderBussines_OnDetailsChanged; txtOrderMainDiscount.TextChanged += TxtOrderMainDiscount_TextChanged; }
private void BindList() { try { list = CustomerBussines.GetAll(); lstCustomers.Adapter = new CustomerAccountAdapter(this, list.OrderBy(q => q.Name).ToList()); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }
private void BindList() { try { list = CustomerBussines.GetAll(); if (CurrentUser.User.Type != EnUserType.Manager) { list = list.Where(q => q.UserGuid == CurrentUser.User.Guid).ToList(); } lstCustomers.Adapter = new CustomerAdapter(this, list.OrderBy(q => q.Name).ToList()); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }