Пример #1
0
        public void DataLoadold()
        {
            InvokeReFreshDgv rf = new InvokeReFreshDgv(GetConfigList);

            this.BeginInvoke(rf, new object[] { "1" });
        }
Пример #2
0
        public void Execute()
        {
            #region   循环
            if (ExecuteStatus == 0)
            {
                if (dgv.Rows.Count > 0)
                {
                    for (int i = 0; i < dgv.Rows.Count; i++)
                    {
                        model    = new Config();
                        model.Id = 0;
                        string date      = dgv.Rows[i].Cells["本次执行时间"].Value.ToString().Trim();
                        int    id        = int.Parse(dgv.Rows[i].Cells["编号"].Value.ToString().Trim());
                        string statusrow = dgv.Rows[i].Cells["线程状态"].Value.ToString().Trim();
                        if (date != "" && !dtslist.Contains(id))
                        {
                            DateTime dt = Convert.ToDateTime(date);
                            if (DateTime.Now >= dt.AddSeconds(-10))
                            {
                                #region 组织实体对象



                                model.Id                 = id;
                                model.FileFormatName     = dgv.Rows[i].Cells[12].Value.ToString().Trim();
                                model.DateSql            = dgv.Rows[i].Cells["数据集Sql"].Value.ToString().Trim();
                                model.BecomeValidateDate = DateTime.Parse(dgv.Rows[i].Cells["首次执行日期"].Value.ToString().Trim());
                                model.BusinessName       = dgv.Rows[i].Cells["业务名称"].Value.ToString().Trim();
                                model.ConfigType         = Convert.ToInt32(dgv.Rows[i].Cells["配置方式"].Value.ToString().Trim() == "内置配置" ? "0" : "1");
                                model.Cycle              = dgv.Rows[i].Cells["周期"].Value.ToString().Trim();
                                string type    = dgv.Rows[i].Cells["文件格式"].Value.ToString().Trim();
                                int    inttype = 2;
                                switch (type)
                                {
                                case "Excel97_2003": inttype = 1; break;

                                case "Excel2007": inttype = 2; break;

                                case "文本文件": inttype = 3; break;

                                case "csv": inttype = 4; break;
                                }
                                model.FileType            = inttype;
                                model.LoseEfficacyDate    = DateTime.Parse(dgv.Rows[i].Cells["失效日期"].Value.ToString().Trim());
                                model.NextVoluntarilyTime = DateTime.Parse(date);
                                model.PathName            = dgv.Rows[i].Cells["文件路径"].Value.ToString().Trim();

                                model.IsHead     = Convert.ToBoolean(dgv.Rows[i].Cells["是否显示头部"].Value.ToString().Trim());
                                model.ServerType = dgv.Rows[i].Cells["数据访问类型"].Value.ToString().Trim();

                                model.OrgCode = dgv.Rows[i].Cells["机构编码"].Value.ToString().Trim();

                                #endregion

                                listModel.Add(model);
                                dtslist.Add(model.Id);



                                break;
                            }
                        }
                    }

                    if (model.Id > 0)
                    {
                        ExecuteStatus = 1;
                        dal.ExecuteConfig(model, DateTime.Now);


                        InvokeReFreshDgv rf = new InvokeReFreshDgv(RemoveDgv);
                        this.BeginInvoke(rf, new object[] { model.Id.ToString().Trim() });



                        ExecuteStatus = 0;
                    }
                }
            }
            #endregion
        }
Пример #3
0
        public void InvokeDGVClear()
        {
            InvokeReFreshDgv rf = new InvokeReFreshDgv(DGVClear);

            this.BeginInvoke(rf, new object[] { "0" });
        }