Ejemplo n.º 1
0
        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;
        }
 private void BindList()
 {
     try
     {
         list = PardakhtBussines.GetAll();
         if (CurrentUser.User.Type != EnUserType.Manager)
         {
             list = list.Where(q => q.UserGuid == CurrentUser.User.Guid).ToList();
         }
         lstPardakht.Adapter = new PardakhtAdapter(this, list.OrderByDescending(q => q.CreateDate).ToList());
     }
     catch (Exception ex)
     {
         WebErrorLog.ErrorInstence.StartErrorLog(ex);
     }
 }