using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Project.Dialog
{
	public partial class RegExPrintRule : Form
	{
		public RegExPrintRule()
		{
			InitializeComponent();
		}

		private void RegExRule_Load(object sender, EventArgs e)
		{
		
			RefreshList();
		}

		private void component_Reel_RegExRuleBindingNavigatorSaveItem_Click(object sender, EventArgs e)
		{
			this.Validate();
			this.bs.EndEdit();
			this.tam.UpdateAll(this.dataSet1);

			var modelName = PUB.Result.vModel.Title;
			PUB.Result.BCDPrintPattern = PUB.GetPrintPatterns();
			PUB.log.Add($"모델프린트패턴로딩:{PUB.Result.BCDPrintPattern.Count}");
		}

		private void RefreshList()
		{
			try
			{
				this.ta.Fill(this.dataSet1.K4EE_Component_Reel_PrintRegExRule);
				component_Reel_RegExRuleDataGridView.AutoResizeColumns();
			}
			catch (System.Exception ex)
			{
				System.Windows.Forms.MessageBox.Show(ex.Message);
			}

		}

		private void toolStripButton1_Click(object sender, EventArgs e)
		{
			RefreshList();
		}

		
	}
}
