//clear workset
        private void BtnClear_Click(object sender, RoutedEventArgs e)
        {
            TbName.Clear();
            TbSize.Clear();
            TbType.Clear();
            TbSubtype.Clear();
            TbAlignment.Clear();
            TbAC.Clear();
            TbHP.Clear();
            TbSpeed.Clear();

            TbSTR.Clear();
            TbDEX.Clear();
            TbCON.Clear();
            TbINT.Clear();
            TbWIS.Clear();
            TbCHA.Clear();

            TbSaving.Clear();
            TbSkills.Clear();
            temp_actions.Clear();
            temp_reactions.Clear();
            temp_specialabilities.Clear();
            temp_legendaryactions.Clear();
            LbSaving.Items.Clear();
            LbSkills.Items.Clear();
            CbSaving.SelectedIndex = 0;
            CbSkills.SelectedIndex = 0;
            TbDamImm.Clear();
            TbDamRes.Clear();
            TbDamVul.Clear();
            TbConImm.Clear();
            TbChall.Clear();
        }
Пример #2
0
 private void Edit(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrWhiteSpace(TbName.Text))
     {
         MB.MessageBoxInfo("Введите наименование отдела");
         TbName.Focus();
     }
     else if (string.IsNullOrWhiteSpace(TbDaysWorking.Text))
     {
         MB.MessageBoxInfo("Введите рабочие дни");
         TbDaysWorking.Focus();
     }
     else if (string.IsNullOrWhiteSpace(TbTimeWorking.Text))
     {
         MB.MessageBoxInfo("Введите время работы");
         TbTimeWorking.Focus();
     }
     else if (string.IsNullOrWhiteSpace(TbTotalAmount.Text))
     {
         MB.MessageBoxInfo("Введите общее количество мест");
         TbTotalAmount.Focus();
     }
     else
     {
         try
         {
             DataService.GetContext().SaveChanges();
             MB.MessageBoxInfo("Вы успешно изменили отдел");
         }
         catch (Exception ex)
         {
             MB.MessageBoxError(ex.Message);
         }
     }
 }
Пример #3
0
        public IActionResult Sort_API()
        {
            //tbname,字段规则
            string orderStr = DataConvert.CStr(RequestEx["orderStr"]).Trim(',');

            if (string.IsNullOrEmpty(orderStr))
            {
                return(Content(Failed.ToString()));
            }
            string[] orderArr = orderStr.Split(',');
            foreach (string item in orderArr)
            {
                int id    = DataConvert.CLng(item.Split(':')[0]);
                int order = DataConvert.CLng(item.Split(':')[1]);
                switch (TbName.ToLower())
                {
                case "commonmodel":
                    DBCenter.UpdateSQL(TableName, "OrderID=" + order, "GeneralID=" + id);
                    break;

                case "product":
                    DBCenter.UpdateSQL(TableName, "OrderID=" + order, "ID=" + id);
                    break;

                case "modelfield":
                    DBCenter.UpdateSQL(TableName, "OrderID=" + order, "FieldID=" + id);
                    break;
                }
            }
            return(Content(Success.ToString()));
        }
Пример #4
0
 private void cleanForm()
 {
     refreshForm();
     SpBtStredisko.SelectedIndex = -1;
     TbName.Clear();
     TbName.Focus();
 }
Пример #5
0
        private bool IsValid()
        {
            TbName.GetBindingExpression(TextBox.TextProperty).UpdateSource();
            CbGender.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateSource();

            return(!Validation.GetHasError(TbName) && !Validation.GetHasError(CbGender));
        }
Пример #6
0
 public EditUser()
 {
     this.UpdateLanguage();
     InitializeComponent();
     ViewModel.View = this;
     TbName.Focus();
 }
Пример #7
0
        private void ClearCardDetailControls()
        {
            foreach (Control control in gBCardDetails.Controls)
            {
                if (control is TextBox textBox)
                {
                    textBox.Text = "";
                }
                else if (control is NumericUpDown numericUpDown)
                {
                    numericUpDown.Value = 0;
                }
                else if (control.Name == cBFactions.Name)
                {
                    for (int i = 0; i < cBFactions.Items.Count; i++)
                    {
                        if (((Faction)cBFactions.Items[i]).Name == "Mercenary")
                        {
                            cBFactions.SelectedIndex = i;
                            break;
                        }
                    }
                }
                else if (control is ComboBox comboBox)
                {
                    if (comboBox.Items.Count > 0)
                    {
                        comboBox.SelectedIndex = 0;
                    }
                }
            }

            TbName.Focus();
        }
Пример #8
0
 private void ClearValidationErrors()
 {
     TbName.ClearValue(TextBox.BorderBrushProperty);
     TbAddress.ClearValue(TextBox.BorderBrushProperty);
     TbPhone.ClearValue(TextBox.BorderBrushProperty);
     RbDelivered.ClearValue(TextBox.BorderBrushProperty);
     RbPickup.ClearValue(TextBox.BorderBrushProperty);
 }
Пример #9
0
        /// <summary>Проверка введенных данных на наличие пустых полей</summary>
        /// <returns>true - все заполнено, false - требуется заполнение</returns>
        private bool CheckEmptyData()
        {
            if (string.IsNullOrEmpty(Item.Name))
            {
                ModPlusAPI.Windows.MessageBox.Show(ModPlusAPI.Language.GetItem(LangItem, "msg39"));
                TbName.Focus();
                return(false);
            }

            if (Item.Path.Equals("Блоки/"))
            {
                ModPlusAPI.Windows.MessageBox.Show(ModPlusAPI.Language.GetItem(LangItem, "msg40"));
                CbPath.Focus();
                return(false);
            }

            if (!_isEdit)
            {
                var db = AcApp.DocumentManager.MdiActiveDocument.Database;
                if (ChkIsCurrentDwgFile.IsChecked != null && ChkIsCurrentDwgFile.IsChecked.Value)
                {
                    if (!db.Filename.Contains(_dwgBaseFolder))
                    {
                        var fi = new FileInfo(db.Filename);
                        if (File.Exists(db.Filename))
                        {
                            ModPlusAPI.Windows.MessageBox.Show(
                                ModPlusAPI.Language.GetItem(LangItem, "msg41") + Environment.NewLine +
                                ModPlusAPI.Language.GetItem(LangItem, "msg42") + " - " + _dwgBaseFolder + Environment.NewLine +
                                ModPlusAPI.Language.GetItem(LangItem, "msg43") + " - " + fi.DirectoryName +
                                Environment.NewLine + ModPlusAPI.Language.GetItem(LangItem, "msg44")
                                );
                        }
                        else
                        {
                            ModPlusAPI.Windows.MessageBox.Show(
                                ModPlusAPI.Language.GetItem(LangItem, "msg45") +
                                Environment.NewLine + ModPlusAPI.Language.GetItem(LangItem, "msg44")
                                );
                        }

                        return(false);
                    }
                }
                else
                {
                    if (string.IsNullOrEmpty(Item.SourceFile))
                    {
                        ModPlusAPI.Windows.MessageBox.Show(ModPlusAPI.Language.GetItem(LangItem, "msg46"));
                        return(false);
                    }
                }
            }

            return(true);
        }
Пример #10
0
 private void DoFocus()
 {
     if (string.IsNullOrEmpty(Vm.Name))
     {
         TbName.Focus();
     }
     else if (string.IsNullOrEmpty(Vm.Description))
     {
         MTbDescription.Focus();
     }
 }
 //Clears all text boxes after a spell is added
 public void ClearTB()
 {
     TbSearch.Clear();
     TbName.Clear();
     TbLevel.Clear();
     TbSchool.Clear();
     TbTime.Clear();
     TbRange.Clear();
     TbComponents.Clear();
     TbDuration.Clear();
     TbAvailableClass.Clear();
     TbDescription.Clear();
 }
Пример #12
0
        public IActionResult Sort()
        {
            ViewBag.TbName = TbName;
            DataTable dt     = new DataTable();
            string    fields = "";

            string where = "";
            switch (TbName.ToLower())
            {
            case "commonmodel":
            {
                if (!string.IsNullOrEmpty(Ids))
                {
                    SafeSC.CheckIDSEx(Ids);
                    where += " GeneralID IN (" + Ids + ")";
                }
                fields = "GeneralID AS id,OrderID AS [order],title,Inputer AS remind";
                dt     = DBCenter.SelWithField(TableName, fields, where, "OrderID DESC");
            }
            break;

            case "product":
            {
                if (!string.IsNullOrEmpty(Ids))
                {
                    SafeSC.CheckIDSEx(Ids);
                    where += " ID IN (" + Ids + ")";
                }
                fields = "id,OrderID AS [order],ProName AS title,ProInfo AS remind";
                dt     = DBCenter.SelWithField(TableName, fields, where, "OrderID DESC");
            }
            break;

            case "modelfield":    //模型
            {
                int modelId = DataConvert.CLng(RequestEx["modelId"]);
                fields = "FieldID AS id,OrderID as [order],FieldAlias AS title,FieldName as remind";
                where  = "ModelID=" + modelId + " AND sys_type=0";
                dt     = DBCenter.SelWithField(TableName, fields, where, "OrderID ASC");
            }
            break;
                //case "node"://对父栏目下子节点排序
                //    {
                //        int pid = DataConvert.CLng(Request["pid"]);
                //    }
                //break;
            }
            return(View(dt));
        }
Пример #13
0
        private bool IsValid(bool isEdit)
        {
            if (!isEdit)
            {
                TbUsername.GetBindingExpression(TextBox.TextProperty).UpdateSource();
                PbPassword.GetBindingExpression(PasswordHelper.PasswordProperty).UpdateSource();
            }
            CbGender.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateSource();
            DpBirthDate.GetBindingExpression(DatePicker.SelectedDateProperty).UpdateSource();
            TbName.GetBindingExpression(TextBox.TextProperty).UpdateSource();
            TbEmail.GetBindingExpression(TextBox.TextProperty).UpdateSource();
            TbPhoneNumber.GetBindingExpression(TextBox.TextProperty).UpdateSource();
            TbAddress.GetBindingExpression(TextBox.TextProperty).UpdateSource();

            return(!Validation.GetHasError(CbGender) && !Validation.GetHasError(DpBirthDate) && !Validation.GetHasError(TbName) &&
                   !Validation.GetHasError(TbEmail) && !Validation.GetHasError(TbPhoneNumber) && !Validation.GetHasError(TbAddress) &&
                   (!isEdit || (!Validation.GetHasError(TbUsername) && !Validation.GetHasError(PbPassword))));
        }
Пример #14
0
        protected virtual void BtSave_Click(object sender, RoutedEventArgs e)
        {
            if (cbDir.SelectedIndex < 0)
            {
                MessageForms.MessageForms.MessageBoxMessage("Укажите направление");
                cbDir.Focus();
                return;
            }

            if (string.IsNullOrWhiteSpace(TbName.Text))
            {
                MessageForms.MessageForms.MessageBoxMessage("Укажите название");
                TbName.Focus();
                return;
            }

            if (string.IsNullOrWhiteSpace(tbCode.Text))
            {
                MessageForms.MessageForms.MessageBoxMessage("Укажите код специальности");
                tbCode.Focus();
                return;
            }

            _specialty = grids.DataContext as Specialty;

            Direction d = cbDir.SelectedItem as Direction;

            _specialty.DirectionId = d.DirectionId;

            try
            {
                Controllers.SpecialtyController cont = new Controllers.SpecialtyController(_specialty);
                cont.Add();
                MessageForms.MessageForms.MessageBoxMessage("Объект добавлен  в БД");
                DialogResult = true;
                Close();
            }
            catch (Exception ex)
            {
                MessageForms.MessageForms.MessageBoxMessage(ex.Message);
            }
        }
Пример #15
0
        private async void BtTake_Click(object sender, RoutedEventArgs e)
        {
            DataGridData lw = (DataGridData)OpenTopics.SelectedItem;

            if (lw == null)
            {
                await this.ShowMessageAsync("Chyba", "Prosím vyber chybu");

                return;
            }
            int    id     = lw.poruchy_Id;
            string nameMt = TbName.Text;

            if (String.IsNullOrEmpty(nameMt))
            {
                await this.ShowMessageAsync("Chyba", "Prosím doplň jméno");

                return;
            }
            db.updateTakeOver(id, nameMt);
            TbName.Clear();
            getDbData();
        }
Пример #16
0
 private void DoFocus()
 {
     TbName.Focus();
 }
Пример #17
0
 public MainWindow()
 {
     InitializeComponent();
     getStredisko();
     TbName.Focus();
 }
        public WorkTaskAddView()
        {
            InitializeComponent();

            TbName.Focus();
        }
        public WorkProjectAddView()
        {
            InitializeComponent();

            TbName.Focus();
        }
Пример #20
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtUpdate_Click(object sender, RoutedEventArgs e)
        {
            var name = TbName.Text.Trim();

            if (string.IsNullOrWhiteSpace(name))
            {
                LcError.Text = "名称不能为空!";
                TbName.Focus();
                return;
            }

            var method = CbMethod.SelectedItem as MethodDto;

            if (method == null)
            {
                LcError.Text = "请选择一个操作!";
                CbMethod.Focus();
                return;
            }

            var srcFile = TbSrcFile.Text.Trim();

            if (string.IsNullOrWhiteSpace(srcFile))
            {
                LcError.Text = "来源文件不能为空!";
                TbSrcFile.Focus();
                return;
            }

            var srcPath = TbSrcPath.Text.Trim();

            if (string.IsNullOrWhiteSpace(srcPath) && string.IsNullOrWhiteSpace(srcFile))
            {
                LcError.Text = "来源文件及路径不能同时为空!";
                TbSrcPath.Focus();
                return;
            }

            var dstPath = TbDstPath.Text.Trim();

            if (string.IsNullOrWhiteSpace(srcFile))
            {
                LcError.Text = "目标路径不能为空!";
                TbDstPath.Focus();
                return;
            }

            var dstFile = TbDstFile.Text.Trim();

            if (string.IsNullOrWhiteSpace(dstFile) && string.IsNullOrWhiteSpace(dstPath))
            {
                LcError.Text = "目标文件及路径不能同时为空!";
                TbDstFile.Focus();
                return;
            }

            var repeat = CbRepeat.SelectedItem as RepeatDto;

            if (repeat == null)
            {
                LcError.Text = "请选择重名处理!";
                CbRepeat.Focus();
                return;
            }

            _Dto.name        = name;
            _Dto.method      = method.key;
            _Dto.src_file    = srcFile;
            _Dto.src_path    = srcPath;
            _Dto.dst_path    = dstPath;
            _Dto.dst_file    = dstFile;
            _Dto.repeat      = repeat.key;
            _Dto.status      = RuleDto.STATUS_1;
            _Dto.update_time = DateTime.Now;

            if (_Dto.create_time < DateTime.MinValue)
            {
                _Dto.create_time = _Dto.update_time;
            }

            new RuleDao().Save(_Dto);

            DialogResult = true;
            Close();
        }
Пример #21
0
        private bool IsValid()
        {
            TbName.GetBindingExpression(TextBox.TextProperty).UpdateSource();

            return(!Validation.GetHasError(TbName));
        }