示例#1
0
        public void FillGrid()
        {
            DataTable dt = ConvertListToDataTable.ConvertTo <Category>(_service.GetALL());

            gvResultCategories.DataSource = dt;
            VisualAspectGrid();
        }
示例#2
0
        private void FillGrid()
        {
            DataTable dt = ConvertListToDataTable.ConvertTo <Recipe>(_service.GetALL());

            gvResultRecepies.DataSource = dt;
            VisualAspectGrid();
        }
示例#3
0
        private void FillGrid()
        {
            DataTable dt = ConvertListToDataTable.ConvertTo <Ingredient>(_service.GetALL());

            gvResultIngredients.DataSource = dt;
            VisualAspectGrid();
        }
示例#4
0
        private void FillComboBoxes()
        {
            //DataTable dtCategory = ConvertListToDataTable.ConvertTo<Category>(_cService.GetALL());
            //cbCategory.DataSource = dtCategory;
            //foreach (Category name in _cService.GetALL())
            //{
            //    cbCategory.Items.Add(name);
            //}
            List <Category> categories    = _cService.GetALL();
            var             categoriesArr = categories.ToArray();

            cbCategory.Items.AddRange(categoriesArr);

            cbCategory.DisplayMember = "Name";
            //cbCategory.ValueMember = "ID";

            DataTable dtIngredients = ConvertListToDataTable.ConvertTo <Ingredient>(_iService.GetALL());

            cbIngredients.DataSource = dtIngredients;

            //foreach (Ingredient ingredient in _iService.GetALL())
            //{
            //    cbIngredients.Items.Add(ingredient);
            //}
            cbIngredients.DisplayMember = "Name";
            cbIngredients.ValueMember   = "ID";


            foreach (var item in Enum.GetValues(typeof(Difficulty)))
            {
                cbDifficulty.Items.Add(item);
            }
        }
示例#5
0
 private void FillGrid()
 {
     if (_title == "Receitas - Validar")
     {
         lblTitle.Text = "――――――   VALIDAR   ――――――";
         DataTable dt = ConvertListToDataTable.ConvertTo <Recipe>(_service.GetALL());
         gvResultRecepies.DataSource = dt;
         btUpdateFalse.Visible       = true;
         VisualAspectGrid();
     }
     else if (_title == "Receitas - Alterar")
     {
         lblTitle.Text  = "――――――   ALTERAR   ――――――";
         btUpdate.Text  = "Alterar";
         btUpdate.Image = Properties.Resources.diskette;
         DataTable dt = ConvertListToDataTable.ConvertTo <Recipe>(_service.GetALL());
         gvResultRecepies.DataSource = dt;
         VisualAspectGrid();
     }
     else
     {
         lblTitle.Text  = "――――――   ELIMINAR   ――――――";
         btUpdate.Text  = "Eliminar";
         btUpdate.Image = Properties.Resources.delete;
         DataTable dt = ConvertListToDataTable.ConvertTo <Recipe>(_service.GetALL());
         gvResultRecepies.DataSource = dt;
         VisualAspectGrid();
     }
     VisualAspectGrid();
 }
 public void FillGrid()
 {
     if (_title == "Categorias - Alterar")
     {
         lblTitle.Text = "――――――   ALTERAR   ――――――";
         DataTable dt = ConvertListToDataTable.ConvertTo <Category>(_service.GetALL());
         gvResultCategories.DataSource = dt;
         VisualAspectGrid();
     }
     else
     {
         lblTitle.Text  = "――――――   ELIMINAR   ――――――";
         btUpdate.Text  = "Eliminar";
         btUpdate.Image = Properties.Resources.delete;
         DataTable dt = ConvertListToDataTable.ConvertTo <Category>(_service.GetALL());
         gvResultCategories.DataSource = dt;
         VisualAspectGrid();
     }
 }
示例#7
0
        /// <summary>
        /// 저장버튼 클릭
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnSave_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            try
            {
                DataTable dtParamMaster = new DataTable();
                DataTable dtParamChute  = new DataTable();

                dtParamMaster = this.CreateDataTableSchema(dtParamMaster);

                var liSelectedMaster    = this.MasterViewList.Where(p => p.IsSelected && p.IsUpdate).ToList();
                var liSelectedChuteView = this.ChuteMapViewList.Where(p => p.IsSelected && p.IsUpdate).ToList();

                if (liSelectedMaster.Count == 0 && liSelectedChuteView.Count == 0)
                {
                    // 저장할 데이터가 없습니다.
                    this.BaseClass.MsgError("");
                    return;
                }

                #region + 소터분류설정 마스터 저장 대상 데이터
                var dtMaster = ConvertListToDataTable.ConvertToDataTable(liSelectedMaster);
                dtMaster.Columns.RemoveAt(0);

                for (int i = dtMaster.Columns.Count - 1; i >= 16; i--)
                {
                    dtMaster.Columns.RemoveAt(i);
                }

                DataRow drRow  = null;
                int     iSeqNo = 0;

                for (int i = 0; i < dtMaster.Rows.Count; i++)
                {
                    iSeqNo++;

                    for (int j = 0; j < dtMaster.Columns.Count; j++)
                    {
                        drRow              = dtParamMaster.NewRow();
                        drRow["COL_SEQ"]   = iSeqNo;                                    // 순번
                        drRow["COL_NM"]    = dtMaster.Columns[j].ColumnName;            // 컬럼명
                        drRow["COL_VALUE"] = dtMaster.Rows[i][j].ToString();            // 컬럼값
                        dtParamMaster.Rows.Add(drRow);
                    }
                }
                #endregion

                #region + 소터분류설정 상세 저장 대상 데이터
                var dtChute = ConvertListToDataTable.ConvertToDataTable(liSelectedChuteView);
                dtChute.Columns.RemoveAt(0);

                for (int i = dtChute.Columns.Count - 1; i >= 16; i--)
                {
                    dtChute.Columns.RemoveAt(i);
                }

                drRow  = null;
                iSeqNo = 0;

                for (int i = 0; i < dtChute.Rows.Count; i++)
                {
                    iSeqNo++;

                    for (int j = 0; j < dtChute.Columns.Count; j++)
                    {
                        drRow              = dtParamChute.NewRow();
                        drRow["COL_SEQ"]   = iSeqNo;                                    // 순번
                        drRow["COL_NM"]    = dtChute.Columns[j].ColumnName;             // 컬럼명
                        drRow["COL_VALUE"] = dtChute.Rows[i][j].ToString();             // 컬럼값
                        dtParamChute.Rows.Add(drRow);
                    }
                }
                #endregion

                using (BaseDataAccess da = new BaseDataAccess())
                {
                    var isRtnValue = this.SaveSP_CFG_MST_SAVE(da, dtParamMaster);
                }
            }
            catch (Exception err)
            {
                this.BaseClass.Error(err);
            }
        }