private void treeViewBusiness_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            metaTableEntity = new AzMetaTableEntity();
            if (e.Node.Level == 1)
            {
                currentSelectObjModeName = e.Node.Name;
                metaTableEntity          = azMetaTableEntities.AsQueryable().Where(m => m.ObjModeName == currentSelectObjModeName).FirstOrDefault();
                tspButtonImport.Enabled  = !string.IsNullOrWhiteSpace(metaTableEntity.SchemaFrom);
                currentschemaFrom        = metaTableEntity.SchemaFrom;
                LoadMataColum(metaTableEntity.SchemaFrom);
                azMetaTableEntityBindingSource.DataSource = metaTableEntity;
                switch (metaTableEntity.ObjModeType)
                {
                case 1:
                    rdbMetaClass.Checked = true;
                    break;

                case 4:
                    rdbMetaChild.Checked = true;
                    break;
                }
            }
            else
            {
                azMetaCustomCloumListEntityBindingSource.DataSource = new AzMetaCustomCloumListEntity();
                azMetaTableEntityBindingSource.DataSource           = metaTableEntity;
                toolStrip2.Enabled       = false;
                currentSelectObjModeName = string.Empty;
                currentschemaFrom        = string.Empty;
            }
            ButtonAction(e.Node);
        }
Example #2
0
 private void azCdgnDBSchema1_OnClearAllAfter()
 {
     metaTableEntity = new AzMetaTableEntity();
     azCdgnDetail1.SetCurrentObject(metaTableEntity, 0);
     azCdgnClassProperty1.SetSelectedObject();
     azCdgnMasterDisplay1.SetMetaTableEntity(metaTableEntity);
 }
        private void LoadData(string objModeName)
        {
            metaTableEntity = AzMetaTableHandle.Handle().Select()
                              .Where(c => c.ObjModeName == objModeName)
                              .Go().AsQueryable().FirstOrDefault();
            if (metaTableEntity == null)
            {
                return;
            }
            textObjModeName.Text  = metaTableEntity.ObjModeName;
            textTableName.Text    = metaTableEntity.SchemaName;
            textClassDisPlay.Text = metaTableEntity.ClassDisPlay;
            textSchemaFrom.Text   = metaTableEntity.SchemaFrom;
            textRemark.Text       = metaTableEntity.Remark;
            azId = metaTableEntity.Id;
            switch (metaTableEntity.ObjModeType)
            {
            case 1:
                rdbMetaClass.Checked = true;
                break;

            case 4:
                rdbMetaChild.Checked = true;
                break;
            }
        }
 public void SetCurrentObject(AzMetaTableEntity value, int level)
 {
     currentObject           = value;
     tabControl1.SelectedTab = tabPage1;
     richTextBox1.Clear();
     if (level == 1)
     {
         LoadMataColum();
     }
     else
     {
         azMetaCloumListEntityBindingSource.DataSource = new AzMetaCloumListEntity();
         toolStrip2.Enabled = false;
     }
 }
Example #5
0
 private void azCdgnDBSchema1_TreeNodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     metaTableEntity = new AzMetaTableEntity();
     if (e.Node.Level == 1)
     {
         metaTableEntity = azCdgnDBSchema1.GetAzMetaTableEntity();
         azCdgnDetail1.SetCurrentObject(metaTableEntity, 1);
         azCdgnClassProperty1.SetSelectedObject(metaTableEntity);
     }
     else
     {
         azCdgnDetail1.SetCurrentObject(metaTableEntity, 0);
         azCdgnClassProperty1.SetSelectedObject();
     }
     azCdgnMasterDisplay1.SetMetaTableEntity(metaTableEntity);
 }
Example #6
0
        private string CheckMasterSetIsValid(AzMetaTableEntity checkitem, bool showDialogue)
        {
            AzClassCreatProperty creatProperty = AzCdgnClassProperty.GetItemClassCreatProperty(checkitem);

            if (creatProperty.ObjPresentation.IsSchemaForOther)
            {
                if (showDialogue)
                {
                    GeneralHelpler.SomethingError($"当前项目{checkitem.ClassName}({checkitem.ClassDisPlay})为“结构查询”,不能生成代码!");
                }

                return($"{checkitem.ClassName}({checkitem.ClassDisPlay})");
            }

            return(string.Empty);
        }
Example #7
0
        private void treeViewBusiness_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            AzMetaTableEntity metaTableEntity = new AzMetaTableEntity();

            if (e.Node.Level == 1)
            {
                textBox1.Text      = e.Node.Name;
                currentSelectTable = e.Node.Name;
                btnOk.Enabled      = true;
            }
            else
            {
                textBox1.Text      = string.Empty;
                currentSelectTable = string.Empty;
                btnOk.Enabled      = false;
            }
        }
        private int CreateDBTabeOp(string objModeName)
        {
            AzMetaTableEntity azMetaTable = AzMetaTableHandle.Handle().Select()
                                            .Where(t => t.ObjModeName == objModeName)
                                            .Go().FirstOrDefault();
            IEnumerable <AzMetaCustomCloumEntity> cloumListEntities = AzMetaCustomCloumHandle.Handle().Select()
                                                                      .Where(t => t.TableName == azMetaTable.SchemaName)
                                                                      .Go();
            string strcreate = DataOperate.CreateDBObject(azMetaTable, cloumListEntities);
            int    result    = MetadataOperate.ExecuteCmd(strcreate);

            if (result > 0)
            {
                azMetaTable.ObjModeType = 0;
                azMetaTable.ObjDataType = 0;
                AzMetaTableHandle.Handle().Updata(azMetaTable);
            }
            return(result);
        }
        private void SaveMasterInfo()
        {
            JavaScriptSerializer js = new JavaScriptSerializer();

            if (string.IsNullOrWhiteSpace(azClassCreatProperty.ObjPresentation.UpdateTableName))
            {
                azClassCreatProperty.ObjPresentation.UpdateTableName = azMetaTable.SchemaName;
            }
            azMetaTable.CodeSetVales = js.Serialize(azClassCreatProperty);
            if (azMetaTable.ComeFrom == 1)
            {
                azMetaTable.ObjModeType = 1;
                azMetaTable.AppName     = MetadataOperate.GetDefAppNameUpdate(AzNormalSet.GetAzNormalSet().AzBase.AzTablePrefix);
                azMetaTable             = AzMetaTableHandle.Handle().Insert(azMetaTable);
                return;
            }
            AzMetaTableHandle.Handle().Updata(azMetaTable);
            SetSelectedObject(azMetaTable);
            OnMasterSaveNotification?.Invoke();
        }
        public static string SpParamCreates(AzMetaTableEntity azMetaTable)
        {
            if (string.IsNullOrWhiteSpace(azMetaTable.SchemaName))
            {
                return("");
            }

            IEnumerable <AzMetaCloumEntity> azMetaCloums = AzMetaCloumHandle.Handle()
                                                           .Select()
                                                           .Where(m => m.TableName == azMetaTable.SchemaName)
                                                           .Go();
            StringBuilder stringBuilder = new StringBuilder();

            foreach (var col in azMetaCloums)
            {
                stringBuilder.AppendLine(SpParamCreate(col));
            }

            return(stringBuilder.ToString());
        }
        private void btSave_Click(object sender, System.EventArgs e)
        {
            if (VerificationText())
            {
                return;
            }

            int objModeType = 1;

            if (rdbMetaChild.Checked)
            {
                objModeType = 4;
            }

            metaTableEntity = new AzMetaTableEntity
            {
                ObjModeName  = textObjModeName.Text,
                ClassName    = textClassName.Text,
                SchemaName   = textTableName.Text,
                SchemaFrom   = textSchemaFrom.Text,
                ClassDisPlay = textClassDisPlay.Text,
                CodeSetVales = "",
                Remark       = textRemark.Text,
                IsCustom     = true,
                ObjDataType  = 1,
                ObjModeType  = objModeType,
                AppName      = MetadataOperate.GetDefAppNameUpdate(azNormalSet.AzBase.AzTablePrefix),
            };
            if (IsEdit)
            {
                metaTableEntity.Id = azId;
                AzMetaTableHandle.Handle().Updata(metaTableEntity);
            }
            else
            {
                AzMetaTableHandle.Handle().Insert(metaTableEntity);
            }
            DialogResult = DialogResult.OK;
        }
Example #12
0
        public static string ReplacContext(string codeStr, AzMetaTableEntity azMetaTable)
        {
            var aznormalset = AzNormalSet.GetAzNormalSet();
            var azbase      = aznormalset.AzBase;

            codeStr = codeStr.ReaplaceTemplateForWord("Ai_Project_NameSpace", azbase.AzProjectSpace)
                      .ReaplaceTemplateForWord("Ai_Project_UI_FullNameSpace", azbase.AzProjectSpace + @".WebUI")
                      .ReaplaceTemplateForWord("Ai_Bll_ClassName", azMetaTable.ClassName)
                      .ReaplaceTemplateForWord("Ai_Bll_Edit_ClassName", azMetaTable.ClassName)
                      .ReaplaceTemplateForWord("Ai_Object_ChineseName", string.IsNullOrWhiteSpace(azMetaTable.ClassDisPlay) ? azMetaTable.ClassName : azMetaTable.ClassDisPlay)
                      .ReaplaceTemplateForWord("Ai_Bll_List_ClassName", azMetaTable.ClassName + "List")
                      .ReaplaceTemplateForWord("Ai_ProjectName", azbase.AzProjectName)
                      .ReaplaceTemplateForWord("Ai_SqlDB_ConnectionString", azMetaTable.ClassName + "List")
                      .ReaplaceTemplateForWord("Ai_Bll_List_ClassName", azMetaTable.ClassName + "List")
                      .ReaplaceTemplateForWord("Ai_Bll_List_ClassName", azMetaTable.ClassName + "List")
                      .ReaplaceTemplateForWord("Ai_Bll_List_ClassName", azMetaTable.ClassName + "List")
                      .ReaplaceTemplateForWord("Ai_Bll_List_ClassName", azMetaTable.ClassName + "List");



            return(codeStr);
        }
Example #13
0
        public static string CreateDBObject(AzMetaTableEntity azMetaTable, IEnumerable <AzMetaCustomCloumEntity> azCloumListEntity)
        {
            if (azMetaTable == null)
            {
                throw new Exception(" 元数主表类为null,不能生成!");
            }
            if (azCloumListEntity == null)
            {
                throw new Exception(" 元数属性null,不能生成!");
            }
            string createSql     = $" CREATE TABLE [dbo].[{azMetaTable.SchemaName}](";
            string identitySql   = " [{0}] [{1}]  IDENTITY(1,1) NOT NULL,";
            string normalSql     = " [{0}] [{1}] {2},";
            string haveLenSql    = " [{0}] [{1}] ({2}) {3},";
            string constraintSql = " CONSTRAINT [PK_{0}] PRIMARY KEY CLUSTERED({1})) ON [PRIMARY]";

            string nullstr = "";
            string keyid   = "";
            string tempstr = "";
            int    idCount = 0;

            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(createSql);

            foreach (var item in azCloumListEntity)
            {
                nullstr = item.IsNullable ?? true ? " Not NULL" : " NULL";

                if (item.IsKeyField ?? true)

                {
                    keyid = (string.IsNullOrWhiteSpace(keyid)) ? keyid = $" {item.FldName} ASC" : $"{keyid},{item.FldName} ASC";
                }

                if (item.FldType.ToLower().Contains("char"))
                {
                    tempstr = string.Format(haveLenSql, item.FldName, item.FldType, item.FldLen, nullstr);
                }
                else
                {
                    if (item.IsIdentity ?? true)
                    {
                        tempstr  = string.Format(identitySql, item.FldName, item.FldType);
                        idCount += 1;
                        if (idCount > 1)
                        {
                            throw new Exception(string.Format(" '{0}'有多个自增字段,不能生成!", azMetaTable.ClassName));
                        }
                    }
                    else
                    {
                        tempstr = string.Format(normalSql, item.FldName, item.FldType, nullstr);
                    }
                }
                stringBuilder.Append(tempstr);
            }

            if (string.IsNullOrWhiteSpace(keyid))
            {
                throw new Exception(string.Format(" '{0}'没有设置关键字段,不能生成!", azMetaTable.ClassName));
            }
            tempstr = string.Format(constraintSql, azMetaTable.SchemaName, keyid);
            stringBuilder.Append(tempstr);
            stringBuilder.Append($"; UPDATE [dbo].[{AzNormalSet.GetAzNormalSet().AzMetaCloumName}] SET TpyeId=1 where TableName='{azMetaTable.SchemaName}'");

            return(stringBuilder.ToString());
        }
Example #14
0
 private void azCdgnClassProperty1_OnMasterSaveNotification()
 {
     azCdgnMasterDisplay1.Atk_MasterInit = false;
     metaTableEntity = azCdgnClassProperty1.GetAzMetaTableEntity();
     azCdgnDetail1.SetCurrentObject(metaTableEntity, 1);
 }
Example #15
0
        private string CreateCodeHandle(string opCreate, AzMetaTableEntity item, AzClassCreatProperty itemproperty, IEnumerable <AzMetaCloumEntity> itemDetails)
        {
            if (!AzCreateItem.GetAzCreateItemEnable(opCreate, itemproperty))
            {
                return(string.Empty);
            }

            CodeHandle.HasSummary = azCdgnMasterDisplay1.GetHasSummary();

            string path     = string.Empty;
            string floder   = string.Empty;
            string filename = string.Empty;
            string codestr  = string.Empty;
            string ext      = ".cs";


            switch (opCreate)
            {
            case "AzthinkerDal_Interface":
                path     = $"{NormalSet.AzBase.AzProjectSpace}.Dal.{NormalSet.AzBase.AzProjectName}";
                floder   = item.ClassName;
                filename = $"I{item.ClassName}Dal";
                codestr  = CodeHandle.AzInterfaceDal(item, itemproperty);
                break;

            case "AzthinkerDal_SQL":
                path     = $"{NormalSet.AzBase.AzProjectSpace}.Dal.{NormalSet.AzBase.AzProjectName}";
                floder   = item.ClassName;
                filename = $"{item.ClassName}Dal";
                codestr  = CodeHandle.AzDalConcrete(item, itemproperty, itemDetails);
                break;

            case "AzthinkerBll_Class":
                path     = $"{NormalSet.AzBase.AzProjectSpace}.BLL.{NormalSet.AzBase.AzProjectName}";
                floder   = item.ClassName;
                filename = $"{item.ClassName}Entity";
                codestr  = CodeHandle.AzBll_Class(item, itemproperty, itemDetails);
                break;

            case "AzthinkerBll_ListClass":
                path     = $"{NormalSet.AzBase.AzProjectSpace}.BLL.{NormalSet.AzBase.AzProjectName}";
                floder   = item.ClassName;
                filename = $"{item.ClassName}ListEntity";
                codestr  = CodeHandle.AzBll_ListClass(item, itemproperty, itemDetails);
                break;

            case "AzthinkerClass_WebUIDto":
                path     = $"{NormalSet.AzBase.AzProjectSpace}.UIServer.{NormalSet.AzBase.AzProjectName}";
                floder   = item.ClassName;
                filename = $"{item.ClassName}WebDto";
                codestr  = CodeHandle.AzWebUI_Dto(item, itemproperty, itemDetails);
                break;

            case "AzthinkerClass_WebListUIDto":
                path     = $"{NormalSet.AzBase.AzProjectSpace}.UIServer.{NormalSet.AzBase.AzProjectName}";
                floder   = item.ClassName;
                filename = $"{item.ClassName}ListWebDto";
                codestr  = CodeHandle.AzWebUiList_Dto(item, itemproperty, itemDetails);
                break;

            case "AzthinkerClass_WebHandle":
                path     = $"{NormalSet.AzBase.AzProjectSpace}.UIServer.{NormalSet.AzBase.AzProjectName}";
                floder   = item.ClassName;
                filename = $"{item.ClassName}WebHandle";
                codestr  = CodeHandle.AzWebUiHandle(item, itemproperty, itemDetails);
                break;

            case "AzthinkerControllers":
                path     = $"{NormalSet.AzBase.AzProjectSpace}.WebUI";
                floder   = "Controllers";
                filename = $"{item.ClassName}Controller";
                codestr  = CodeHandle.AzMVC_Controllers(item, itemproperty, itemDetails);
                break;

            case "AzthinkerView_Create":
                path     = $"{NormalSet.AzBase.AzProjectSpace}.WebUI\\View";
                floder   = item.ClassName;
                filename = "Create";
                ext      = ".cshtml";
                codestr  = CodeHandle.AzMvc_View_Create(item, itemproperty, itemDetails);
                break;

            case "AzthinkerView_Delete":
                path     = $"{NormalSet.AzBase.AzProjectSpace}.WebUI\\View";
                floder   = item.ClassName;
                filename = "Delete";
                ext      = ".cshtml";
                codestr  = CodeHandle.AzMvc_View_Delete(item, itemproperty, itemDetails);
                break;

            case "AzthinkerView_Details":
                path     = $"{NormalSet.AzBase.AzProjectSpace}.WebUI\\View";
                floder   = item.ClassName;
                filename = "Details";
                ext      = ".cshtml";
                codestr  = CodeHandle.AzMvc_View_Details(item, itemproperty, itemDetails);
                break;

            case "AzthinkerView_Edit":
                path     = $"{NormalSet.AzBase.AzProjectSpace}.WebUI\\View";
                floder   = item.ClassName;
                filename = "Edit";
                ext      = ".cshtml";
                codestr  = CodeHandle.AzMvc_View_Edit(item, itemproperty, itemDetails);
                break;

            case "AzthinkerView_Index":
                path     = $"{NormalSet.AzBase.AzProjectSpace}.WebUI\\View";
                floder   = item.ClassName;
                filename = "Index";
                ext      = ".cshtml";
                codestr  = CodeHandle.AzMvc_View_GetList(item, itemproperty, itemDetails);
                break;

            case "AzthinkerView_IndexPage":
                path     = $"{NormalSet.AzBase.AzProjectSpace}.WebUI\\View";
                floder   = item.ClassName;
                filename = "Index";
                ext      = ".cshtml";
                codestr  = CodeHandle.AzMvc_View_GetListPage(item, itemproperty, itemDetails);
                break;

            case "AzthinkerView_IndexPageDetails":
                path     = $"{NormalSet.AzBase.AzProjectSpace}.WebUI\\View";
                floder   = item.ClassName;
                filename = "DetailsPage";
                ext      = ".cshtml";
                codestr  = CodeHandle.AzMvc_View_GetListPageDetails(item, itemproperty, itemDetails);
                break;
            }
            if (string.IsNullOrWhiteSpace(path))
            {
                return("");
            }
            if (string.IsNullOrWhiteSpace(codestr))
            {
                return($"{item.ClassName}({item.ClassDisPlay}),无可生成代码");
            }
            FileHelper.SaveCodeToFile(path, floder, filename, codestr, ext);

            return(codestr);
        }
        public static AzClassCreatProperty GetItemClassCreatProperty(AzMetaTableEntity azMetaTableEntity)
        {
            AzClassCreatProperty azClassCreatProperty = new AzClassCreatProperty();

            if (!string.IsNullOrWhiteSpace(azMetaTableEntity.CodeSetVales))
            {
                JavaScriptSerializer js = new JavaScriptSerializer();
                azClassCreatProperty = js.Deserialize <AzClassCreatProperty>(azMetaTableEntity.CodeSetVales);
            }
            azClassCreatProperty.ClassName     = azMetaTableEntity.ClassName.Replace(' ', '_');
            azClassCreatProperty.DisplayName   = azMetaTableEntity.ClassDisPlay;
            azClassCreatProperty.CurrentSelect = azMetaTableEntity.SchemaName;
            azClassCreatProperty.NameSpace     = AzNormalSet.GetAzNormalSet().AzBase.AzProjectSpace;
            azClassCreatProperty.ProjectName   = AzNormalSet.GetAzNormalSet().AzBase.AzProjectName;
            azClassCreatProperty.Nick          = AzNormalSet.GetAzNormalSet().AzBase.AzNick;

            if (azMetaTableEntity.ObjModeType == 1)
            {
                switch (azMetaTableEntity.ObjDataType)
                {
                case 1:
                    azClassCreatProperty.ObjPresentation.ObjDataType = ObjDataTypeEnum.atk_tables;
                    break;

                case 2:
                    azClassCreatProperty.ObjPresentation.ObjDataType = ObjDataTypeEnum.atk_views;
                    break;

                case 3:
                    if (string.IsNullOrWhiteSpace(azClassCreatProperty.ObjPresentation.StoreProcedureQuery))
                    {
                        azClassCreatProperty.ObjPresentation.ObjDataType = ObjDataTypeEnum.atk_FuncstoredProcedure;
                    }
                    else
                    {
                        azClassCreatProperty.ObjPresentation.ObjDataType = ObjDataTypeEnum.atk_QuerystoredProcedure;
                    }

                    break;
                }
            }
            else
            {
                switch (azMetaTableEntity.ObjDataType)
                {
                case 1:
                    azClassCreatProperty.ObjPresentation.ObjDataType = ObjDataTypeEnum.atk_customTables;
                    break;

                case 2:
                    azClassCreatProperty.ObjPresentation.ObjDataType = ObjDataTypeEnum.atk_customViews;
                    break;
                }
            }
            //确保IsSchemaForOther设置正确
            if (azClassCreatProperty.ObjPresentation.IsSchemaForOther)
            {
                if (!(azClassCreatProperty.ObjPresentation.ObjDataType == ObjDataTypeEnum.atk_views ||
                      azClassCreatProperty.ObjPresentation.ObjDataType == ObjDataTypeEnum.atk_customViews))
                {
                    azClassCreatProperty.ObjPresentation.IsSchemaForOther = false;
                }
            }

            if (azClassCreatProperty.ObjPresentation.ObjDataType == ObjDataTypeEnum.atk_tables ||
                azClassCreatProperty.ObjPresentation.ObjDataType == ObjDataTypeEnum.atk_customTables)
            {
                azClassCreatProperty.HasBussniesJson = false;
                azClassCreatProperty.HasBigText      = false;
                azClassCreatProperty.HasExec         = false;
                azClassCreatProperty.HasSpClass      = false;
                azClassCreatProperty.ObjPresentation.IsSchemaForOther    = false;
                azClassCreatProperty.ObjPresentation.UpdateTableName     = "";
                azClassCreatProperty.ObjPresentation.StoreProcedureQuery = "";
            }
            else

            if (azClassCreatProperty.ObjPresentation.ObjDataType == ObjDataTypeEnum.atk_views ||
                azClassCreatProperty.ObjPresentation.ObjDataType == ObjDataTypeEnum.atk_customViews)
            {
                azClassCreatProperty.HasBussniesJson = false;
                azClassCreatProperty.HasBigText      = false;
                azClassCreatProperty.HasExec         = false;
                azClassCreatProperty.HasSpClass      = false;
                if (azClassCreatProperty.ObjPresentation.IsSchemaForOther)
                {
                    azClassCreatProperty.ObjPresentation.UpdateTableName = "";
                }
            }
            else if (azClassCreatProperty.ObjPresentation.ObjDataType == ObjDataTypeEnum.atk_FuncstoredProcedure)
            {
                azClassCreatProperty.HasBussniesJson       = false;
                azClassCreatProperty.HasBigText            = false;
                azClassCreatProperty.HasViewDetail         = false;
                azClassCreatProperty.HasViewEdit           = false;
                azClassCreatProperty.HasViewDelete         = false;
                azClassCreatProperty.HasViewAdd            = false;
                azClassCreatProperty.HasControllerAsynPage = false;
                azClassCreatProperty.HasControllerList     = false;
                azClassCreatProperty.HasControllerDetail   = false;
                azClassCreatProperty.HasControllerEdit     = false;
                azClassCreatProperty.HasControllerDelete   = false;
                azClassCreatProperty.HasControllerAdd      = false;
                azClassCreatProperty.HasControllerDelete   = false;
                azClassCreatProperty.HasDtoConstruction    = false;
                azClassCreatProperty.HasBussniesDetail     = false;
                azClassCreatProperty.HasBussniesEdit       = false;
                azClassCreatProperty.HasBussniesDelete     = false;
                azClassCreatProperty.HasBussniesAdd        = false;

                azClassCreatProperty.ObjPresentation.IsSchemaForOther = false;
                azClassCreatProperty.ObjPresentation.UpdateTableName  = "";
            }
            else if (azClassCreatProperty.ObjPresentation.ObjDataType == ObjDataTypeEnum.atk_QuerystoredProcedure)
            {
                azClassCreatProperty.HasBussniesJson                  = false;
                azClassCreatProperty.HasBigText                       = false;
                azClassCreatProperty.HasViewDetail                    = false;
                azClassCreatProperty.HasViewEdit                      = false;
                azClassCreatProperty.HasViewDelete                    = false;
                azClassCreatProperty.HasViewAdd                       = false;
                azClassCreatProperty.HasExec                          = false;
                azClassCreatProperty.HasControllerDetail              = false;
                azClassCreatProperty.HasControllerEdit                = false;
                azClassCreatProperty.HasControllerDelete              = false;
                azClassCreatProperty.HasControllerAdd                 = false;
                azClassCreatProperty.HasControllerDelete              = false;
                azClassCreatProperty.HasDtoConstruction               = false;
                azClassCreatProperty.HasBussniesDetail                = false;
                azClassCreatProperty.HasBussniesEdit                  = false;
                azClassCreatProperty.HasBussniesDelete                = false;
                azClassCreatProperty.HasBussniesAdd                   = false;
                azClassCreatProperty.HasControllerAsynPage            = false;
                azClassCreatProperty.ObjPresentation.IsSchemaForOther = false;
                azClassCreatProperty.ObjPresentation.UpdateTableName  = "";
            }

            azClassCreatProperty.ObjPresentation.UpdateTableName = azMetaTableEntity.SchemaName;
            return(azClassCreatProperty);
        }
        public void SetSelectedObject(AzMetaTableEntity azMetaTableEntity = null)
        {
            azMetaTable = azMetaTableEntity;
            if (azMetaTableEntity == null)
            {
                AzNodeLevel0Property azNodeLevel0Property = new AzNodeLevel0Property
                {
                    NameSpace   = AzNormalSet.GetAzNormalSet().AzBase.AzProjectSpace,
                    ProjectName = AzNormalSet.GetAzNormalSet().AzBase.AzProjectName,
                    Nick        = AzNormalSet.GetAzNormalSet().AzBase.AzNick
                };
                toolStripButton1.Enabled     = false;
                propertyGrid1.SelectedObject = azNodeLevel0Property;
                azClassCreatProperty         = null;
            }
            else
            {
                toolStripButton1.Enabled = true;
                azClassCreatProperty     = GetItemClassCreatProperty(azMetaTableEntity);// new AzClassCreatProperty();

                SetClassCreatPropertyTrue();
                if (azClassCreatProperty.ObjPresentation.ObjDataType == ObjDataTypeEnum.atk_tables ||
                    azClassCreatProperty.ObjPresentation.ObjDataType == ObjDataTypeEnum.atk_customTables)
                {
                    List <string> listp = new List <string> {
                        "HasBussniesJson", "HasBigText", "HasExec", "HasSpClass"
                    };
                    PropertyHelper.AddAttribute(typeof(AzClassCreatProperty), listp, BrowsableFalse);
                    List <string> listfalseObj = new List <string> {
                        "IsSchemaForOther", "UpdateTableName", "StoreProcedureQuery"
                    };
                    PropertyHelper.AddAttribute(typeof(ObjDataPresentation), listfalseObj, BrowsableFalse);
                    //PropertyHelper.AddAttribute(typeof(SpecialitySet), "BigText", BrowsableFalse);
                    PropertyHelper.AddAttribute(typeof(ObjDataPresentation), "ObjDataType", ReadOnlyTrue);
                }
                else

                if (azClassCreatProperty.ObjPresentation.ObjDataType == ObjDataTypeEnum.atk_views ||
                    azClassCreatProperty.ObjPresentation.ObjDataType == ObjDataTypeEnum.atk_customViews)
                {
                    List <string> listp = new List <string> {
                        "HasBussniesJson", "HasBigText", "HasExec", "HasSpClass"
                    };
                    PropertyHelper.AddAttribute(typeof(AzClassCreatProperty), listp, BrowsableFalse);
                    List <string> listfalseObj = new List <string> {
                        "StoreProcedureQuery"
                    };
                    if (azClassCreatProperty.ObjPresentation.IsSchemaForOther)
                    {
                        listfalseObj = new List <string> {
                            "UpdateTableName", "StoreProcedureQuery"
                        };
                    }

                    PropertyHelper.AddAttribute(typeof(ObjDataPresentation), listfalseObj, BrowsableFalse);
                    PropertyHelper.AddAttribute(typeof(ObjDataPresentation), "UpdateTableName", ReadOnlyFalse);
                    PropertyHelper.AddAttribute(typeof(SpecialitySet), "BigText", BrowsableFalse);
                }
                else

                if (azClassCreatProperty.ObjPresentation.ObjDataType == ObjDataTypeEnum.atk_FuncstoredProcedure)
                {
                    List <string> listp = new List <string> {
                        "HasBussniesJson", "HasBigText", "HasViewDetail",
                        "HasViewEdit", "HasViewDelete", "HasViewAdd", "HasControllerAsynPage", "HasSpClass",
                        "HasControllerList", "HasControllerDetail", "HasControllerEdit", "HasControllerDelete",
                        "HasControllerAdd", "HasDtoConstruction", "HasBussniesList", "HasBussniesDetail",
                        "HasBussniesEdit", "HasBussniesDelete", "HasBussniesAdd"
                    };
                    PropertyHelper.AddAttribute(typeof(AzClassCreatProperty), listp, BrowsableFalse);

                    List <string> listfalseObj = new List <string> {
                        "IsSchemaForOther", "UpdateTableName"
                    };
                    PropertyHelper.AddAttribute(typeof(ObjDataPresentation), listfalseObj, BrowsableFalse);

                    PropertyHelper.AddAttribute(typeof(ObjDataPresentation), "UpdateTableName", ReadOnlyFalse);
                    PropertyHelper.AddAttribute(typeof(SpecialitySet), "BigText", BrowsableFalse);
                }
                else if (azClassCreatProperty.ObjPresentation.ObjDataType == ObjDataTypeEnum.atk_QuerystoredProcedure)
                {
                    List <string> listp = new List <string> {
                        "HasBussniesJson", "HasBigText", "HasViewDetail",
                        "HasViewEdit", "HasViewDelete", "HasViewAdd", "HasExec",
                        "HasControllerDetail", "HasControllerEdit", "HasControllerDelete",
                        "HasControllerAdd", "HasDtoConstruction", "HasBussniesDetail",
                        "HasBussniesEdit", "HasBussniesDelete", "HasBussniesAdd", "HasControllerAsynPage"
                    };
                    PropertyHelper.AddAttribute(typeof(AzClassCreatProperty), listp, BrowsableFalse);

                    List <string> listfalseObj = new List <string> {
                        "IsSchemaForOther", "UpdateTableName"
                    };
                    PropertyHelper.AddAttribute(typeof(ObjDataPresentation), listfalseObj, BrowsableFalse);

                    PropertyHelper.AddAttribute(typeof(ObjDataPresentation), "UpdateTableName", ReadOnlyFalse);
                    PropertyHelper.AddAttribute(typeof(SpecialitySet), "BigText", BrowsableFalse);
                }


                propertyGrid1.SelectedObject = azClassCreatProperty;
                propertyGrid1.ExpandAllGridItems();
            }
        }