Beispiel #1
0
        private void iAddParameter_Click(object sender, EventArgs e)
        {
            fwk_Param parent = null;

            if (_param.ParentId.HasValue)
            {
                parent = _AllParams.Where(p => p.ParamId.Equals(_param.ParentId.Value)).FirstOrDefault <fwk_Param>();
            }

            using (frmAddParam frm = new frmAddParam(parent))
            {
                if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    try
                    {
                        //TODO: Latter
                        MultilanguageDAC.Param_CreateNew(frm.Param);
                    }
                    catch (Exception ex)
                    {
                        this.ExceptionViewer.Show(ex);
                    }
                    this.Init();
                }
            }
        }
Beispiel #2
0
        private void removeSelectedsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_fwk_ConfigManager != null)
            {
                string key   = _fwk_ConfigManager["key"].ToString();
                string group = _fwk_ConfigManager["group"].ToString();

                MultilanguageDAC.Remove(group, key);
            }
            this.PopulateAsync();
        }
Beispiel #3
0
 private void iRemoveParameter_Click(object sender, EventArgs e)
 {
     if (_param != null)
     {
         try
         {
             MultilanguageDAC.Param_ValidateRemove(_param);
             MultilanguageDAC.Param_Remove(_param.Id);
             Init();
         }
         catch (Exception ex)
         {
             this.ExceptionViewer.Show(ex);
         }
     }
 }
Beispiel #4
0
        private void gridView2_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            string language = e.Column.ToString();
            string key      = gridView_config.GetDataRow(e.RowHandle)["key"].ToString();
            string group    = gridView_config.GetDataRow(e.RowHandle)["group"].ToString();


            try
            {
                MultilanguageDAC.CreateORUpdateKey(language, group, key, e.Value.ToString().Trim());
            }
            catch (Exception ex)
            {
                this.ExceptionViewer.Show(ex);
            }
        }
Beispiel #5
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            errorProvider1.Clear();
            if (String.IsNullOrEmpty(txtName.Text))
            {
                errorProvider1.SetError(txtName, "Ingrese el nobre de la clave");
                return;
            }
            int res = 0;

            Int32.TryParse(txtParamId.Text.Trim(), out res);
            if (res == 0)
            {
                errorProvider1.SetError(txtParamId, "Ingrese solo valores numericos para el codigo EJ: 1000, 2001, 89, etc ");
                return;
            }

            _Param         = new fwk_Param();
            _Param.ParamId = res;
            if (_Parent != null)
            {
                _Param.ParentId = _Parent.ParamId;
            }
            _Param.Name        = txtName.Text;
            _Param.Description = txtDescription.Text;
            String culture = comboBoxEdit1.Text.Trim().Split(',')[0];

            if (String.IsNullOrEmpty(culture))
            {
                culture = "es-AR";
            }
            _Param.Culture = culture.Trim();
            try
            {
                MultilanguageDAC.Param_CreateNew_Validate_Existent(_Param);
            }
            catch (Exception ex)
            {
                errorProvider1.SetError(txtParamId, ex.Message);
                //this.ExceptionViewer.Show(ex);
                return;
            }
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }
Beispiel #6
0
 private void iAppendChilds_Click(object sender, EventArgs e)
 {
     using (frmAddParam frm = new frmAddParam(_param))
     {
         if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             try
             {
                 MultilanguageDAC.Param_CreateNew(frm.Param);
             }
             catch (Exception ex)
             {
                 this.ExceptionViewer.Show(ex);
             }
             this.Init();
         }
     }
 }
Beispiel #7
0
        private void gridView_Params_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            _param = ((fwk_Param)gridView_Params.GetRow(e.RowHandle));
            if (_param == null)
            {
                return;
            }

            try
            {
                MultilanguageDAC.Param_ValidateUpdate(_param);
                MultilanguageDAC.Param_Update(_param);
                Init();
            }
            catch (Exception ex)
            {
                this.ExceptionViewer.Show(ex);
            }
        }
Beispiel #8
0
        private void iNewParamWithoutParent_Click(object sender, EventArgs e)
        {
            fwk_Param parent = null;


            using (frmAddParam frm = new frmAddParam(parent))
            {
                if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    try
                    {
                        //TODO: Latter
                        MultilanguageDAC.Param_CreateNew(frm.Param);
                    }
                    catch (Exception ex)
                    {
                        this.ExceptionViewer.Show(ex);
                    }
                    this.Init();
                }
            }
        }
Beispiel #9
0
        private void addNewKeyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string group = _fwk_ConfigManager["group"].ToString();

            using (frmAdd frm = new frmAdd(group))
            {
                if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    string key    = frm.Key;
                    string errMsg = string.Empty;
                    try
                    {
                        MultilanguageDAC.CreateNewKey(group, key, out errMsg);
                        this.MessageViewer.Show(errMsg);
                    }
                    catch (Exception ex)
                    {
                        this.ExceptionViewer.Show(ex);
                    }
                    this.PopulateAsync();
                }
            }
        }
Beispiel #10
0
        Task <List <String> > FillCulture()
        {
            Task <List <String> > task = Task <List <String> > .Run(() => MultilanguageDAC.RetriveCulturesArray());

            return(task);
        }
Beispiel #11
0
        Task <List <fwk_Param> > LoadParamsAsync()
        {
            Task <List <fwk_Param> > task = Task <List <fwk_Param> > .Run(() => MultilanguageDAC.Params_Retrive());

            return(task);
        }