Ejemplo n.º 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("대상이 지정되지 않았습니다.");
            }
        }
Ejemplo n.º 2
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;
                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("대상이 지정되지 않았습니다.");
            }
        }