Exemple #1
0
        public void SetPeriod()
        {
            var checkPeriod = NSUserDefaults.StandardUserDefaults.StringForKey("OrderPeriod");
            var fInitDate   = DateTime.Now;
            var fEndDate    = DateTime.Now;

            if (checkPeriod != null)
            {
                var strInit = NSUserDefaults.StandardUserDefaults.StringForKey("InitDate");
                var strEnd  = NSUserDefaults.StandardUserDefaults.StringForKey("EndDate");

                if (strInit != "")
                {
                    fInitDate = DateTime.Parse(NSUserDefaults.StandardUserDefaults.StringForKey("InitDate"));
                }

                if (strEnd != "")
                {
                    fEndDate = DateTime.Parse(NSUserDefaults.StandardUserDefaults.StringForKey("EndDate"));
                }

                DateOneButton.SetTitle(fInitDate.ToString("dd/MM/yyyy"), UIControlState.Normal);
                DateTwoButton.SetTitle(fEndDate.ToString("dd/MM/yyyy"), UIControlState.Normal);
            }
        }
Exemple #2
0
        public void DateChangedOne(UIDatePicker picker)
        {
            NSDateFormatter dateFormat = new NSDateFormatter();

            dateFormat.Locale     = new NSLocale("es_MX");
            dateFormat.DateFormat = "dd/MM/yyyy";
            DateOneButton.SetTitle(dateFormat.ToString(picker.Date), UIControlState.Normal);

            dateFormat.DateFormat = "yyyy/MM/dd";
            NSUserDefaults.StandardUserDefaults.SetString(dateFormat.ToString(picker.Date), "InitDate");
        }
        void ReleaseDesignerOutlets()
        {
            if (DateOneButton != null)
            {
                DateOneButton.Dispose();
                DateOneButton = null;
            }

            if (DateTwoButton != null)
            {
                DateTwoButton.Dispose();
                DateTwoButton = null;
            }

            if (lblPeriodo != null)
            {
                lblPeriodo.Dispose();
                lblPeriodo = null;
            }

            if (PeriodHeigthCL != null)
            {
                PeriodHeigthCL.Dispose();
                PeriodHeigthCL = null;
            }

            if (PeriodTebleView != null)
            {
                PeriodTebleView.Dispose();
                PeriodTebleView = null;
            }

            if (PeriodView != null)
            {
                PeriodView.Dispose();
                PeriodView = null;
            }

            if (TypeHeightCL != null)
            {
                TypeHeightCL.Dispose();
                TypeHeightCL = null;
            }

            if (TypeTableView != null)
            {
                TypeTableView.Dispose();
                TypeTableView = null;
            }
        }
Exemple #4
0
        private void DrawingViews()
        {
            datePickerOne.Mode        = UIDatePickerMode.Date;
            datePickerOne.MaximumDate = new NSDate();
            NSDateFormatter dateFormat = new NSDateFormatter();

            dateFormat.Locale     = new NSLocale("es_MX");
            dateFormat.DateFormat = "dd/MM/yyyy";
            DateOneButton.SetTitle(dateFormat.ToString(datePickerOne.Date), UIControlState.Normal);
            datePickerOne.AddTarget(this, new Selector("DateChangedOne:"), UIControlEvent.ValueChanged);

            datePickerTwo.Mode        = UIDatePickerMode.Date;
            datePickerTwo.MaximumDate = new NSDate();
            DateTwoButton.SetTitle(dateFormat.ToString(datePickerOne.Date), UIControlState.Normal);
            datePickerTwo.AddTarget(this, new Selector("DateChangedTwo:"), UIControlEvent.ValueChanged);

            //dateFormat.DateFormat = "yyyy/MM/dd";
            //NSUserDefaults.StandardUserDefaults.SetString(dateFormat.ToString(datePickerOne.Date), "InitDate");
            //NSUserDefaults.StandardUserDefaults.SetString(dateFormat.ToString(datePickerOne.Date), "EndDate");
        }