Exemple #1
0
        private void SetUpVisibility()
        {
            CommonProcs CP = new CommonProcs();

            if (CP.GetProperty("ext_GoodListView_GoodName_IsVivsible") == "True")
            {
                Resources["lv_GoodName_col_width"] = CP.GetProperty("ext_GoodListView_GoodName_Width");
            }
            else
            {
                Resources["lv_GoodName_col_width"] = "0";
            }

            if (CP.GetProperty("ext_GoodListView_UnitName_IsVivsible") == "True")
            {
                Resources["lv_UnitName_col_width"] = CP.GetProperty("ext_GoodListView_UnitName_Width");
            }
            else
            {
                Resources["lv_UnitName_col_width"] = "0";
            }

            if (CP.GetProperty("ext_GoodListView_GoodDescription_IsVivsible") == "True")
            {
                Resources["lv_GoodDescription_col_width"] = CP.GetProperty("ext_GoodListView_GoodDescription_Width");
            }
            else
            {
                Resources["lv_GoodDescription_col_width"] = "0";
            }

            if (CP.GetProperty("ext_GoodListView_GoodSerial_IsVivsible") == "True")
            {
                Resources["lv_GoodSerial_col_width"] = CP.GetProperty("ext_GoodListView_GoodSerial_Width");
            }
            else
            {
                Resources["lv_GoodSerial_col_width"] = "0";
            }

            if (CP.GetProperty("ext_GoodListView_GoodQuality_IsVivsible") == "True")
            {
                Resources["lv_GoodQuality_col_width"] = CP.GetProperty("ext_GoodListView_GoodQuality_Width");
            }
            else
            {
                Resources["lv_GoodQuality_col_width"] = "0";
            }

            if (CP.GetProperty("ext_GoodListView_GoodAmount_IsVivsible") == "True")
            {
                Resources["lv_GoodAmount_col_width"] = CP.GetProperty("ext_GoodListView_GoodAmount_Width");
            }
            else
            {
                Resources["lv_GoodAmount_col_width"] = "0";
            }

            if (CP.GetProperty("ext_GoodListView_GoodAmountAquired_IsVivsible") == "True")
            {
                Resources["lv_GoodAmountAquired_col_width"] = CP.GetProperty("ext_GoodListView_GoodAmountAquired_Width");
            }
            else
            {
                Resources["lv_GoodAmountAquired_col_width"] = "0";
            }

            if (CP.GetProperty("ext_GoodListView_Value0_IsVivsible") == "True")
            {
                Resources["lv_Value0_col_width"] = CP.GetProperty("ext_GoodListView_Value0_Width");
            }
            else
            {
                Resources["lv_Value0_col_width"] = "0";
            }

            if (CP.GetProperty("ext_GoodListView_Value1_IsVivsible") == "True")
            {
                Resources["lv_Value1_col_width"] = CP.GetProperty("ext_GoodListView_Value1_Width");
            }
            else
            {
                Resources["lv_Value1_col_width"] = "0";
            }

            if (CP.GetProperty("ext_GoodListView_Value2_IsVivsible") == "True")
            {
                Resources["lv_Value2_col_width"] = CP.GetProperty("ext_GoodListView_Value2_Width");
            }
            else
            {
                Resources["lv_Value2_col_width"] = "0";
            }

            Resources["lv_GoodName_IsVivsible"]          = CP.GetProperty("ext_GoodListView_GoodName_IsVivsible");
            Resources["lv_UnitName_IsVivsible"]          = CP.GetProperty("ext_GoodListView_UnitName_IsVivsible");
            Resources["lv_GoodDescription_IsVivsible"]   = CP.GetProperty("ext_GoodListView_GoodDescription_IsVivsible");
            Resources["lv_GoodSerial_IsVivsible"]        = CP.GetProperty("ext_GoodListView_GoodSerial_IsVivsible");
            Resources["lv_GoodQuality_IsVivsible"]       = CP.GetProperty("ext_GoodListView_GoodQuality_IsVivsible");
            Resources["lv_GoodAmount_IsVivsible"]        = CP.GetProperty("ext_GoodListView_GoodAmount_IsVivsible");
            Resources["lv_GoodAmountAquired_IsVivsible"] = CP.GetProperty("ext_GoodListView_GoodAmountAquired_IsVivsible");
            Resources["lv_Value0_IsVivsible"]            = CP.GetProperty("ext_GoodListView_Value0_IsVivsible");
            Resources["lv_Value1_IsVivsible"]            = CP.GetProperty("ext_GoodListView_Value1_IsVivsible");
            Resources["lv_Value2_IsVivsible"]            = CP.GetProperty("ext_GoodListView_Value2_IsVivsible");

            if (CP.GetProperty("ext_ScanHardWare") == "1")
            {
                Resources["btn_Scan_IsVivsible"] = true;
            }
            else
            {
                Resources["btn_Scan_IsVivsible"] = false;
            }
        }
Exemple #2
0
        public Page_GoodRedacting(Good locGoodItem, ObservableCollection<Good> locLv_Goods, Document locDocument)
        {
            GoodItemRef = locGoodItem;
            RefLv_Goods = locLv_Goods;
            refDocument = locDocument;
            for (int cur = 0; cur < locGoodItem.Count; cur++)
            {
                GoodItem[cur] = locGoodItem[cur];
            }

            StackLayout stack = new StackLayout
            {
                BackgroundColor = (Color)App.Current.Resources["backColor"],
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.FillAndExpand
            };

            CommonProcs CP = new CommonProcs();

            //========== GoodName
            if (CP.GetProperty("ext_GoodListView_GoodName_IsVivsible") == "True")
            {
                AddCluster(stack, "ТМЦ: ", new ItemsRequestStructure { Intent = "Good", VarName = "nGood", Metadata = GoodItem.Metadata });
            }

            //========== Description
            if (CP.GetProperty("ext_GoodListView_GoodDescription_IsVivsible") == "True")
            {
                AddCluster(stack, "Хар-ка: ", new ItemsRequestStructure { Intent = "GoodDescription", Metadata = GoodItem.mGoodDescription, VarName = "nGoodDescription", ParentMetadata = GoodItem.Metadata });
            }
            //========== S/N
            if (CP.GetProperty("ext_GoodListView_GoodSerial_IsVivsible") == "True")
            {
                AddCluster(stack, "С/Н: ", new ItemsRequestStructure { Intent = "Serial", Metadata = GoodItem.mSerial, VarName = "nSerial", ParentMetadata = GoodItem.Metadata });
            }
            //========== UnitName
            if (CP.GetProperty("ext_GoodListView_UnitName_IsVivsible") == "True")
            {
                AddCluster(stack, "Ед.: ", new ItemsRequestStructure { Intent = "Unit", Metadata = GoodItem.mUnit, VarName = "nUnit", ParentMetadata = GoodItem.Metadata });
            }
            //========== Quality
            if (CP.GetProperty("ext_GoodListView_GoodQuality_IsVivsible") == "True")
            {
                AddCluster(stack, "Кач-во: ", new ItemsRequestStructure { Intent = "Quality", VarName = "nQuality", Metadata = GoodItem.mQuality });
            }
            //========== Amount
            if (CP.GetProperty("ext_GoodListView_GoodAmount_IsVivsible") == "True")
            {
                AddCluster(stack, "Кол.: ", new ItemsRequestStructure { Intent = "Amount", VarName = "Amount" });
            }
            //========== AmountAquired
            if (CP.GetProperty("ext_GoodListView_GoodAmountAquired_IsVivsible") == "True")
            {
                AddCluster(stack, "Набрано: ", new ItemsRequestStructure { Intent = "AmountAquired", VarName = "AmountAquired" });
            }
            //========== Value0
            if (CP.GetProperty("ext_GoodListView_Value0_IsVivsible") == "True")
            {
                AddCluster(stack, "Д/З_0: ", new ItemsRequestStructure { Intent = "Value0", VarName = "Value0" });
            }
            //========== Value1
            if (CP.GetProperty("ext_GoodListView_Value1_IsVivsible") == "true")
            {
                AddCluster(stack, "Д/З_1: ", new ItemsRequestStructure { Intent = "Value1", VarName = "Value1" });
            }
            //========== Value2
            if (CP.GetProperty("ext_GoodListView_Value2_IsVivsible") == "True")
            {
                AddCluster(stack, "Д/З_2: ", new ItemsRequestStructure { Intent = "Value2", VarName = "Value2" });
            }

            Xamarin.Forms.Label l = new Xamarin.Forms.Label
            {
                BackgroundColor = (Color)App.Current.Resources["backColor"],
                TextColor = Color.Cyan,
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment = TextAlignment.Center,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.End,
                FontSize = 14,
                Text = "Штрих-коды товара:"
            };

            stack.Children.Add(l);

            ListView lv_barcodes = new ListView
            {
                ItemsSource = os_barcodes,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.End,
                BackgroundColor = (Color)App.Current.Resources["backColor"],
                ItemTemplate = new DataTemplate(() =>
                {
                    StackLayout s = new StackLayout
                    {
                        BackgroundColor = (Color)App.Current.Resources["textColor"],
                        HorizontalOptions = LayoutOptions.FillAndExpand,
                        //VerticalOptions = LayoutOptions.FillAndExpand,
                    };

                    l = new Xamarin.Forms.Label
                    {
                        BackgroundColor = (Color)App.Current.Resources["backColor"],
                        TextColor = Color.LightYellow,
                        HorizontalTextAlignment = TextAlignment.Start,
                        VerticalTextAlignment = TextAlignment.Center,
                        HorizontalOptions = LayoutOptions.FillAndExpand,
                        VerticalOptions = LayoutOptions.FillAndExpand,
                        FontSize = 14,
                    };

                    s.Children.Add(l);

                    l.SetBinding(Xamarin.Forms.Label.TextProperty, "Barcode");

                    return new ViewCell { View = s };
                })

            };

            lv_barcodes.ItemSelected += Lv_barcodes_ItemSelected;

            stack.Children.Add(lv_barcodes);

            Button B;
            if (new CommonProcs().GetProperty("ext_ScanHardWare") == "1")
            {
                B = new Button
                {
                    Text = "Сканировать",
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions = LayoutOptions.End
                };
                B.Clicked += Scan_Clicked;
                stack.Children.Add(B);
            }

            B = new Button
            {
                Text = "Удалить",
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.End,

            };

            B.Clicked += B_Clicked_Delete;

            stack.Children.Add(B);

            B = new Button
            {
                Text = "Ok",
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.End
            };
            B.Clicked += Ok_Clicked;

            stack.Children.Add(B);

            this.Content = stack;

        }