void ReleaseDesignerOutlets()
        {
            if (CalendarView != null)
            {
                CalendarView.Dispose();
                CalendarView = null;
            }

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

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

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

            if (ShowDatesinListView != null)
            {
                ShowDatesinListView.Dispose();
                ShowDatesinListView = null;
            }
        }
Ejemplo n.º 2
0
        public void SetUpFirstDatePicker()
        {
            UIDatePicker datePicker = new UIDatePicker();

            datePicker.Mode = UIDatePickerMode.Date;

            UIToolbar toolbar = new UIToolbar();

            toolbar.BarStyle    = UIBarStyle.Default;
            toolbar.Translucent = true;
            toolbar.SizeToFit();

            UIBarButtonItem doneButton = new UIBarButtonItem("Done", UIBarButtonItemStyle.Done, (s, e) =>
            {
                var selectedDate     = NSDateToDateTime(datePicker.Date);
                DatePickerStart.Text = selectedDate.ToString("dd MMMMM yyyy dddd");
                monthView.ChangeDate(selectedDate);
                DatePickerStart.ResignFirstResponder();
                startDate = selectedDate;
            });

            toolbar.SetItems(new UIBarButtonItem[] { new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace), doneButton }, true);

            this.DatePickerStart.InputView = datePicker;

            this.DatePickerStart.InputAccessoryView = toolbar;
        }
Ejemplo n.º 3
0
        protected void bSave_Click(object sender, ImageClickEventArgs e)
        {
            lock (Database.lockObjectDB)
            {
                ArrayList al = new ArrayList();

                string s = "";

                if (DatePickerStart.DatePickerText != "")
                {
                    try
                    {
                        Convert.ToDateTime(DatePickerStart.DatePickerText);
                    }
                    catch
                    {
                        lbInform.Text = "Неправильно введена дата документа с";
                        DatePickerStart.Focus();
                        return;
                    }
                }
                if (DatePickerEnd.DatePickerText != "")
                {
                    try
                    {
                        Convert.ToDateTime(DatePickerEnd.DatePickerText);
                    }
                    catch
                    {
                        lbInform.Text = "Неправильно введена дата документа по";
                        DatePickerEnd.Focus();
                        return;
                    }
                }

                if (DatePickerStart.DatePickerText != "")
                {
                    al.Add(String.Format("(date_doc>=[{0:" + ConfigurationSettings.AppSettings["DateFormat"] + "}])", DatePickerStart.SelectedDate));
                }
                if (DatePickerEnd.DatePickerText != "")
                {
                    al.Add(String.Format("(date_doc<=[{0:" + ConfigurationSettings.AppSettings["DateFormat"] + "}])", DatePickerEnd.SelectedDate));
                }

                string id_type = dListType.SelectedItem.Value;
                if (id_type != "-1")
                {
                    al.Add(String.Format("(type={0})", id_type));
                }

                id_type = dListBranch.SelectedItem.Value;
                if (id_type != "-1")
                {
                    al.Add($"(id_branch={id_type})");
                }

                if (tbProd.Text != "")
                {
                    al.Add(String.Format("(id in (select id_doc from V_Products_StorageDocs where prod_name like [%{0}%]))", tbProd.Text));
                }

                if (tbCard.Text != "")
                {
                    if (tbCard.Text.Trim().Length >= 16)
                    {
                        al.Add(
                            $"(id in (select id_doc from V_Cards_StorageDocs where panhash like [{FuncClass.GetHashPan(tbCard.Text.Trim())}]))");
                    }
                    else
                    {
                        al.Add($"(id in (select id_doc from V_Cards_StorageDocs where pan like [%{tbCard.Text.Trim()}%]))");
                    }
                }

                if (tbCreate.Text != "")
                {
                    al.Add(String.Format("(loweredusername like [%{0}%])", tbCreate.Text.Trim()));
                }

                if (chAll.Checked)
                {
                    al.Add(String.Format("(priz_gen=1 or priz_gen=0)", tbCard.Text));
                }
                else
                {
                    al.Add(String.Format("(priz_gen=0)", tbCard.Text));
                }

                if (al.Count > 0)
                {
                    string[] all = Array.CreateInstance(typeof(string), al.Count) as string[];
                    al.CopyTo(all, 0);
                    s = "where " + String.Join(" and ", all);
                }

                Response.Write("<script language=javascript>window.returnValue='" + s + "'; window.close();</script>");
            }
        }