Exemple #1
0
        private void materialRaisedButton1_Click(object sender, EventArgs e)
        {
            ControlDB control = new ControlDB(ControlDB.cPath, "dbQA.mdf");

            try
            {
                string[] parameters = { "@name", "@dir", "@comp" };
                string[] elements   = { TxtName.Text, TxtDirection.Text, TxtCompany.Text };
                if (!control.Insertar("insert into [Proveedor] values(@name,@dir,@comp)", parameters, elements))
                {
                    MessageBox.Show("EL proovedor no pudo ser agregado", "Google LLC", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            };

            TxtName.Clear();
            TxtDirection.Clear();
            TxtCompany.Clear();
            MessageBox.Show("Proveedor Agregado Correctamente", "Google LLC", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            TxtName.Focus();
        }
Exemple #2
0
 private void AddProvider_Load(object sender, EventArgs e)
 {
     TxtName.BackColor      = Color.White;
     TxtDirection.BackColor = Color.White;
     TxtCompany.BackColor   = Color.White;
     TxtName.Focus();
 }
Exemple #3
0
        private void FxSave()
        {
            string lName    = TxtName.Text.Trim();
            string lIsoCode = TxtIsoCode.Text.Trim();
            string lSymbol  = TxtSymbol.Text.Trim();

            bool lEnabled = ChkEnabled.Checked;

            if (lName.Length < 3)
            {
                ClsFunctions.FxMessage(1, "Ingrese nombre");

                TxtName.Text = "";

                TxtName.Focus();

                return;
            }

            if (lIsoCode.Length < 3)
            {
                ClsFunctions.FxMessage(1, "Ingrese código");

                TxtIsoCode.Text = "";

                TxtIsoCode.Focus();

                return;
            }

            if (lSymbol.Length < 1)
            {
                ClsFunctions.FxMessage(1, "Ingrese símbolo");

                TxtSymbol.Text = "";

                TxtSymbol.Focus();

                return;
            }

            if (ClsFunctions.FxMessage(2, "¿Está seguro de guardar los cambios?") == true)
            {
                long lCurrencyId_new;

                if (lCurrencyId == 0)
                {
                    lCurrencyId_new = ClsSqlCore.Fx_ins_tblCurrency(lName, lIsoCode, lSymbol);
                }
                else
                {
                    lCurrencyId_new = ClsSqlCore.Fx_upt_tblCurrency(lCurrencyId, lName, lIsoCode, lSymbol, lEnabled);
                }

                if (lCurrencyId_new > 0)
                {
                    FxExit();
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         TxtName.Focus();
     }
 }
Exemple #5
0
 private String Check()
 {
     if (TxtName.Text == "")
     {
         MessageBox.Show("Please enter a name");
         TxtName.Focus();
         return("Error");
     }
     else if (TxtDesignation.Text == "")
     {
         MessageBox.Show("Please enter a designation");
         TxtDesignation.Focus();
         return("Error");
     }
     else if (TxtContact.Text == "")
     {
         MessageBox.Show("Please enter a contact no");
         TxtContact.Focus();
         return("Error");
     }
     else if (TxtAddress.Text == "")
     {
         MessageBox.Show("Please enter a address");
         TxtAddress.Focus();
         return("Error");
     }
     else
     {
         return("OK");
     }
 }
Exemple #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (TxtName.Text == "" && TxtPassWord.Text == "")
            {
                MessageBox.Show("请输入账号!");
                TxtName.Focus();
            }
            if (TxtName.Text != "f" && TxtPassWord.Text != "")
            {
                MessageBox.Show("账号错误!\n 请重新输入…");
                TxtName.Clear();
                TxtName.Focus();
            }
            if (TxtName.Text == "f" && TxtPassWord.Text == "")
            {
                MessageBox.Show("请输入密码!");
                TxtPassWord.Focus();
            }

            else if (TxtPassWord.Text != "f" && TxtName.Text == "f")
            {
                MessageBox.Show("密码错误!");
                TxtPassWord.SelectAll();
                TxtPassWord.Focus();
            }

            if (TxtName.Text == "f" && TxtPassWord.Text == "f")
            {
                this.Close();
                frmMain.showShiYanOrder();
            }
        }
Exemple #7
0
 private bool isformvalid()
 {
     if (TxtUName.Text == "")
     {
         Response.Write("<script> alert ('Kullanıcı Adı Giriniz'); </script>");
         TxtUName.Focus();
         return(false);
     }
     else if (TxtPass.Text != TxtCPass.Text)
     {
         Response.Write("<script> alert ('Şifreler Aynı Olmalı'); </script>");
         TxtPass.Focus();
         return(false);
     }
     else if (TxtMail.Text == "")
     {
         Response.Write("<script> alert ('Email Adresi Giriniz'); </script>");
         TxtMail.Focus();
         return(false);
     }
     else if (TxtName.Text == "")
     {
         Response.Write("<script> alert ('Ad Soyad Giriniz'); </script>");
         TxtName.Focus();
         return(false);
     }
     return(true);
 }
        private void Window_Initialized(object sender, EventArgs e)
        {
            this.Left = ((Application.Current.MainWindow.Width / 2) - (Width / 2));
            this.Top  = ((Application.Current.MainWindow.Height / 2) - (Height / 2));

            TxtName.Focus();
        }
Exemple #9
0
        private void AddData(object sender, RoutedEventArgs e)
        {
            var meal = new Meal
            {
                Name        = TxtName.Text,
                IsBreakfast = CbIsBreakfast.IsChecked ?? false,
                IsLunch     = CbIsLunch.IsChecked ?? false,
                IsDinner    = CbIsDinner.IsChecked ?? false,
                IsSnack     = CbIsSnack.IsChecked ?? false
            };

            _mealDao.Save(meal);

            var meals = _mealDao.Get();

            ViewModel.Meals.Clear();
            meals.ForEach(m => ViewModel.Meals.Add(m));

            TxtName.Text = string.Empty;
            TxtName.Focus(FocusState.Programmatic);
            CbIsBreakfast.IsChecked = false;
            CbIsLunch.IsChecked     = false;
            CbIsDinner.IsChecked    = false;
            CbIsSnack.IsChecked     = false;
        }
 protected void BtnNovo_Click(object sender, EventArgs e)
 {
     TxtName.Text      = "";
     TxtTelephone.Text = "";
     HFId.Value        = "0";
     TxtName.Focus();
 }
        private void TxtName_TextChanged(object sender, EventArgs e)
        {
            string context  = TxtName.Text;
            bool   isletter = true;

            //for loop checks for letters as characters are entered
            for (int i = 0; i < context.Length; i++)
            {
                if (!char.IsLetter(context[i])) // if current character not a letter
                {
                    isletter = false;           //make isletter false
                    break;                      // exit the for loop
                }
            }

            // if not a letter clear the textbox and focus on it
            // to enter name again
            if (isletter == false)
            {
                TxtName.Clear();
                TxtName.Focus();
            }
            else
            {
                mnuStart.Enabled = true;
            }
        }
Exemple #12
0
 // create button method/event
 private void CreateButtonClick(object sender, EventArgs e)
 {
     if (!TxtName.Text.Contains(" "))
     {
         TxtName.Text = "Must Enter Full Name!";
         TxtName.Focus();
     }
     else
     {
         customer1.Name           = TxtName.Text;
         customer1.InitialDeposit = double.Parse(TxtInitialDeposit.Text);
         customer1.accountNumberGenerate();
         TxtInitialDeposit.Text     = customer1.convertDeposit();
         AccountTxtBox.Text         = customer1.AccountNumber.ToString();
         TxtName.Enabled            = false;
         TxtInitialDeposit.ReadOnly = true;
         AccountLbl.Show();
         AccountTxtBox.Show();
         lblDeposit.Show();
         TxtDeposit.Show();
         TxtDeposit.Focus();
         lblWithDraw.Show();
         TxtWithdraw.Show();
         UpdateAccountButton.Show();
         CreateButton.Hide();
         TxtDeposit.Focus();
     }
 }
Exemple #13
0
        private void KMForm_Load(object sender, EventArgs e)
        {
            MessageBox.Show(Message, Title);
            MessageBox.Show(MessageTwo, Title);
            MessageBox.Show(MessageThree, Title);
            string message = "Please remember to enter the number of lives you want under the 'LIVES' text" +
                             " and your name under the 'PLAYER NAME' text" + "The level buttons will not be available to use unless valid a valid name and life amount";
            string            title   = "Important message";
            MessageBoxButtons buttons = MessageBoxButtons.YesNo;
            DialogResult      result  = MessageBox.Show(message, title, buttons, MessageBoxIcon.Warning);

            if (result == DialogResult.Yes)
            {
            }
            else if (result == DialogResult.No)
            {
                this.Close();
            }
            //Disables the buttons but makes them visable so that the isletter and isnumber methods can come into play
            KMLevel1.Enabled = false;
            KMLevel2.Enabled = false;
            KMLevel3.Enabled = false;
            KMLevel4.Enabled = false;
            KMLevel5.Enabled = false;
            KMLevel1.Visible = true;
            KMLevel2.Visible = true;
            KMLevel3.Visible = true;
            KMLevel4.Visible = true;
            KMLevel5.Visible = true;
            KMPanel1.Visible = false;
            TxtName.Focus();
            //Disables the timers so that they do not interfere with the main menu
            tmrEnemy.Enabled = false;
            tmrKrool.Enabled = false;
        }
 private void ZubosFrmNewBooking_Load(object sender, EventArgs e)
 {
     DtpDateFrom.Value  = DateTime.Today;
     DtpDateTo.Value    = DateTime.Today;
     CmbRoom.DataSource = Room.GetAllUnassignedRoomsAsList().OrderBy(O => O.Name).ToList();
     TxtName.Focus();
 }
Exemple #15
0
 public void CleanControls()
 {
     TxtName.Text         = string.Empty;
     TxtPrice.Text        = string.Empty;
     TxtTransmission.Text = string.Empty;
     TxtName.Focus();
 }
        private void BtnReset_Click(object sender, EventArgs e)
        {
            // if the reset button is clicked
            //stop the game
            //clear the textbox for the name and lives
            //enable the textbox for the name and lives
            //reset points

            TmrGame.Enabled = false;

            TxtName.Enabled = true;
            TxtName.Clear();

            TxtLives.Enabled = true;
            TxtLives.Clear();

            LblPoints.Text = "0";

            TxtName.Focus();

            //reset the ships position
            myShip.X     = 50;
            myShip.Y     = 140;
            myShip.Angle = 0;
            ShipImage    = RotateImage(OGShipImage, myShip.Angle);
        }
Exemple #17
0
        private void button1_Click(object sender, EventArgs e)
        {
            Trabalho.LTP.Dominio.ItensRoot.Item model = MapearDominio();



            IItemServices service = Program.container.GetInstance <IItemServices>();

            if (service.Adicionar(model))
            {
                PreencherGrid();

                MessageBox.Show(this, "Item Adicionado com sucesso.", "Trabalho", MessageBoxButtons.OK, MessageBoxIcon.Information);

                LimparComponentes();

                TxtName.Focus();
            }
            else
            {
                TxtName.Focus();

                MessageBox.Show(this, "Item não Cadastrado.\n \n" + service.ObterNotificacoes(), "Trabalho", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #18
0
 /// <summary>
 /// An event to clear the display window and the textboxes, also sets the focus in the name textbox.
 /// </summary>
 /// <param name="sender">MnuClear_Click</param>
 /// <param name="e">Not Used</param>
 private void MnuClear_Click(object sender, EventArgs e)
 {
     RTxtDisplay.Clear();
     TxtName.Clear();
     TxtScore.Clear();
     TxtName.Focus();
 }//End MnuClear()
Exemple #19
0
 private void FrmAlien_Load(object sender, EventArgs e)
 {
     MessageBox.Show("Try and click on the Kardashian as fast as you can with the mouse. This will increase your score. Attempt to get 100 in 35 seconds. You must clikc start for it to start. ", "Game Instructions");
     TxtName.Focus();
     MnuStart.Enabled     = false;
     TmrCountdown.Enabled = false;
 }
        private void btnUpdate_Click(object sender, RoutedEventArgs e)
        {
            int num     = Convert.ToInt32(TxtId.Text);
            var updated = myContext.Suppliers.FirstOrDefault(data => data.Id == num);

            if (TxtId.Text == "")
            {
                MessageBox.Show("Fill column id please", "Alert", MessageBoxButton.OK);
                TxtName.Focus();
            }
            else if (TxtName.Text == "")
            {
                MessageBox.Show("Fill column name please", "Alert", MessageBoxButton.OK);
                TxtName.Focus();
            }
            else
            {
                updated.Name  = TxtName.Text;
                updated.Email = TxtEmail.Text;
                var result = myContext.SaveChanges();
                if (result > 0)
                {
                    Load();
                    MessageBox.Show("Updated Success!", "Success", MessageBoxButton.OK);
                }
            }
        }
Exemple #21
0
 private void ClearFields()
 {
     try
     {
         TxtID.Tag             = string.Empty;
         TxtName.Text          = string.Empty;
         TxtAddress.Text       = string.Empty;
         TxtCity.Text          = string.Empty;
         txtPhone1.Text        = string.Empty;
         txtPhone2.Text        = string.Empty;
         txtEmail.Text         = string.Empty;
         txtMobileNo.Text      = string.Empty;
         txtFax.Text           = string.Empty;
         vOpenMode             = false;
         Grid.Enabled          = false;
         TxtFilter.Text        = string.Empty;
         TxtFilter.Enabled     = false;
         ChkInActive.Checked   = false;
         txtContactPerson.Text = string.Empty;
         txtDescription.Text   = string.Empty;
         txtDiscRatio.Text     = string.Empty;
         TxtName.Focus();
     }
     catch (Exception exc)
     {
         MessageBox.Show(exc.Message);
     }
 }
 private void BtnOk_Click(object sender, EventArgs e)
 {
     if (TxtName.Text.Trim() == "")
     {
         TxtName.Focus();
         return;
     }
     if (TxtPassWord.Text.Trim() == "")
     {
         TxtPassWord.Focus();
         return;
     }
     if (TxtName.Text.Trim() != "admin")
     {
         TxtName.Focus();
         MessageBox.Show("请输入正确的帐号!");
         return;
     }
     if (TxtPassWord.Text.Trim() != "6096")
     {
         TxtPassWord.Focus();
         MessageBox.Show("请输入正确的密码!");
         return;
     }
     this.DialogResult = DialogResult.OK;
     this.Close();
 }
        private void Login_Btn(object sender, RoutedEventArgs e)
        {
            //State.Users = API.GetUserByUsername(TxtName.Text.Trim());
            bool checkPassword = API.CheckPassword(API.GetUserByUsername(TxtName.Text.Trim()), TxtPassword.Password);

            if (checkPassword)
            {
                State.Users = API.GetUserByUsername(TxtName.Text.Trim());
                if (State.Users != null)
                {
                    var next_window = new MovieWindow();
                    next_window.Show();
                    this.Close();
                }
            }


            else
            {
                TxtName.Text               = "";
                TxtPassword.Password       = "";
                InvalidUsername.Content    = "Username or password is incorrect";
                InvalidUsername.Visibility = Visibility.Visible;
                TxtName.Focus();
            }
        }
Exemple #24
0
 private void ClearFields()
 {
     try
     {
         // TxtID.Text = string.Empty;
         TxtID.Tag              = string.Empty;
         TxtName.Text           = string.Empty;
         TxtName.Tag            = string.Empty;
         TxtAddress.Text        = string.Empty;
         TxtAddress.Tag         = string.Empty;
         TxtCity.Text           = string.Empty;
         TxtCity.Tag            = string.Empty;
         txtPhone1.Text         = string.Empty;
         txtPhone1.Tag          = string.Empty;
         txtMobileNo.Text       = string.Empty;
         txtNIC.Text            = string.Empty;
         txtCommisionRatio.Text = string.Empty;
         vOpenMode              = false;
         Grid.Enabled           = false;
         TxtName.Focus();
     }
     catch (Exception exc)
     {
         MessageBox.Show(exc.Message);
     }
 }
Exemple #25
0
 private void FrmTextfeldKoppeln_Activated(object sender, EventArgs e)
 {
     TxtName.Focus();
     TxtName.SelectAll();
     Kopplung = true;
     Warning();
 }
Exemple #26
0
        private void FxCancel()
        {
            TxtName.Text    = "";
            TxtIsoCode.Text = "";
            TxtSymbol.Text  = "";

            ChkEnabled.Checked = false;

            TxtName.Enabled    = false;
            TxtIsoCode.Enabled = false;
            TxtSymbol.Enabled  = false;

            ChkEnabled.Enabled = false;

            CmdSave.Enabled = false;

            if (lCurrencyId == 0)
            {
                Text += " - Adicionar";

                TxtName.Enabled    = true;
                TxtIsoCode.Enabled = true;
                TxtSymbol.Enabled  = true;

                ChkEnabled.Checked = true;

                CmdSave.Enabled = true;

                TxtName.Focus();
            }
            else
            {
                Text += " - Modificar";

                DataTable ObjDt = ClsSqlCore.Fx_sel_tblCurrency_detail(lCurrencyId);

                if (ObjDt != null)
                {
                    if (ObjDt.Rows.Count > 0)
                    {
                        TxtName.Text    = ObjDt.Rows[0][0].ToString();
                        TxtIsoCode.Text = ObjDt.Rows[0][2].ToString();
                        TxtSymbol.Text  = ObjDt.Rows[0][3].ToString();

                        ChkEnabled.Checked = ClsFunctions.FxConvertStringToBool(ObjDt.Rows[0][1].ToString());

                        TxtName.Enabled    = true;
                        TxtIsoCode.Enabled = true;
                        TxtSymbol.Enabled  = true;

                        ChkEnabled.Enabled = true;

                        CmdSave.Enabled = true;

                        TxtName.Focus();
                    }
                }
            }
        }
 public LoginWindow()
 {
     InitializeComponent();
     TxtName.Focus();
     this.DataContext = new LoginVM();
     this.CloseAction = new Action(CloseWindow);
     (this.DataContext as LoginVM).CloseAction = this.CloseAction;
 }
 private void ClearTextControl()
 {
     Txtmemberidx.Text      = TxtName.Text = TxtIdentityNumber.Text = TxtDepart.Text = TxtPhoneNumber.Text = TxtIdentityNumber.Text = TxtRank.Text = "";
     Txtmemberidx.ReadOnly  = false;
     Txtmemberidx.BackColor = Color.White;
     TxtName.Focus();
     CboDepart.SelectedIndex = -1;
 }
        private void Button_Aplicar(object sender, RoutedEventArgs e)
        {
            int        result = 0;
            StaffModel staff  = new StaffModel();

            staff.Name    = TxtName.Text.Trim();
            staff.Code    = TxtCode.Text.Trim();
            staff.Active  = CmbActive.Text == "Activo";
            staff.Huella1 = _huella1;
            staff.Huella2 = _huella2;


            if ((!string.IsNullOrEmpty(TxtName.Text.Trim())) || (!string.IsNullOrEmpty(TxtCode.Text.Trim())))
            {
                if (LblId.Content == "0") //ADD
                {
                    result = staffServices.Add(staff);
                    //result = task0.Result;
                    LblId.Content = result.ToString();
                }
                else //EDIT
                {
                    int _id = int.Parse(LblId.Content.ToString());
                    staff.Id = _id;
                    var task = staffServices.Update(staff);
                    result = task ? _id : 0;
                }

                if (result > 0)
                {
                    GRDialogConsultation _var = new GRDialogConsultation();
                    _var.Message = "Registro Guardado, desea crear otro Registro?";
                    if (_var.ShowDialog() == true)
                    {
                        CleanControls();
                        TxtName.Focus();
                    }
                    else
                    {
                        var window = new StaffList();
                        this.Close();
                        window.ShowDialog();
                    }
                }
                else
                {
                    GRDialogError _error = new GRDialogError();
                    _error.Message = "Ocurrion un error al guardar el resgitro";
                    _error.ShowDialog();
                }
            }
            else
            {
                GRDialogInformation _var = new GRDialogInformation();
                _var.Message = "Verificar campos obligatorios";
                _var.ShowDialog();
            }
        }
        /// <summary>Loads the necessary components for the Window.</summary>
        /// <param name="selectedCategory">Selected Major Category</param>
        /// <param name="minorCategory">Selected Minor Category</param>
        /// <param name="isMajor">Is the category being added a Major Category?</param>
        internal void LoadWindow(Category selectedCategory, string minorCategory, bool isMajor)
        {
            _selectedCategory = selectedCategory;
            _minorCategory    = minorCategory;
            _isMajor          = isMajor;

            TxtName.Text = _isMajor ? _selectedCategory.Name : _minorCategory;
            TxtName.Focus();
        }