Beispiel #1
0
        public static ModuleConfiguration InitModuleConfiguration(string Index)
        {
            ModuleConfiguration Model = Agent.CallLocalService("Yqun.BO.BusinessManager.dll", "InitModuleConfiguration", new object[] { Index }) as ModuleConfiguration;
            Hashtable           Infos = DepositoryModuleConfiguration.InitModelTableInfo(Index);

            foreach (SheetConfiguration sheet in Model.Sheets)
            {
                sheet.DataTableSchema.Schema = Infos[sheet.Index] as TableDefineInfo;
            }

            return(Model);
        }
        public static bool Delete(string Code)
        {
            StringBuilder Sql_Select = new StringBuilder();

            //增加字段Scdel=0     2013-10-19
            Sql_Select.Append("Select * From sys_biz_Module Where Scdel=0 and CatlogCode like '");
            Sql_Select.Append(Code);
            Sql_Select.Append("%'");
            DataTable Data = Agent.CallService("Yqun.BO.LoginBO.dll", "GetDataTable", new object[] { Sql_Select.ToString() }) as DataTable;

            if (Data != null && Data.Rows.Count > 0)
            {
                foreach (DataRow Row in Data.Rows)
                {
                    String Index = Row["ID"].ToString();
                    ModuleConfiguration Configuration = DepositoryModuleConfiguration.InitModuleConfiguration(Index);
                    DepositoryModuleConfiguration.Delete(Configuration);
                }
            }
            //增加字段Scts_1,Scdel 之后 删除操作只做伪删除,便于数据同步     2013-10-15
            StringBuilder Sql_Delete = new StringBuilder();

            //Sql_Delete.Append("Delete From sys_biz_ModuleCatlog Where CatlogCode like '");
            //Sql_Delete.Append(Code);
            //Sql_Delete.Append("%'");
            Sql_Delete.Append("Update sys_biz_ModuleCatlog Set Scts_1='" + DateTime.Now + "',Scdel=1");
            Sql_Delete.Append(" Where CatlogCode like '");
            Sql_Delete.Append(Code);
            Sql_Delete.Append("%'");

            Boolean Result = false;

            try
            {
                object r = Agent.CallService("Yqun.BO.LoginBO.dll", "ExcuteCommand", new object[] { Sql_Delete.ToString() });
                Result = (Convert.ToInt32(r) == 1);
            }
            catch
            { }

            return(Result);
        }
Beispiel #3
0
        public static Boolean UpdateCache(String ModelIndex)
        {
            Boolean Result = false;

            List <string> CacheTableNames = new List <string>();

            CacheTableNames.Add("sys_columns");

            List <IndexDescriptionPair> SheetList = DepositoryModuleConfiguration.InitModuleInfo(ModelIndex);
            List <string> DataTables = new List <string>();

            foreach (IndexDescriptionPair pair in SheetList)
            {
                DataTables.Add(pair.DataTable);
            }

            List <string> Wheres = new List <string>();

            if (DataTables.Count > 0)
            {
                Wheres.Add("where TableName in ('" + string.Join("','", DataTables.ToArray()) + "')");
            }
            else
            {
                Wheres.Add("where 1<> 1");
            }

            foreach (string TableName in CacheTableNames)
            {
                int index = CacheTableNames.IndexOf(TableName);
                string where = Wheres[index];
                List <String> IDList         = GetNewTableIDList(TableName, where);
                List <String> ExistingIDList = GetExistingTableIDList(TableName, where);
                Result = ExecuteDeletedCommand(TableName, IDList, ExistingIDList);
                Result = Result & ExecuteUpdateCommand(TableName, IDList, ExistingIDList);
            }

            return(Result);
        }
Beispiel #4
0
 public static Boolean HaveModuleConfiguration(string Index)
 {
     return(DepositoryModuleConfiguration.HaveModuleConfiguration(Index));
 }
Beispiel #5
0
        private void StadiumItemSelector_Load(object sender, EventArgs e)
        {
            String ErrorInfo = "";

            ProgressScreen.Current.ShowSplashScreen();
            this.AddOwnedForm(ProgressScreen.Current);

            ProgressScreen.Current.SetStatus = "正在加载模板...";
            ModelInfo = DepositoryModuleConfiguration.InitModuleConfiguration(ModelIndex);

            try
            {
                fpSpread1.Sheets.Clear();
                foreach (SheetConfiguration Sheet in ModelInfo.Sheets)
                {
                    if (Sheet == null)
                    {
                        continue;
                    }

                    ProgressScreen.Current.SetStatus = "正在初始化表单‘" + Sheet.Description + "’";

                    SheetView SheetView = Serializer.LoadObjectXml(typeof(SheetView), Sheet.SheetStyle, "SheetView") as SheetView;
                    SheetView.Tag        = Sheet;
                    SheetView.SheetName  = Sheet.Description;
                    SheetView.ZoomFactor = 1.0F;
                    fpSpread1.Sheets.Add(SheetView);

                    SheetConfiguration Configuration = SheetView.Tag as SheetConfiguration;
                    if (Configuration.DataTableSchema.Schema == null)
                    {
                        continue;
                    }

                    foreach (FieldDefineInfo field in Configuration.DataTableSchema.Schema.FieldInfos)
                    {
                        SheetView.Cells[field.RangeInfo].BackColor = Color.LightPink;
                        SheetView.Cells[field.RangeInfo].Tag       = field;
                    }
                }

                lView_ExtentDataItems.Items.Clear();
                foreach (FieldDefineInfo fieldInfo in ModelInfo.ExtentDataSchema.FieldInfos)
                {
                    ListViewItem Item = new ListViewItem();
                    Item.Text = fieldInfo.FieldName;
                    Item.Tag  = fieldInfo;
                    Item.SubItems.Add(fieldInfo.Description);
                    Item.SubItems.Add(fieldInfo.FieldType.Description);


                    lView_ExtentDataItems.Items.Add(Item);
                }
            }
            catch (Exception ex)
            {
                ErrorInfo = ex.Message;
            }

            this.RemoveOwnedForm(ProgressScreen.Current);
            ProgressScreen.Current.CloseSplashScreen();
            Activate();

            label2.BackColor = Color.LightPink;

            if (ErrorInfo != "")
            {
                MessageBox.Show("加载模板出错!\r\n原因:" + ErrorInfo, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }