Beispiel #1
0
        private void btn_Create_Click(object sender, EventArgs e)
        {
            if (CB_List.Items != null && CB_List.Items.Count > 0)
            {
                string setNameSpace = TB_NameSpace.Text;
                string path         = TB_Location.Text;
                string prefix       = TB_Prefix.Text;

                if (String.IsNullOrWhiteSpace(setNameSpace))
                {
                    MessageBox.Show("네임스페이스가 지정되지 않았습니다.");
                    TB_NameSpace.Focus();
                }
                else if (String.IsNullOrWhiteSpace(path))
                {
                    MessageBox.Show("저장경로가 지정되지 않았습니다.");
                    TB_Location.Focus();
                }
                else
                {
                    pBar.Value = 0;
                    int step    = 100 / CB_List.Items.Count;
                    int c_count = 0;

                    IDbQuery query = new MSSQL();

                    using (var conn = new SqlConnection(this.ConnectionString))
                    {
                        conn.Open();
                        string item = string.Empty;
                        for (int i = 0; i < CB_List.Items.Count; i++)
                        {
                            if (CB_List.GetItemChecked(i))
                            {
                                item = CB_List.Items[i].ToString();
                                if (this.FileWrite(item, conn, setNameSpace, path, query, prefix))
                                {
                                    c_count++;
                                }
                            }
                            pBar.Value += step;
                        }
                        conn.Close();
                    }
                    pBar.Value = 100;
                    TB_Message.AppendText($"{c_count}개의 Entity 파일을 생성했습니다.{Environment.NewLine}");
                    TB_Message.AppendText($"작업이 완료되었습니다.{Environment.NewLine}");
                }
            }
            else
            {
                MessageBox.Show("대상이 지정되지 않았습니다.");
            }
        }
        private void Btn_Create_Click(object sender, EventArgs e)
        {
            if (CB_List.Items != null && CB_List.Items.Count > 0)
            {
                string setNameSpace = TB_NameSpace.Text;
                string path         = TB_Location.Text;
                string prefix       = TB_Prefix.Text;
                bool   IsFrame      = CK_UseFramework.Checked;
                bool   IsOverWrite  = CK_Overwrite.Checked;

                if (String.IsNullOrWhiteSpace(setNameSpace))
                {
                    MessageBox.Show("네임스페이스가 지정되지 않았습니다.");
                    TB_NameSpace.Focus();
                }
                else if (String.IsNullOrWhiteSpace(path))
                {
                    MessageBox.Show("저장경로가 지정되지 않았습니다.");
                    TB_Location.Focus();
                }
                else
                {
                    pBar.Value = 0;
                    int step    = 100 / CB_List.Items.Count;
                    int c_count = 0;

                    string item = string.Empty;
                    for (int i = 0; i < CB_List.Items.Count; i++)
                    {
                        if (CB_List.GetItemChecked(i))
                        {
                            item = CB_List.Items[i].ToString();
                            if (this.FileWrite(item, setNameSpace, path, prefix, IsFrame, IsOverWrite))
                            {
                                c_count++;
                            }
                        }
                        pBar.Value += step;
                    }


                    pBar.Value = 100;
                    MsgWrite($"{c_count}개의 Entity 파일을 생성했습니다.");
                    MsgWrite($"작업이 완료되었습니다.");
                }
            }
            else
            {
                MessageBox.Show("대상이 지정되지 않았습니다.");
            }
        }
        private void btn_output_Click(object sender, EventArgs e)
        {
            if (CB_List.Items != null && CB_List.Items.Count > 0)
            {
                string setNameSpace = TB_NameSpace.Text;
                bool   IsFrame      = CK_UseFramework.Checked;
                string entityName   = string.Empty;

                if (String.IsNullOrWhiteSpace(setNameSpace))
                {
                    MessageBox.Show("네임스페이스가 지정되지 않았습니다.");
                    TB_NameSpace.Focus();
                }
                else
                {
                    int chkCount = 0;
                    for (int i = 0; i < CB_List.Items.Count; i++)
                    {
                        if (CB_List.GetItemChecked(i))
                        {
                            entityName = CB_List.Items[i].ToString();
                            chkCount++;
                        }
                    }

                    if (chkCount == 1)
                    {
                        MsgClear();
                        MsgWrite(CreateText(entityName, setNameSpace, IsFrame));
                    }
                    else
                    {
                        MessageBox.Show("OUTPUT대상은 하나만 지정할 수 있습니다.");
                    }
                }
            }
            else
            {
                MessageBox.Show("대상이 지정되지 않았습니다.");
            }
        }