예제 #1
0
        public static Dictionary <string, string> CreateAspxcs(string name_space, string model_staff, string dal_staff, int action)
        {
            Dictionary <string, string> result = new Dictionary <string, string>();

            foreach (var item in tbDic)
            {
                string text = string.Empty;
                if (PageCache.UIType == 0)
                {
                    text = AspxCsHelper_EasyUI.CreateASPXCS(name_space, item.Key, action, item.Value, item.Key + model_staff, item.Key + dal_staff);
                }
                else if (PageCache.UIType == 1)
                {
                    text = AspxCsHelper_Bootstrap.CreateASPXCS(name_space, item.Key, action, item.Value, item.Key + model_staff, item.Key + dal_staff);
                }

                result.Add(item.Key + ".aspx.cs", text);
            }

            return(result);
        }
예제 #2
0
        private void btnGenerate_Click(object sender, EventArgs e)
        {
            Button btn = sender as Button;

            if (btn.Text == "Model")
            {
                #region Model
                int modelType = PageCache.ModelStyle;
                if (modelType == 0)
                {
                    string modelStr = ModelHelper_Default.CreateModel();
                    this.txtResult.Text = modelStr;
                }
                else if (modelType == 1)
                {
                    string modelStr = ModelHelper_DefaultAttribute.CreateModel();
                    this.txtResult.Text = modelStr;
                }
                else
                {
                    string modelStr = ModelHelper_DefaultLowerField.CreateModel();
                    this.txtResult.Text = modelStr;
                }
                #endregion
            }
            else if (btn.Text == "Aspx")
            {
                #region Aspx
                int uitype = PageCache.UIType;
                if (uitype == 0)
                {
                    // easyui
                    string modelStr = AspxHelper_EasyUI.CreateASPX();
                    this.txtResult.Text = modelStr;
                }
                else if (uitype == 1)
                {
                    // bootstarp
                    string modelStr = AspxHelper_Bootstrap.CreateASPX();
                    this.txtResult.Text = modelStr;
                }
                #endregion
            }
            else if (btn.Text == "Aspx.cs")
            {
                #region Aspx.cs
                int uitype = PageCache.UIType;
                if (uitype == 0)
                {
                    // easyui
                    string modelStr = AspxCsHelper_EasyUI.CreateASPXCS();

                    this.txtResult.Text = modelStr;
                }
                else if (uitype == 1)
                {
                    // bootstarp
                    string modelStr = AspxCsHelper_Bootstrap.CreateASPXCS();
                    this.txtResult.Text = modelStr;
                }
                #endregion
            }
            else if (btn.Text == "DAL")
            {
                #region DAL
                int uitype = PageCache.UIType;
                int dbtype = PageCache.DbType;
                int dbtool = PageCache.DbTool;
                if (dbtool == 0)
                {
                    if (uitype == 0)
                    {
                        // easyui
                        if (dbtype == 0)
                        {
                            // mysql
                            string modelStr = DALHelper_EasyUI_MySql.CreateDAL();

                            this.txtResult.Text = modelStr;
                        }
                        else if (dbtype == 1)
                        {
                            // mssql
                            string modelStr = DALHelper_EasyUI_MsSql.CreateDAL();

                            this.txtResult.Text = modelStr;
                        }
                    }
                    else if (uitype == 1)
                    {
                        // bootstarp
                        if (dbtype == 0)
                        {
                            // mysql
                            string modelStr = DALHelper_Bootstrap_MySql.CreateDAL();
                            this.txtResult.Text = modelStr;
                        }
                        else if (dbtype == 1)
                        {
                            // mssql
                            string modelStr = DALHelper_Bootstrap_MsSql.CreateDAL();
                            this.txtResult.Text = modelStr;
                        }
                    }
                }
                else if (dbtool == 1)
                {
                    string modelStr = DALHelper_Dapper.CreateDAL();

                    this.txtResult.Text = modelStr;
                }
                #endregion
            }
            else if (btn.Text == "Factory")
            {
                #region Factory
                int dbtype = PageCache.DbType;
                int dbtool = PageCache.DbTool;
                if (dbtool == 0)
                {
                    if (dbtype == 0)
                    {
                        // mysql
                        string modelStr = FactoryHelper_MySql.CreateFactory();

                        this.txtResult.Text = modelStr;
                    }
                    else if (dbtype == 1)
                    {
                        // mysql
                        string modelStr = FactoryHelper_MsSql.CreateFactory();
                        this.txtResult.Text = modelStr;
                    }
                }
                else if (dbtool == 1)
                {
                    if (dbtype == 0)
                    {
                        // mysql
                        string modelStr = FactoryHelper_Dapper_MySql.CreateFactory();

                        this.txtResult.Text = modelStr;
                    }
                    else if (dbtype == 1)
                    {
                        // mysql
                        string modelStr = FactoryHelper_Dapper_MsSql.CreateFactory();
                        this.txtResult.Text = modelStr;
                    }
                }
                #endregion
            }
            else if (btn.Text == "Config")
            {
                #region Config
                int uitype = PageCache.UIType;
                int dbtype = PageCache.DbType;
                if (uitype == 0)
                {
                    // easyui
                    if (dbtype == 0)
                    {
                        // mysql
                        string modelStr = ConfigHelper.GetConnectStringConfig();

                        this.txtResult.Text = modelStr;
                    }
                }
                else if (uitype == 1)
                {
                    // bootstarp
                    if (dbtype == 0)
                    {
                        // mysql
                        string modelStr = ConfigHelper.GetConnectStringConfig();

                        this.txtResult.Text = modelStr;
                    }
                }
                #endregion
            }
            else if (btn.Text == "View")
            {
                #region View
                int webType = PageCache.WebType;
                int uiType  = PageCache.UIType;
                if (webType == 1)
                {
                    if (uiType == 0)
                    {
                        string viewStr = MvcViewHelper_EasyUI.CreateView();
                        this.txtResult.Text = viewStr;
                    }
                    else if (uiType == 1)
                    {
                        string viewStr = MvcViewHelper_Bootstrap.CreateView();
                        this.txtResult.Text = viewStr;
                    }
                }
                #endregion
            }
            else if (btn.Text == "Controller")
            {
                #region Controller
                string controllerStr = MvcControllerHelper.CreateController();

                this.txtResult.Text = controllerStr;
                #endregion
            }
            else if (btn.Text == "Test")
            {
                #region Test

                #endregion
            }
        }