private void DataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (DataGrid.SelectedItems.Count > 0)
     {
         EditBtn.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
     }
 }
Esempio n. 2
0
        public StateTab EditStateTaxAccountCode()
        {
            var selectBisCode = new StateTab(WebDriver);

            Thread.Sleep(6000);
            EditBtn.ClickAndWaitForPageToLoad(selectBisCode);
            return(new StateTab(WebDriver));
        }
Esempio n. 3
0
        private void SaveBtn_Click(object sender, EventArgs e)
        {
            try
            {
                var phoneRegEx = new Regex("^(\\+380|0)([0-9]{9})$");
                if (!phoneRegEx.IsMatch(PhoneTB.Text))
                {
                    MessageBox.Show("Невіроно введений номер телефону, номер поивнен бути у форматі +380*********");
                    return;
                }
                else
                {
                    _person.Phone = PhoneTB.Text;
                }
                try
                {
                    MailAddress m = new MailAddress(EmailTB.Text);
                    _person.Email = EmailTB.Text;
                }
                catch (FormatException)
                {
                    MessageBox.Show("Перевірте коректність введеного Email");
                    return;
                }

                _person.Name    = NameTB.Text;
                _person.Surname = SurnameTB.Text;
                _person.Address = AddressTB.Text;
                try
                {
                    _person.Birthday = DateTime.Parse(BirthdayTB.Text);
                }
                catch (Exception)
                {
                    MessageBox.Show("Перевірте правильність введеня дати");
                    return;
                }
                dbContext.Entry(_person).State = System.Data.Entity.EntityState.Modified;
                dbContext.SaveChanges();
            }
            catch (Exception) {
                MessageBox.Show("Сталася помилка при збереженні");
            } finally
            {
                NameTB.ReadOnly     = true;
                SurnameTB.ReadOnly  = true;
                AddressTB.ReadOnly  = true;
                BirthdayTB.ReadOnly = true;
                PhoneTB.ReadOnly    = true;
                EmailTB.ReadOnly    = true;

                SaveBtn.Hide();
                EditBtn.Show();

                MessageBox.Show("Дані успішно збережені");
            }
        }
 private void DataGrid_KeyDown(object sender, KeyEventArgs e)
 {        // удаление из базы по нажатию на Del
     if (e.Key == Key.Delete)
     {
         RemoveBtn.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
     }
     else if (e.Key == Key.Enter)
     {
         EditBtn.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
     }
 }
Esempio n. 5
0
        private void EditBtn_Click(object sender, EventArgs e)
        {
            EditBtn.Hide();
            SaveBtn.Show();

            NameTB.ReadOnly     = false;
            SurnameTB.ReadOnly  = false;
            AddressTB.ReadOnly  = false;
            BirthdayTB.ReadOnly = false;
            PhoneTB.ReadOnly    = false;
            EmailTB.ReadOnly    = false;
        }
Esempio n. 6
0
        void ReleaseDesignerOutlets()
        {
            if (EditBtn != null)
            {
                EditBtn.Dispose();
                EditBtn = null;
            }

            if (ExcerciseTable != null)
            {
                ExcerciseTable.Dispose();
                ExcerciseTable = null;
            }
        }
        private void btn_addPro_Click(object sender, EventArgs e)
        {
            AddProPanel.Show();
            EditBtn.Hide();
            Btn_SaveProduct.Show();

            Txt_ProductNameUp.Text                  = "";
            numericDiscountProUp.Text               = "";
            numericIncomingPriceProUp.Text          = "";
            numericIndvidualPriceProUp.Text         = "";
            numericQuantityProUp.Text               = "";
            numericQuantityPackageProUp.Text        = "";
            Como_productCategoryUpdate.SelectedText = "";
            Como_productBuySupplierUp.SelectedText  = "";
            Como_productUnitUpdate.SelectedText     = "";
        }
        private void editBtnProduct_Click(object sender, EventArgs e)
        {
            if (dgv_SalesBill.SelectedRows.Count == 0)
            {
                MessageBoxIcon.Warning.ToString();
                MessageBox.Show("يجب ان تختار منتج من المنتجات");
            }
            else
            {
                AddProPanel.Show();
                Btn_SaveProduct.Hide();
                EditBtn.Show();
                var P_id = int.Parse(dgv_SalesBill.SelectedRows[0].Cells[6].Value.ToString());

                Como_productCategoryUpdate.DataSource    = store.categories.ToList();
                Como_productCategoryUpdate.DisplayMember = "CategoryName";
                Como_productCategoryUpdate.ValueMember   = "ID";

                //////suplier
                Como_productBuySupplierUp.DataSource    = store.suppliers.ToList();
                Como_productBuySupplierUp.DisplayMember = "Name";
                Como_productBuySupplierUp.ValueMember   = "ID";
                ////unt
                Como_productUnitUpdate.DataSource    = store.ProductUnits.ToList();
                Como_productUnitUpdate.DisplayMember = "Name";
                Como_productUnitUpdate.ValueMember   = "ID";

                var query = store.products.FirstOrDefault(d => d.ID == P_id);


                Txt_ProductNameUp.Text                  = query.ProductName;
                numericDiscountProUp.Text               = query.Discount.ToString();
                numericIncomingPriceProUp.Text          = query.IncomePrice.ToString();
                numericIndvidualPriceProUp.Text         = query.Price_individual.ToString();
                numericQuantityProUp.Text               = query.quantityPerProducts.ToString();
                numericQuantityPackageProUp.Value       = query.quantityPerGroup;
                Como_productCategoryUpdate.SelectedText = query.categories.CategoryName.ToString();
                Como_productBuySupplierUp.SelectedText  = query.Supplier.Name.ToString();
                Como_productUnitUpdate.SelectedText     = query.ProductUnit.Name.ToString();
            }
        }
Esempio n. 9
0
        //Edit a Property
        internal void EditProperty()
        {
            Global.ExcelLib.PopulateInCollection(Config.PropertyManagementResource.ExcelPath, "Property");
            //Explicit Wait
            Thread.Sleep(1000);
            //Click on Owners tab
            Owners.Click();
            //Click Properties option
            Properties.Click();
            // Explicit Wait
            Thread.Sleep(1000);
            // Click on the menu
            menulink.Click();
            // Explicit Wait
            Thread.Sleep(1000);
            //Click on Edit Button
            EditBtn.Click();
            Thread.Sleep(500);
            //Modify Property Name
            EditPropertyName.Clear();
            EditPropertyName.SendKeys(Global.ExcelLib.ReadData(2, "PropertyName_Modified"));
            EditDescription.Clear();
            EditDescription.SendKeys(Global.ExcelLib.ReadData(2, "Description_Modified"));
            Thread.Sleep(1000);
            EditCar.SendKeys(Global.ExcelLib.ReadData(2, "Car_Modified"));
            Thread.Sleep(1000);
            // Approach 1 to upload file
            ChooseFilesbtn.SendKeys(@"C:\Users\Shahabuddin\Desktop\Rumana\house1_image.png");
            Thread.Sleep(1000);

            /*
             * //File Upload Approach2: AutoIt- Handles windows that do not belong to browser
             * FileUploadbtn.Click();
             * AutoItX3 AutoIt = new AutoItX3();
             * AutoIt.ControlFocus("Open", "", "Edit1");
             * Thread.Sleep(2000);
             * AutoIt.ControlSetText("Open", "", "Edit1", @"C:\Users\Shahabuddin\Desktop\Rumana\Afraz.jpg");
             * Thread.Sleep(1000);
             * AutoIt.ControlClick("Open", "", "Button1");
             */
            EditSaveBtn.Click();
            //Verification
            //Click on Owners tab
            Owners.Click();
            //Click Properties option
            Properties.Click();
            string msg2    = Global.GlobalDefinition.driver.FindElement(By.XPath("//*[@id='main-content']/section/div[1]/div/div[3]/div/div[1]/div[2]/div[1]/div[1]/a/h3")).Text;
            string Actmsg2 = Global.ExcelLib.ReadData(2, "EditPropertyVerification");

            Thread.Sleep(2000);
            if (msg2 == Actmsg2)
            {
                Thread.Sleep(200);
                Global.Base.test.Log(LogStatus.Pass, "Test Passed, Record has been updated successfully");
                Global.SaveScreenShotClass.SaveScreenshot(Global.GlobalDefinition.driver, "PropertyListEdited");
            }

            else
            {
                Thread.Sleep(200);
                Global.Base.test.Log(LogStatus.Pass, "Test Failed, Record has not updated");
            }
        }
Esempio n. 10
0
        void ReleaseDesignerOutlets()
        {
            if (bannerView != null)
            {
                bannerView.Dispose();
                bannerView = null;
            }

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

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

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

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

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

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

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

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

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

            if (SettingsBtn != null)
            {
                SettingsBtn.Dispose();
                SettingsBtn = null;
            }
        }
        public PageViewerCommandBar()
        {
            this.InitializeComponent();

            _showSettings     = new Subject <Unit>();
            _scrollToTop      = new Subject <Unit>();
            _printPdf         = new Subject <Unit>();
            _edit             = new Subject <Unit>();
            _search           = new Subject <Unit>();
            _showHistory      = new Subject <Unit>();
            _toggleFullscreen = new Subject <Unit>();
            _import           = new Subject <Unit>();
            _export           = new Subject <Unit>();
            _navigateToPage   = new Subject <string>();

            this.WhenActivated(disposable =>
            {
                this.OneWayBind(ViewModel,
                                vm => vm.DevOptsEnabled,
                                view => view.DevOptBtn.Visibility)
                .DisposeWith(disposable);

                SettingsBtn.Events().Click
                .Select(x => Unit.Default)
                .Subscribe(x => { _showSettings.OnNext(x); }).DisposeWith(disposable);

                ToTopBtn.Events().Click
                .Select(x => Unit.Default)
                .Subscribe(x => { _scrollToTop.OnNext(x); }).DisposeWith(disposable);

                PdfBtn.Events().Click
                .Select(x => Unit.Default)
                .Subscribe(x => { _printPdf.OnNext(x); }).DisposeWith(disposable);

                SearchBtn.Events().Click
                .Select(x => Unit.Default)
                .Subscribe(x => { _search.OnNext(x); }).DisposeWith(disposable);

                HistoryBtn.Events().Click
                .Select(x => Unit.Default)
                .Subscribe(x => { _showHistory.OnNext(x); }).DisposeWith(disposable);

                FullscreenBtn.Events().Click
                .Select(x => Unit.Default)
                .Subscribe(x => { _toggleFullscreen.OnNext(x); }).DisposeWith(disposable);

                ImportBtn.Events().Click
                .Select(x => Unit.Default)
                .Subscribe(x => { _import.OnNext(x); }).DisposeWith(disposable);

                ExportBtn.Events().Click
                .Select(x => Unit.Default)
                .Subscribe(x => { _export.OnNext(x); }).DisposeWith(disposable);

                EditBtn.Events().Click
                .Select(_ => Unit.Default)
                .Subscribe(x => { _edit.OnNext(Unit.Default); }).DisposeWith(disposable);

                NewPageBtn.Events().Click
                .Select(_ => Unit.Default)
                .InvokeCommand(ViewModel.NewPageClick)
                .DisposeWith(disposable);

                DevOptBtn.Events().Click
                .Select(_ => Unit.Default)
                .InvokeCommand(ViewModel.DevOptionsClick)
                .DisposeWith(disposable);

                BindTextResources(disposable);

                ShowLastVisitedPages();
            });
        }
Esempio n. 12
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            bannerView.Hidden = true;

            UIApplication.SharedApplication.SetStatusBarHidden(true, false);
            Util.SetColorsOnStartup();
            this.KeysCollectionView.BackgroundColor = Util.BackgroundColor;

            ClearButton(ExportConfigBtn);
            ExportConfigBtn.SetImage(Images.ExportConfigImg, UIControlState.Normal);
            ClearButton(ImportConfigBtn);
            ImportConfigBtn.SetImage(Images.ImportConfigImg, UIControlState.Normal);
            ClearButton(NewConfigBtn);
            NewConfigBtn.SetImage(Images.NewConfigImg, UIControlState.Normal);
            ClearButton(SearchConfigBtn);
            SearchConfigBtn.SetImage(Images.SearchConfigImg, UIControlState.Normal);
            ClearButton(SelectConfigBtn);
            SelectConfigBtn.SetImage(Images.ListConfigsImg, UIControlState.Normal);
            ClearButton(SettingsBtn);
            SettingsBtn.SetImage(Images.SettingsImg, UIControlState.Normal);
            ClearButton(EditBtn);
            EditBtn.SetImage(Images.EditConfigImg, UIControlState.Normal);
            //EditBtn.SetImage(Images.EditConfigImgSelected,UIControlState.Selected);

            //load last used configuration or default
            if (Util.GetLastConfigurationUsed() == null)                //this is the first run ever
            {
                DBManager.Instance.CreateTables();
                _keySourceData = new KeySource(new List <FPKey> ());
            }
            else
            {
                _loadedConfiguration = ConfigsEngine.LoadConfiguration(Util.GetLastConfigurationUsed());
                _keySourceData       = new KeySource(_loadedConfiguration.Keys);
                ConfigNameLbl.Text   = _loadedConfiguration.Name.ToUpper();
            }

            //TODO add iphone
            KeysCollectionView.RegisterNibForCell(UINib.FromName("KeyCell_iPad", NSBundle.MainBundle), KeyCell.Key);

            _keySourceData.KeyPressed += HandleKeyPressed;
            _keySourceData.OnKeyMoved += HandleKeyMoved;
            KeysCollectionView.Source  = _keySourceData;
            KeysCollectionView.DelaysContentTouches = false;

            var longPressGesture = new UILongPressGestureRecognizer(HandleLongGesture);

            KeysCollectionView.AddGestureRecognizer(longPressGesture);

            #region Config popOver
            UIViewController configListViewController = new UIViewController();
            configListViewController.View = ConfigListTableView;
            configListViewController.View.BackgroundColor = UIColor.White;
            _configListPopOver = new UIPopoverController(configListViewController);
            _configListPopOver.BackgroundColor = UIColor.White;

            _configsSource = new ConfigurationsListSource();
            _configsSource.OnConfigurationSelected += OnConfigurationSelected;
            _configsSource.OnConfigurationDeleted  += OnConfigurationDeleted;

            ConfigListTableView.Source = _configsSource;
            ConfigListTableView.ReloadData();
            ConfigListTableView.TableFooterView = new UIView();
            #endregion

            Util.OnEnableNightMode += OnNightModeChanged;

#if !DISCONNECTED
            CommsEngine.Instance.OnServerDisconnected += HandleOnServerDisconnected;
            if (Util.GetServerIP() == null)                //first Time
            {
                PresentServerSelection();
            }
            else
            {
                CommsEngine.Instance.OnClientConnected += HandleOnClientConnected;
                ConnectToLastKnownServer();
            }
#else
            if (Util.GetLastConfigurationUsed() == null)
            {
                LoadDefaultConfiguration();
            }
                        #endif
        }
Esempio n. 13
0
        public void ShowCmdWindow(string cmd, int LscId, string LscName, string LscIP, int LscPort, string LscUID, string LscPwd, int BeatInterval, int BeatDelay, string DBServer, int DBPort, string DBName, string DBUID, string DBPwd, string HisDBServer, int HisDBPort, string HisDBName, string HisDBUID, string HisDBPwd, bool Enabled)
        {
            switch (cmd)
            {
            case "Edit":
                LSCWindow.Icon      = Icon.ChartOrganisation;
                LSCWindow.Title     = "编辑信息";
                LSCIDField.Disabled = true;
                LSCStatusBar.ClearStatus();
                SaveBtn.Hide();
                EditBtn.Show();
                LSCIDField.Number        = LscId;
                LSCNameField.Text        = LscName;
                LSCIPField.Text          = LscIP;
                LSCPortField.Number      = LscPort;
                LSCUIDField.Text         = LscUID;
                LSCPwdField.Text         = LscPwd;
                BeatIntervalField.Number = BeatInterval;
                BeatDelayField.Number    = BeatDelay;
                DBIPField.Text           = DBServer;
                DBPortField.Number       = DBPort;
                DBNameField.Text         = DBName;
                DBUIDField.Text          = DBUID;
                DBPwdField.Text          = DBPwd;
                HisDBIPField.Text        = HisDBServer;
                HisDBPortField.Number    = HisDBPort;
                HisDBNameField.Text      = HisDBName;
                HisDBUIDField.Text       = HisDBUID;
                HisDBPwdField.Text       = HisDBPwd;
                EnabledCheckbox.Checked  = Enabled;
                LSCWindow.Show();
                break;

            case "Del":
                X.Msg.Confirm("确认对话框", "本操作将删除与Lsc有关的所有数据!您确定要删除吗?", new MessageBoxButtonsConfig {
                    Yes = new MessageBoxButtonConfig {
                        Handler = String.Format(@"
                            X.LSCManager.DelLsc({0},{{
                            success: function(result) {{
                                LSCPagingToolbar.doRefresh();
                            }},
                            eventMask: {{
                                showMask: true,
                                target: 'customtarget',
                                msg: '正在删除中...',
                                customTarget: LSCPanel.body.up('div')
                            }}}});", LscId),
                        Text    = "确定"
                    },
                    No = new MessageBoxButtonConfig {
                        Text = "取消"
                    }
                }).Show();
                break;

            case "Add":
                LSCWindow.Icon          = Icon.ChartOrganisationAdd;
                LSCWindow.Title         = "新增信息";
                EnabledCheckbox.Checked = false;
                LSCIDField.Disabled     = false;
                LSCStatusBar.ClearStatus();
                SaveBtn.Show();
                EditBtn.Hide();
                LSCIDField.Clear();
                LSCNameField.Clear();
                LSCIPField.Clear();
                LSCPortField.Number = LscPort;
                LSCUIDField.Clear();
                LSCPwdField.Clear();
                BeatIntervalField.Number = BeatInterval;
                BeatDelayField.Number    = BeatDelay;
                DBIPField.Clear();
                DBPortField.Number = DBPort;
                DBNameField.Clear();
                DBUIDField.Clear();
                DBPwdField.Clear();
                HisDBIPField.Clear();
                HisDBPortField.Number = HisDBPort;
                HisDBNameField.Clear();
                HisDBUIDField.Clear();
                HisDBPwdField.Clear();
                EnabledCheckbox.Checked = Enabled;
                LSCWindow.Show();
                break;

            case "Sync":
                SyncWindow.Icon   = Icon.DatabaseRefresh;
                SyncWindow.Title  = String.Format("数据同步[{0}]", LscName);
                STRadio.Checked   = true;
                SyncWindowHF.Text = LscId.ToString();
                SyncWindow.Show();
                break;

            default:
                break;
            }
        }