/// <summary>
        /// 对角色设置权限
        /// </summary>
        /// <param name="setAuthToRole"></param>
        /// <returns></returns>
        public string SetAuthToRole(SetAuthToRole setAuthToRole)
        {
            string Role = setAuthToRole.Role;

            using (IDbConnection dbConnection = (new AppDataBase()).connection)
            {
                dbConnection.Open();
                IDbTransaction transaction = dbConnection.BeginTransaction();
                try
                {
                    string sql = "Delete FLC_AUTHORIZATION_ROLE where role_code = :role_code";

                    var para = new DynamicParameters();
                    para.Add(":role_code", Role);

                    AppDataBase.Execute(sql, para, transaction, dbConnection);
                    sql = @"Insert into FLC_AUTHORIZATION_ROLE (id,obj_code, page, operation_id, role_code,menu_id,is_operation)
                        values(:id,:obj_code, :page, :operation_id, :role_code,:menu_id,:is_operation)";

                    foreach (FLC_AUTHORIZATION_ROLE dr in setAuthToRole.fLC_AUTHORIZATION_ROLEs)
                    {
                        int id = MethodGetSerial.getSerialNumInt("FLC_AUTHORIZATION_ROLE", transaction, dbConnection);

                        para = new DynamicParameters();
                        para.Add(":id", id);
                        para.Add(":obj_code", dr.OBJ_CODE);
                        para.Add(":page", dr.PAGE);
                        para.Add(":operation_id", dr.OPERATION_ID);
                        para.Add(":role_code", dr.ROLE_CODE);
                        para.Add(":menu_id", dr.MENU_ID);
                        para.Add(":is_operation", dr.IS_OPERATION);

                        AppDataBase.Execute(sql, para, transaction, dbConnection);
                    }
                    transaction.Commit();
                }
                catch (Exception e)
                {
                    transaction.Rollback();
                    throw e;
                }
            }

            return("ok");
        }
        /// <summary>
        /// 设置对象操作给角色
        /// </summary>
        /// <param name="saveOperationAuthToRole"></param>
        /// <returns></returns>
        public string SaveOperationAuthToRole(SaveOperationAuthToRole saveOperationAuthToRole)
        {
            string role_code = saveOperationAuthToRole.role_code;

            using (IDbConnection dbConnection = (new AppDataBase()).connection)
            {
                dbConnection.Open();
                IDbTransaction transaction = dbConnection.BeginTransaction();
                try
                {
                    string sql  = "";
                    var    parm = new DynamicParameters();
                    sql = "Delete FLC_OPERATION_AUTH where role_code = :role_code";
                    parm.Add(":role_code", role_code);

                    AppDataBase.Execute(sql, parm, transaction, dbConnection);
                    sql = @"Insert into FLC_OPERATION_AUTH(id, obj_code, page, operation_id, role_code) 
                values(:id, :obj_code, :page, :operation_id, :role_code)";
                    foreach (var dr in saveOperationAuthToRole.fLC_OPEERATION_AUTHs)
                    {
                        int id = MethodGetSerial.getSerialNumInt("FLC_OPERATION_AUTH", transaction, dbConnection);

                        parm.Add(":id", id);
                        parm.Add(":obj_code", dr.OBJ_CODE);
                        parm.Add(":page", dr.PAGE);
                        parm.Add(":operation_id", dr.OPERATION_ID);

                        AppDataBase.Execute(sql, parm, transaction, dbConnection);
                    }

                    transaction.Commit();
                }
                catch (Exception e)
                {
                    transaction.Rollback();
                    throw e;
                }
            }

            return("ok");
        }
        /// <summary>
        /// 给角色设置菜单权限
        /// </summary>
        /// <param name="saveMenuAuthToRole"></param>
        /// <returns></returns>
        public string SaveMenuAuthToRole(SaveMenuAuthToRole saveMenuAuthToRole)
        {
            string role_code = saveMenuAuthToRole.role_code;

            using (IDbConnection dbConnection = (new AppDataBase()).connection)
            {
                dbConnection.Open();
                IDbTransaction transaction = dbConnection.BeginTransaction();
                try
                {
                    string sql  = "";
                    var    parm = new DynamicParameters();
                    sql = "Delete flc_menu_auth where role_code = :role_code";
                    parm.Add(":role_code", role_code);

                    AppDataBase.Execute(sql, parm, transaction, dbConnection);
                    sql = "Insert into flc_menu_auth(id, menu_id, role_code) values(:id, :menu_id, :role_code)";

                    foreach (FLC_MENU_AUTH item in saveMenuAuthToRole.fLC_MENU_AUTHs)
                    {
                        int id = MethodGetSerial.getSerialNumInt("flc_menu_auth", transaction, dbConnection);
                        parm.Add(":id", id);
                        parm.Add(":menu_id", item.MENU_ID);
                        AppDataBase.Execute(sql, parm, transaction, dbConnection);
                    }

                    transaction.Commit();
                }
                catch (Exception e)
                {
                    transaction.Rollback();
                    throw e;
                }
            }

            return("ok");
        }
        public static string crateObject_ADD(crateObject_alter crateObject_Alter)
        {
            try
            {
                using (IDbConnection dbConnection = (new AppDataBase()).connection)
                {
                    dbConnection.Open();
                    IDbTransaction transaction = dbConnection.BeginTransaction();

                    try
                    {
                        #region 对象名称
                        Obj_Name obj_Name = crateObject_Alter.ObjectName;
                        if (obj_Name != null)
                        {
                            string obj_code  = obj_Name.Obj_Code;
                            string zn_CN1    = obj_Name.zn_CN;
                            string en_US1    = obj_Name.en_US;
                            string is_enable = obj_Name.Is_Enable;

                            //Update_FLC_Lang(dbConnection, obj_code, zn_CN1, en_US1, transaction);
                            string sql = "delete FLC_OBJECT where obj_code = :obj_code";

                            var parm1 = new DynamicParameters();
                            parm1.Add(":obj_code", obj_code);
                            // AppDataBase.ExecuteScalar(sql, dbConnection, parm1, transaction);

                            sql = "select count(*) from FLC_OBJECT where obj_code = :obj_code";
                            string str = AppDataBase.ExecuteScalar(sql, dbConnection, parm1, transaction).ToString();

                            int id1 = MethodGetSerial.getSerialNumInt("FLC_OBJECT", transaction, dbConnection);

                            string inobject = "insert into FLC_OBJECT(id,obj_code,is_enable) values (:id,:obj_code,:is_enable)";
                            var    parm2    = new DynamicParameters();
                            parm2.Add(":id", id1);
                            parm2.Add(":obj_code", obj_code);
                            parm2.Add(":is_enable", is_enable);

                            AppDataBase.Execute(inobject, parm2, transaction);
                        }

                        //取得流水号
                        #endregion

                        #region 对象表新增
                        List <ObjRelation> objRelations = crateObject_Alter.ObjRelation;
                        foreach (ObjRelation dr in objRelations)
                        {
                            string obj_code  = dr.obj_code;
                            string obj_table = dr.obj_table;
                            string zn_CN2    = dr.zn_CN;
                            string en_US2    = dr.en_US;
                            int    is_main   = dr.is_main;
                            //只做中英文修改 还有删除操作(flc_objects flc_obj_property flc_lang 中删除,删除表)
                            string sign = obj_code + "." + obj_table;
                            // Update_FLC_Lang(sign, zn_CN2, en_US2,transaction);

                            #region 在FLC_OBJECTS新增对应数据
                            //在FLC_OBJECTS删除对应数据
                            string sql = "delete FLC_OBJECTS where obj_code = :obj_code and obj_table=:obj_table";

                            var parm3 = new DynamicParameters();
                            parm3.Add(":obj_code", obj_code);
                            parm3.Add(":obj_table", obj_table);

                            AppDataBase.ExecuteScalar(sql, dbConnection, parm3, transaction);
                            //在FLC_OBJECTS新增对应数据
                            sql = "insert into FLC_OBJECTS(obj_code,obj_table,is_main,id) values (:obj_code,:obj_table,:is_main,:id)";
                            //取得流水号
                            int id2   = MethodGetSerial.getSerialNumInt("FLC_OBJECTS", transaction);
                            var parm4 = new DynamicParameters();
                            parm4.Add(":obj_code", obj_code);
                            parm4.Add(":obj_table", obj_table);
                            parm4.Add(":is_main", is_main);
                            parm4.Add(":id", id2);
                            AppDataBase.Execute(sql, parm4, transaction);

                            #endregion

                            #region 构建对象表
                            //查找此表是否存在语句
                            string setable = "select count(*) coun from user_tables where  table_name=:obj_table";

                            var parm5 = new DynamicParameters();
                            parm5.Add(":obj_table", obj_table);

                            //创建表语句
                            //主表
                            string creobjtab = "create table {0} (id number null)";
                            creobjtab = string.Format(creobjtab, obj_table);
                            //子表
                            string creobjtabs = "create table {0} (id number null,mid number null)";
                            creobjtabs = string.Format(creobjtabs, obj_table);

                            //查找此表是否存在 存在删除再创建。
                            int count = Convert.ToInt32(AppDataBase.ExecuteScalar(setable, dbConnection, parm5, transaction));
                            if (count > 0)
                            {
                                sql = "drop table " + obj_table;
                                AppDataBase.Execute(sql, null, transaction);
                            }
                            if (is_main == 1)
                            {
                                AppDataBase.Execute(creobjtab, null, transaction);
                            }
                            else
                            {
                                AppDataBase.Execute(creobjtabs, null, transaction);
                            }
                            #endregion
                        }
                        #endregion

                        #region 对象属性
                        List <Flc_Object_Property> objproperty = crateObject_Alter.Objproperty;

                        foreach (Flc_Object_Property dr in objproperty)
                        {
                            #region 属性
                            string obj_code     = dr.Obj_Code.ToUpper();
                            string obj_table    = dr.Obj_Table.ToUpper();
                            string obj_pro_code = dr.Obj_Pro_Code.ToUpper();
                            int    obj_pro_type = Convert.ToInt32(dr.Obj_Pro_Type);

                            string obj_pro_length;
                            if (dr.Obj_Pro_Length.ToString() == null)
                            {
                                obj_pro_length = " ";
                            }
                            else
                            {
                                obj_pro_length = dr.Obj_Pro_Length.ToString();
                            }

                            int obj_pro_visible = dr.Obj_Pro_Visible;
                            int obj_pro_enable  = dr.Obj_Pro_Enable;
                            int obj_pro_null    = dr.Obj_Pro_Null;

                            if (dr.Obj_Pro_Default == null)
                            {
                                dr.Obj_Pro_Default = " ";
                            }
                            string obj_pro_default = dr.Obj_Pro_Default;

                            if (dr.Obj_Pro_Object == null)
                            {
                                dr.Obj_Pro_Object = " ";
                            }
                            string obj_pro_object = dr.Obj_Pro_Object;

                            string obj_pro_digit;
                            if (dr.Obj_Pro_Digit == null)
                            {
                                obj_pro_digit = " ";
                            }
                            else
                            {
                                obj_pro_digit = dr.Obj_Pro_Digit.ToString();
                            }

                            int obj_pro_using = dr.Obj_Pro_Using;

                            string zn_CN3 = dr.Zn_Cn;
                            string en_US3 = dr.en_Us;

                            #endregion

                            string codes = obj_code + "." + obj_table + "." + obj_pro_code;
                            //Update_FLC_Lang(codes, zn_CN3, en_US3,transaction);

                            #region 在FLC_OBJECT_PROPERTY插入数据
                            string sql = "delete FLC_OBJECT_PROPERTY where obj_code=:obj_code and obj_pro_code=:obj_pro_code";

                            var parm6 = new DynamicParameters();
                            parm6.Add(":obj_code", obj_code);
                            parm6.Add(":obj_pro_code", obj_pro_code);
                            AppDataBase.ExecuteScalar(sql, dbConnection, parm6, transaction);

                            string infopro = @"insert into FLC_OBJECT_PROPERTY values(:obj_code,:obj_table,:obj_pro_code,:obj_pro_type,:obj_pro_length,
                    :obj_pro_visible,:obj_pro_enable,:obj_pro_null,:obj_pro_default,:obj_pro_object,:obj_pro_digit,:obj_pro_using)";

                            var parm7 = new DynamicParameters();
                            parm7.Add(":obj_code", obj_code);
                            parm7.Add(":obj_table", obj_table);
                            parm7.Add(":obj_pro_code", obj_pro_code);
                            parm7.Add(":obj_pro_type", obj_pro_type);

                            parm7.Add(":obj_pro_length", obj_pro_length);
                            parm7.Add(":obj_pro_visible", obj_pro_visible);
                            parm7.Add(":obj_pro_enable", obj_pro_enable);
                            parm7.Add(":obj_pro_null", obj_pro_null);

                            parm7.Add(":obj_pro_default", obj_pro_default);
                            parm7.Add(":obj_pro_object", obj_pro_object);
                            parm7.Add(":obj_pro_digit", obj_pro_digit);
                            parm7.Add(":obj_pro_using", obj_pro_using);

                            AppDataBase.Execute(infopro, parm7, transaction);
                            #endregion

                            #region 在表中插入数据
                            //拼类型
                            string typess = string.Empty;
                            switch (obj_pro_type)
                            {
                            case 1:
                                typess = "nvarchar2(" + obj_pro_length + ")";
                                break;

                            case 2:
                                typess = "nvarchar2(" + obj_pro_length + ")";
                                break;

                            case 3:
                                typess = "number(" + obj_pro_length + ")";
                                break;

                            case 4:
                                typess = "Date";
                                break;

                            case 5:
                                typess = "nvarchar2(60)";
                                break;

                            default:
                                typess = "nvarchar2(255)";
                                break;
                            }

                            //在对象表中添加该属性
                            string add = "alter table " + obj_table + " add " + obj_pro_code + " {0}";
                            add = string.Format(add, typess);
                            AppDataBase.Execute(add, null, transaction);

                            #endregion
                        }

                        #endregion

                        transaction.Commit();
                    }
                    catch (Exception e)
                    {
                        transaction.Rollback();
                        // dbConnection.Close();
                        //transaction.Dispose();
                        throw e;
                    }
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            return("ok");
        }
        public static string crateObject_alter(crateObject_alter crateObject_Alter)
        {
            try
            {
                using (IDbConnection dbConnection = AppDataBase.DbConection)
                {
                    // dbConnection=new
                    dbConnection.Open();
                    IDbTransaction transaction = dbConnection.BeginTransaction();

                    try
                    {
                        #region 对象名称
                        Obj_Name obj_Name = crateObject_Alter.ObjectName;
                        if (obj_Name != null)
                        {
                            string obj_code = obj_Name.Obj_Code;
                            string zn_CN    = obj_Name.zn_CN;
                            string en_US    = obj_Name.en_US;

                            if (obj_Name.Is_Enable == "是")
                            {
                                obj_Name.Is_Enable = "1";
                            }
                            else
                            {
                                obj_Name.Is_Enable = "0";
                            }

                            int is_enable = Convert.ToInt32(obj_Name.Is_Enable);

                            string upobject = "update FLC_OBJECT set is_enable=:is_enable where obj_code = :obj_code";
                            var    parm3    = new DynamicParameters();
                            parm3.Add(":is_enable", is_enable);
                            parm3.Add(":obj_code", obj_code);
                            AppDataBase.Execute(upobject, parm3, transaction);
                            //Update_FLC_Lang(obj_code, zn_CN, en_US, transaction);
                        }
                        #endregion

                        #region 对象表修改
                        List <ObjRelation> objRelations = crateObject_Alter.ObjRelation;
                        foreach (ObjRelation dr in objRelations)
                        {
                            int    is_del    = dr.is_del;
                            string obj_code  = dr.obj_code;
                            string obj_table = dr.obj_table;
                            string zn_CN2    = dr.zn_CN;
                            string en_US2    = dr.en_US;
                            int    is_main   = dr.is_main;
                            //只做中英文修改 还有删除操作(flc_objects flc_obj_property flc_lang 中删除,删除表)
                            string signs = obj_code + "." + obj_table;

                            #region  除操作
                            if (is_del == 1)
                            {
                                //主表不删除
                                if (is_main == 0)
                                {
                                    //flc_objects删除
                                    string del_objects = "delete from FLC_OBJECTS where obj_code=:obj_code and obj_table=:obj_table";
                                    //flc_obj_property删除
                                    string delvalue_FlcObjPro = "delete from FLC_OBJECT_PROPERTY where obj_code=:obj_code and obj_table=:obj_table";

                                    var parm1 = new DynamicParameters();
                                    parm1.Add(":obj_code", obj_code);
                                    parm1.Add(":obj_table", obj_table);

                                    //flc_lang删除
                                    string delvalue_FlcLang = "delete from FLC_LANG where key='" + signs + "'";

                                    string sele_tb = "select count(*) from user_tables where table_name='" + obj_table + "'";

                                    string drop_table = "drop table " + obj_table;

                                    AppDataBase.Execute(del_objects, parm1, transaction);

                                    AppDataBase.Execute(delvalue_FlcObjPro, parm1, transaction);

                                    AppDataBase.Execute(delvalue_FlcLang, transaction);

                                    //判断表是否存在
                                    int i = Convert.ToInt32(AppDataBase.ExecuteScalar(sele_tb, null, transaction));
                                    if (i > 0)
                                    {
                                        AppDataBase.Execute(drop_table, null, transaction);
                                    }
                                    else
                                    {
                                        throw new Exception("此表不存在 ");
                                    }
                                }
                            }
                            #endregion

                            #region 修改操作或新增
                            else
                            {
                                // Update_FLC_Lang(signs, zn_CN2, en_US2, transaction);

                                string seobjects = "Select count(*) from FLC_OBJECTS where obj_code = :obj_code and obj_table=:obj_table";
                                var    parm10    = new DynamicParameters();
                                parm10.Add(":obj_code", obj_code);
                                parm10.Add(":obj_table", obj_table);

                                string inobjects = "insert into FLC_OBJECTS(obj_code,obj_table,is_main,id) values (:obj_code,:obj_table,:is_main,:id)";
                                //不存在就插入
                                int count = Convert.ToInt32(AppDataBase.ExecuteScalar(seobjects, dbConnection, parm10, transaction));
                                if (count < 1)
                                {
                                    int id     = MethodGetSerial.getSerialNumInt("FLC_OBJECTS", transaction);
                                    var parm11 = new DynamicParameters();
                                    parm11.Add(":obj_code", obj_code);
                                    parm11.Add(":obj_table", obj_table);
                                    parm11.Add(":is_main", is_main);
                                    parm11.Add(":id", id);

                                    AppDataBase.Execute(inobjects, parm11);

                                    //新增之后构建表
                                    string creobjtab = "create table {0} (id number null,mid number null)";
                                    creobjtab = string.Format(creobjtab, obj_table, transaction);

                                    string setable = "select count(*) coun from user_tables where table_name=:obj_table";
                                    var    parm12  = new DynamicParameters();
                                    parm12.Add(":obj_table", obj_table);
                                    int i = Convert.ToInt32(AppDataBase.ExecuteScalar(setable, dbConnection, parm12, transaction));
                                    if (count < 1)
                                    {
                                        AppDataBase.Execute(creobjtab, null, transaction);
                                    }
                                }
                            }


                            #endregion
                        }

                        #endregion

                        #region 对象表属性修改
                        List <Flc_Object_Property> objproperty = crateObject_Alter.Objproperty;

                        foreach (Flc_Object_Property dr in objproperty)
                        {
                            #region 属性

                            string is_del       = dr.Is_Del.ToString();
                            string obj_code     = dr.Obj_Code.ToUpper();
                            string obj_table    = dr.Obj_Table.ToUpper();
                            string obj_pro_code = dr.Obj_Pro_Code.ToUpper();
                            int    obj_pro_type = Convert.ToInt32(dr.Obj_Pro_Type);

                            string obj_pro_length;
                            if (dr.Obj_Pro_Length.ToString() == null)
                            {
                                obj_pro_length = " ";
                            }
                            else
                            {
                                obj_pro_length = dr.Obj_Pro_Length.ToString();
                            }

                            int obj_pro_visible = dr.Obj_Pro_Visible;
                            int obj_pro_enable  = dr.Obj_Pro_Enable;
                            int obj_pro_null    = dr.Obj_Pro_Null;

                            if (dr.Obj_Pro_Default == null)
                            {
                                dr.Obj_Pro_Default = " ";
                            }
                            string obj_pro_default = dr.Obj_Pro_Default;

                            if (dr.Obj_Pro_Object == null)
                            {
                                dr.Obj_Pro_Object = " ";
                            }
                            string obj_pro_object = dr.Obj_Pro_Object;

                            string obj_pro_digit;
                            if (dr.Obj_Pro_Digit == null)
                            {
                                obj_pro_digit = " ";
                            }
                            else
                            {
                                obj_pro_digit = dr.Obj_Pro_Digit.ToString();
                            }

                            int obj_pro_using = dr.Obj_Pro_Using;

                            string zn_CN = dr.Zn_Cn;
                            string en_US = dr.en_Us;
                            string codes = obj_code + "." + obj_table + "." + obj_pro_code;
                            #endregion

                            #region  除操作
                            if (is_del == "1" || is_del == "true")
                            {
                                string sefopro = "Select count(*) from FLC_OBJECT_PROPERTY where obj_code=:obj_code and obj_pro_code=:obj_pro_code";
                                var    parm3   = new DynamicParameters();
                                parm3.Add(":obj_code", obj_code);
                                parm3.Add(":obj_pro_code", obj_pro_code);

                                int count = Convert.ToInt32(AppDataBase.ExecuteScalar(sefopro, dbConnection, parm3, transaction));
                                if (count < 1)
                                {
                                    continue;
                                }
                                else
                                {
                                    //1.属性表中删除,2.语言表删除 3.对象表中删除
                                    string delvalue_FlcObjPro = "delete from FLC_OBJECT_PROPERTY where obj_code=:obj_code and obj_pro_code=:obj_pro_code";
                                    AppDataBase.Execute(delvalue_FlcObjPro, parm3, transaction);
                                    string delvalue_FlcLang = "delete from FLC_LANG where key='{0}'";
                                    AppDataBase.Execute(string.Format(delvalue_FlcLang, codes), null, transaction);
                                    string delcolumn = "Alter table {0} drop column {1}";
                                    AppDataBase.Execute(string.Format(delcolumn, obj_table, obj_pro_code), null, transaction);
                                }
                            }

                            #endregion

                            #region 新增或更新操作
                            else
                            {
                                #region 操作语言表
                                //Update_FLC_Lang(codes, zn_CN, en_US, transaction);
                                codes = string.Empty;
                                #endregion

                                string sefopro = "Select count(*) from FLC_OBJECT_PROPERTY where obj_code=:obj_code and obj_pro_code=:obj_pro_code";
                                string infopro = @"insert into FLC_OBJECT_PROPERTY values(:obj_code,:obj_table,:obj_pro_code,:obj_pro_type,:obj_pro_length,
                        :obj_pro_visible,:obj_pro_enable,:obj_pro_null,:obj_pro_default,:obj_pro_object,:obj_pro_digit,:obj_pro_using)";
                                string upfopro = @"update FLC_OBJECT_PROPERTY set obj_code=:obj_code,obj_table=:obj_table,obj_pro_code=:obj_pro_code,obj_pro_type=:obj_pro_type,obj_pro_length=:obj_pro_length,
                        obj_pro_visible=:obj_pro_visible,obj_pro_enable=:obj_pro_enable,obj_pro_null=:obj_pro_null,obj_pro_default=:obj_pro_default,obj_pro_object=:obj_pro_object,
                        obj_pro_digit=:obj_pro_digit,obj_pro_using=:obj_pro_using where obj_code=:obj_code and obj_pro_code=:obj_pro_code";

                                var parm3 = new DynamicParameters();
                                parm3.Add(":obj_code", obj_code);
                                parm3.Add(":obj_pro_code", obj_pro_code);

                                var parm4 = new DynamicParameters();
                                parm4.Add(":obj_code", obj_code);
                                parm4.Add(":obj_table", obj_table);
                                parm4.Add(":obj_pro_code", obj_pro_code);
                                parm4.Add(":obj_pro_type", obj_pro_type);
                                parm4.Add(":obj_pro_length", obj_pro_length);
                                parm4.Add(":obj_pro_visible", obj_pro_visible);
                                parm4.Add(":obj_pro_enable", obj_pro_enable);
                                parm4.Add(":obj_pro_null", obj_pro_null);
                                parm4.Add(":obj_pro_default", obj_pro_default);
                                parm4.Add(":obj_pro_object", obj_pro_object);
                                parm4.Add(":obj_pro_digit", obj_pro_digit);
                                parm4.Add(":obj_pro_using", obj_pro_using);

                                string typess = string.Empty;
                                switch (obj_pro_type)
                                {
                                case 1:
                                    typess = "nvarchar2(" + obj_pro_length + ")";
                                    break;

                                case 2:
                                    typess = "nvarchar2(" + obj_pro_length + ")";
                                    break;

                                case 3:
                                    typess = "number(" + obj_pro_length + ")";
                                    break;

                                case 4:
                                    typess = "Date";
                                    break;

                                case 5:
                                    typess = "nvarchar2(60)";
                                    break;

                                //case 6:
                                //typess = "nvarchar2(255)";
                                //break;
                                default:
                                    typess = "nvarchar2(255)";
                                    break;
                                }

                                int count = Convert.ToInt32(AppDataBase.ExecuteScalar(sefopro, dbConnection, parm3, transaction));
                                if (count < 1)
                                {
                                    AppDataBase.Execute(infopro, parm4, transaction);
                                    //判断表是否存在 不存在报错
                                    string setable = "select count(*) coun from user_tables where table_name='" + obj_table + "'";
                                    int    i       = Convert.ToInt32(AppDataBase.ExecuteScalar(setable, null, transaction));

                                    if (i > 0)
                                    {
                                        //在对象表中添加该属性
                                        string add = "alter table " + obj_table + " add " + obj_pro_code + " " + typess;
                                        AppDataBase.Execute(add, null, transaction);
                                    }
                                }
                                else
                                {
                                    //更新之后对应语言表也要更新(已完成) 同时对象表也要更新修改
                                    //此处修改对象表有1种 修改字段类型
                                    string gettype   = "select obj_pro_type from flc_object_property where obj_code=:obj_code and obj_pro_code=:obj_pro_code";
                                    string getlength = "select obj_pro_length from flc_object_property where obj_code=:obj_code and obj_pro_code=:obj_pro_code";

                                    var parm5 = new DynamicParameters();
                                    parm5.Add(":obj_code", obj_code);
                                    parm5.Add(":obj_pro_code", obj_pro_code);

                                    int type = Convert.ToInt32(AppDataBase.ExecuteScalar(gettype, dbConnection, parm5, transaction));

                                    string length = AppDataBase.ExecuteScalar(getlength, dbConnection, parm5, transaction).ToString();
                                    if (length == "")
                                    {
                                        length = "0";
                                    }

                                    //更新属性表中值
                                    AppDataBase.Execute(upfopro, parm4, transaction);
                                    if (obj_pro_length == "")
                                    {
                                        obj_pro_length = "0";
                                    }
                                    if (type == obj_pro_type && Convert.ToInt32(length) >= Convert.ToInt32(obj_pro_length))
                                    {
                                        continue;
                                    }
                                    else
                                    {
                                        //此处异常会有很多
                                        try
                                        {
                                            string alter = "alter table {0} modify {1} {2}";
                                            alter = string.Format(alter, obj_table, obj_pro_code, typess);
                                            AppDataBase.Execute(alter, null, transaction);
                                        }
                                        catch (Exception e)
                                        {
                                            throw new Exception(e.ToString());
                                        }
                                    }
                                }
                            }
                        }
                        #endregion

                        #endregion
                    }
                    catch (Exception e)
                    {
                        transaction.Rollback();
                        throw e;
                    }

                    transaction.Commit();
                }
            }
            catch (Exception e)
            {
                throw e;
            }

            return("ok");
        }