Example #1
0
        private void ubtnReg_Click(object sender, EventArgs e)
        {
            FormDlgModelEdit.CaptionString = "모델 등록";
            var userAdd = new FormDlgModelEdit();

            if (userAdd.ShowDialog() == DialogResult.OK)
            {
                string[] AddedData = userAdd.InputData;
                if (Model_Reg_DoubleCheck(AddedData) == false)
                {
                    var messageBox = new Control_UltraMessageBox();

                    if (messageBox.MessageBox_Show("모델 변경", "적용 모델 변경",
                                                   "다른 모델 정보와 중복되는 모델 정보입니다.<br/><br/>확인 후에 다시 작업하여 주십시요!", MessageBoxButtons.OK,
                                                   MessageBoxIcon.Information) == DialogResult.OK)
                    {
                        return;
                    }
                }

                UltraDataRow rowRead;
                this.uDataSource.Rows.Add();
                rowRead       = this.uDataSource.Rows[this.uDataSource.Rows.Count - 1];
                rowRead["NO"] = this.uDataSource.Rows.Count;
                //rowRead["Name"] = AddedData[0];
                //rowRead["RecipeNo"] = AddedData[1];

                rowRead["Name"]     = userAdd.GetSet_Model_Name;
                rowRead["RecipeNo"] = userAdd.GetSet_Model_Number;

                this.GridScrollCheck();
                //this.uGridExcelExporter.Export(this.Model_uGrid1, FileName);

                _strModelName   = userAdd.GetSet_Model_Name;
                _strModelNumber = userAdd.GetSet_Model_Number;

                bool modelAdd = ModelAdding(_strModelName, _strModelNumber);
            }
        }
Example #2
0
        private void ubtnEdit_Click(object sender, EventArgs e)
        {
            if (Model_Select_uText01.Text == "")
            {
                return;
            }

            var messageBox = new Control_UltraMessageBox();

            if (Model_Current_uText01.Text == Model_Select_uText01.Text &&
                Model_Current_uText02.Text == Model_Select_uText02.Text)
            {
                messageBox.MessageBox_Show("모델 수정", "등록 모델 정보 수정",
                                           "모델 수정 오류 발생<br/><br/>현재 적용되어 있는 모델은 삭제할 수 없습니다.", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            int SelectRow = this.Model_uGrid1.ActiveRow.Index;

            Infragistics.Win.UltraWinGrid.CellsCollection CuurrentRow = this.Model_uGrid1.Rows[SelectRow].Cells;
            //string[] EditValue = {CuurrentRow[1].Value.ToString(), CuurrentRow[2].Value.ToString(),CuurrentRow[3].Value.ToString()};
            string[] EditValue = { CuurrentRow[1].Value.ToString(), CuurrentRow[2].Value.ToString() };
            FormDlgModelEdit.CaptionString = "모델 수정";
            var userAdd = new FormDlgModelEdit();

            userAdd.InputData = EditValue;
            userAdd.EditDataDisplay();

            if (userAdd.ShowDialog() == DialogResult.OK)
            {
                string[] EditedData = userAdd.InputData;

                string modelNameOld     = EditValue[0] + "-" + EditValue[1] + ".rcp";
                string oldModelFileName = Environment.CurrentDirectory + "\\Data\\ModelData\\" + modelNameOld;
                //string oldModelFileName = Environment.CurrentDirectory + "\\ModelData\\" + modelNameOld;

                string modelNameNew     = EditedData[0] + "-" + EditedData[1] + ".rcp";
                string newModelFileName = Environment.CurrentDirectory + "\\Data\\ModelData\\" + modelNameNew;
                //string newModelFileName = Environment.CurrentDirectory + "\\ModelData\\" + modelNameNew;

                System.IO.File.Move(oldModelFileName, newModelFileName);

                //FileInfo fileRename = new FileInfo(newModelFileName);
                //if (fileRename.Exists == true)
                //{

                //MessageBox.Show("이미 파일이 존재합니다. 확인하여 주십시요 !");
                //fileRename.Delete();
                //return;
                //System.IO.File.Move(oldname, newname);
                //}

                UltraDataRow rowRead = this.uDataSource.Rows[SelectRow];
                //string oldName = this.Model_uGrid1.Rows[SelectRow].Cells[1].Value.ToString();
                //string oldNo = this.Model_uGrid1.Rows[SelectRow].Cells[2].Value.ToString();

                rowRead["NO"]       = SelectRow + 1;
                rowRead["Name"]     = EditedData[0];
                rowRead["RecipeNo"] = EditedData[1];

                //ModelFile_Name_Change(oldName, oldNo, EditedData[0], EditedData[1]);

                this.GridScrollCheck();
                //this.uGridExcelExporter.Export(this.Model_uGrid1, FileName);
            }
            Model_uGrid1_NowRowDisplay();
        }