Пример #1
0
        public SettingsForm_PrintersAddEdit(PrinterSettingModel Printer, SettingsForm_Printers SettingsForm_Printers)
        {
            InitializeComponent();

            TitleLabel = new MyEntry()
            {
                LeftRounded             = true,
                RightRounded            = true,
                Placeholder             = "عنوان چاپگر",
                Padding                 = new Thickness(40, 10),
                FontSize                = 18,
                VerticalOptions         = LayoutOptions.FillAndExpand,
                HorizontalOptions       = LayoutOptions.FillAndExpand,
                HorizontalTextAlignment = TextAlignment.End
            };
            GridLayout.Children.Add(TitleLabel, 0, 0);
            Grid.SetColumnSpan(TitleLabel, 2);

            BluetoothPrinterPicker = new Picker()
            {
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.FillAndExpand
            };
            GridLayout.Children.Add(BluetoothPrinterPicker, 0, 1);

            BluetoothPrinterLabel = new RightRoundedLabel()
            {
                VerticalOptions         = LayoutOptions.FillAndExpand,
                HorizontalOptions       = LayoutOptions.FillAndExpand,
                HorizontalTextAlignment = TextAlignment.End,
                Text     = "چاپگر بلوتوث",
                Padding  = new Thickness(40, 10),
                FontSize = 18
            };
            GridLayout.Children.Add(BluetoothPrinterLabel, 1, 1);

            BluetoothPrinterChangeButton = new LeftEntryCompanionLabel()
            {
                VerticalOptions         = LayoutOptions.FillAndExpand,
                HorizontalOptions       = LayoutOptions.FillAndExpand,
                HorizontalTextAlignment = TextAlignment.Center,
                FontSize = 18,
                Text     = "..."
            };
            GridLayout.Children.Add(BluetoothPrinterChangeButton, 0, 1);

            WidthLabel = new MyEntry()
            {
                VerticalOptions         = LayoutOptions.FillAndExpand,
                HorizontalOptions       = LayoutOptions.FillAndExpand,
                HorizontalTextAlignment = TextAlignment.End,
                LeftRounded             = true,
                RightRounded            = true,
                Placeholder             = "پهنای قابل چاپ(mm)",
                Padding  = new Thickness(40, 10),
                FontSize = 18
            };
            GridLayout.Children.Add(WidthLabel, 0, 2);
            Grid.SetColumnSpan(WidthLabel, 2);

            DensityLabel = new MyEntry()
            {
                VerticalOptions         = LayoutOptions.FillAndExpand,
                HorizontalOptions       = LayoutOptions.FillAndExpand,
                HorizontalTextAlignment = TextAlignment.End,
                LeftRounded             = true,
                RightRounded            = true,
                Placeholder             = "تراکم نقاط(dpi)",
                Padding  = new Thickness(40, 10),
                FontSize = 18
            };
            GridLayout.Children.Add(DensityLabel, 0, 3);
            Grid.SetColumnSpan(DensityLabel, 2);

            FontSizeLabel = new MyEntry()
            {
                VerticalOptions         = LayoutOptions.FillAndExpand,
                HorizontalOptions       = LayoutOptions.FillAndExpand,
                HorizontalTextAlignment = TextAlignment.End,
                LeftRounded             = true,
                RightRounded            = true,
                Placeholder             = "سایز فونت",
                Padding  = new Thickness(40, 10),
                FontSize = 18
            };
            GridLayout.Children.Add(FontSizeLabel, 0, 4);
            Grid.SetColumnSpan(FontSizeLabel, 2);

            this.SettingsForm_Printers = SettingsForm_Printers;

            ToolbarItem_OK            = new ToolbarItem();
            ToolbarItem_OK.Text       = "تایید";
            ToolbarItem_OK.Icon       = "Save.png";
            ToolbarItem_OK.Order      = ToolbarItemOrder.Primary;
            ToolbarItem_OK.Priority   = 1;
            ToolbarItem_OK.Activated += ToolbarItem_OK_Activated;
            ToolbarItems.Add(ToolbarItem_OK);

            EditingPrinter = Printer;

            BluetoothPrinterPicker.SelectedIndexChanged += (sender, e) =>
            {
                var SelectedDevice = (BluetoothDeviceModel)BluetoothPrinterPicker.SelectedItem;
                MacID = SelectedDevice.MACID;
                BluetoothPrinterLabel.Text = SelectedDevice.Name;
            };

            SetEditingPrinter();
        }
Пример #2
0
        public PartnerChange(Partner Partner, PartnerListForm PartnerListForm, InsertedInformations_Partners InsertedInformations_Partners, bool JustShow)
        {
            InitializeComponent();

            this.PartnerListForm = PartnerListForm;
            this.InsertedInformations_Partners = InsertedInformations_Partners;
            this.JustShow = JustShow;
            this.Padding  = new Thickness(5, 10);

            EditingPartner = Partner;

            //این 2 گروه در گروه مشتری ها نمی آیند
            //مشتریان بدون گروه
            //پرسنل شرکت
            PartnerGroups       = App.DB.GetPartnerGroups().Where(a => a.Id != new Guid("00000000-0000-0000-0000-FFFFFFFFFFFF") && a.Id != new Guid("00000000-0000-0000-0000-EEEEEEEEEEEE")).ToArray();
            PartnerGroupSwitchs = new KeyValuePair <Label, Switch> [PartnerGroups.Length];
            for (int i = 0; i < PartnerGroups.Length; i++)
            {
                PartnerGroupSwitchs[i] = new KeyValuePair <Label, Switch>(new Label()
                {
                    Text = PartnerGroups[i].Name, HorizontalOptions = LayoutOptions.EndAndExpand
                }, new Switch()
                {
                    HorizontalOptions = LayoutOptions.End
                });
            }

            City_Label = new Label()
            {
                Text = "شهر:  ", LineBreakMode = LineBreakMode.NoWrap, HorizontalTextAlignment = TextAlignment.End, VerticalTextAlignment = TextAlignment.Center, HorizontalOptions = LayoutOptions.FillAndExpand
            };
            Zone_Label = new Label()
            {
                Text = "منطقه:  ", LineBreakMode = LineBreakMode.NoWrap, HorizontalTextAlignment = TextAlignment.End, VerticalTextAlignment = TextAlignment.Center, HorizontalOptions = LayoutOptions.FillAndExpand
            };
            Route_Label = new Label()
            {
                Text = "مسیر:  ", LineBreakMode = LineBreakMode.NoWrap, HorizontalTextAlignment = TextAlignment.End, VerticalTextAlignment = TextAlignment.Center, HorizontalOptions = LayoutOptions.FillAndExpand
            };
            FirstName_Label = new Label()
            {
                Text = "نام:  ", LineBreakMode = LineBreakMode.NoWrap, HorizontalTextAlignment = TextAlignment.End, VerticalTextAlignment = TextAlignment.Center, HorizontalOptions = LayoutOptions.FillAndExpand
            };
            LastName_Label = new Label()
            {
                Text = "نام خانوادگی:  ", LineBreakMode = LineBreakMode.NoWrap, HorizontalTextAlignment = TextAlignment.End, VerticalTextAlignment = TextAlignment.Center, HorizontalOptions = LayoutOptions.FillAndExpand
            };
            LegalName_Label = new Label()
            {
                Text = "نام حقوقی:  ", LineBreakMode = LineBreakMode.NoWrap, HorizontalTextAlignment = TextAlignment.End, VerticalTextAlignment = TextAlignment.Center, HorizontalOptions = LayoutOptions.FillAndExpand
            };
            Phone1_Label = new Label()
            {
                Text = "تلفن 1:  ", LineBreakMode = LineBreakMode.NoWrap, HorizontalTextAlignment = TextAlignment.End, VerticalTextAlignment = TextAlignment.Center, HorizontalOptions = LayoutOptions.FillAndExpand
            };
            Phone2_Label = new Label()
            {
                Text = "تلفن 2:  ", LineBreakMode = LineBreakMode.NoWrap, HorizontalTextAlignment = TextAlignment.End, VerticalTextAlignment = TextAlignment.Center, HorizontalOptions = LayoutOptions.FillAndExpand
            };
            Cell_Label = new Label()
            {
                Text = "تلفن همراه:  ", LineBreakMode = LineBreakMode.NoWrap, HorizontalTextAlignment = TextAlignment.End, VerticalTextAlignment = TextAlignment.Center, HorizontalOptions = LayoutOptions.FillAndExpand
            };
            Fax_Label = new Label()
            {
                Text = "فکس:  ", LineBreakMode = LineBreakMode.NoWrap, HorizontalTextAlignment = TextAlignment.End, VerticalTextAlignment = TextAlignment.Center, HorizontalOptions = LayoutOptions.FillAndExpand
            };
            Address_Label = new Label()
            {
                Text = "آدرس:  ", LineBreakMode = LineBreakMode.NoWrap, HorizontalTextAlignment = TextAlignment.End, VerticalTextAlignment = TextAlignment.Center, HorizontalOptions = LayoutOptions.FillAndExpand
            };
            Credit_Label = new Label()
            {
                Text = "اعتبار:  ", LineBreakMode = LineBreakMode.NoWrap, HorizontalTextAlignment = TextAlignment.End, VerticalTextAlignment = TextAlignment.Center, HorizontalOptions = LayoutOptions.FillAndExpand
            };
            IsPartnerLegal_Label = new Label()
            {
                Text = "مشتری حقوقی است.", LineBreakMode = LineBreakMode.NoWrap, HorizontalTextAlignment = TextAlignment.End, VerticalTextAlignment = TextAlignment.Center, HorizontalOptions = LayoutOptions.EndAndExpand
            };
            CalculateVATForThisPerson_Label = new Label()
            {
                Text = "محاسبه مالیات ا.ا. برای این مشتری", LineBreakMode = LineBreakMode.NoWrap, HorizontalTextAlignment = TextAlignment.End, VerticalTextAlignment = TextAlignment.Center, HorizontalOptions = LayoutOptions.EndAndExpand
            };
            PartnerGroup_Label = new Label()
            {
                Text = "گروه مشتری:  ", LineBreakMode = LineBreakMode.NoWrap, HorizontalTextAlignment = TextAlignment.End, VerticalTextAlignment = TextAlignment.Start, HorizontalOptions = LayoutOptions.FillAndExpand
            };

            City = new RightRoundedLabel()
            {
                Text = "", HorizontalTextAlignment = TextAlignment.End, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, FontSize = 18
            };
            CityPicker = new Picker()
            {
            };
            CityChangeButton = new LeftEntryCompanionLabel()
            {
                VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.Center, FontSize = 18, Text = "..."
            };

            Zone = new RightRoundedLabel()
            {
                Text = "", HorizontalTextAlignment = TextAlignment.End, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, FontSize = 18
            };
            ZonePicker = new Picker()
            {
            };
            ZoneChangeButton = new LeftEntryCompanionLabel()
            {
                VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.Center, FontSize = 18, Text = "..."
            };

            Route = new RightRoundedLabel()
            {
                Text = "", HorizontalTextAlignment = TextAlignment.End, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, FontSize = 18
            };
            RoutePicker = new Picker()
            {
            };
            RouteChangeButton = new LeftEntryCompanionLabel()
            {
                VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.Center, FontSize = 18, Text = "..."
            };

            FillZones(EditingPartner != null ? EditingPartner.ZoneId : new Nullable <Guid>(), EditingPartner != null ? EditingPartner.Groups.Select(a => a.Id).ToArray() : new Guid[] { });

            FirstName = new MyEntry()
            {
                Text = EditingPartner != null ? EditingPartner.FirstName : "", HorizontalTextAlignment = TextAlignment.End, HorizontalOptions = LayoutOptions.FillAndExpand, RightRounded = true, LeftRounded = true, Padding = new Thickness(30, 10)
            };
            LastName = new MyEntry()
            {
                Text = EditingPartner != null ? EditingPartner.LastName : "", HorizontalTextAlignment = TextAlignment.End, HorizontalOptions = LayoutOptions.FillAndExpand, RightRounded = true, LeftRounded = true, Padding = new Thickness(30, 10)
            };
            LegalName = new MyEntry()
            {
                Text = EditingPartner != null ? EditingPartner.LegalName : "", HorizontalTextAlignment = TextAlignment.End, HorizontalOptions = LayoutOptions.FillAndExpand, RightRounded = true, LeftRounded = true, Padding = new Thickness(30, 10)
            };
            Phone1 = new MyEntry()
            {
                Text = EditingPartner != null ? EditingPartner.Phone1 : "", HorizontalTextAlignment = TextAlignment.End, HorizontalOptions = LayoutOptions.FillAndExpand, RightRounded = true, LeftRounded = true, Padding = new Thickness(30, 10), Keyboard = Keyboard.Telephone
            };
            Phone2 = new MyEntry()
            {
                Text = EditingPartner != null ? EditingPartner.Phone2 : "", HorizontalTextAlignment = TextAlignment.End, HorizontalOptions = LayoutOptions.FillAndExpand, RightRounded = true, LeftRounded = true, Padding = new Thickness(30, 10), Keyboard = Keyboard.Telephone
            };
            Cell = new MyEntry()
            {
                Text = EditingPartner != null ? EditingPartner.Mobile : "", HorizontalTextAlignment = TextAlignment.End, HorizontalOptions = LayoutOptions.FillAndExpand, RightRounded = true, LeftRounded = true, Padding = new Thickness(30, 10), Keyboard = Keyboard.Telephone
            };
            Fax = new MyEntry()
            {
                Text = EditingPartner != null ? EditingPartner.Fax : "", HorizontalTextAlignment = TextAlignment.End, HorizontalOptions = LayoutOptions.FillAndExpand, RightRounded = true, LeftRounded = true, Padding = new Thickness(30, 10), Keyboard = Keyboard.Telephone
            };
            Address = new PlaceholderEditor()
            {
                Text = EditingPartner != null ? EditingPartner.Address : "", HorizontalOptions = LayoutOptions.FillAndExpand, Padding = new Thickness(30, 10)
            };

            Credit = new RightRoundedLabel()
            {
                Text = "", HorizontalTextAlignment = TextAlignment.End, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, FontSize = 18
            };
            CreditPicker = new Picker()
            {
            };
            CreditChangeButton = new LeftEntryCompanionLabel()
            {
                VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.Center, FontSize = 18, Text = "..."
            };

            FillCredits(EditingPartner != null ? EditingPartner.CreditId : new Nullable <Guid>());

            IsPartnerLegal = new Switch()
            {
                IsToggled = EditingPartner != null ? EditingPartner.IsLegal : false, HorizontalOptions = LayoutOptions.End
            };
            CalculateVATForThisPerson = new Switch()
            {
                IsToggled = EditingPartner != null ? EditingPartner.CalculateVATForThisPerson : false, HorizontalOptions = LayoutOptions.End
            };

            ToolbarItem_LocalSave          = new ToolbarItem();
            ToolbarItem_LocalSave.Text     = "ذخیره محلی";
            ToolbarItem_LocalSave.Icon     = "Save.png";
            ToolbarItem_LocalSave.Clicked += SubmitPartnerToStorage;
            ToolbarItem_LocalSave.Order    = ToolbarItemOrder.Primary;
            ToolbarItem_LocalSave.Priority = 0;
            if (!JustShow)
            {
                this.ToolbarItems.Add(ToolbarItem_LocalSave);
            }

            ToolbarItem_SendToServer            = new ToolbarItem();
            ToolbarItem_SendToServer.Text       = "ذخیره محلی";
            ToolbarItem_SendToServer.Icon       = "Upload.png";
            ToolbarItem_SendToServer.Activated += SubmitPartnerToServer;
            ToolbarItem_SendToServer.Order      = ToolbarItemOrder.Primary;
            ToolbarItem_SendToServer.Priority   = 0;
            if (!JustShow)
            {
                this.ToolbarItems.Add(ToolbarItem_SendToServer);
            }

            BusyIndicatorContainder.BackgroundColor = Color.FromRgba(255, 255, 255, 70);
            BusyIndicator.Color = Color.FromRgba(80, 100, 150, 255);
        }