Esempio n. 1
0
    protected void actualizarDatosActCurriculares()
    {
        DataSet ds = new DataSet();

        System.Xml.XmlDocument CVAR = sgwFunciones.CONEAU.Docentes.cvarLeerXML(Session["CUIT"].ToString(), "cargosDocencia/superiorPosgrado");
        ds.ReadXml(new XmlNodeReader(CVAR));
        if (ds.Tables.Count == 0)
        {
            return;
        }
        DataSet ds2 = new DataSet();

        if (ds.Tables[0].ChildRelations.Count > 2)
        {
            ds2.Tables.Add(ds.Tables[0].ChildRelations[2].ChildTable.ChildRelations[0].ChildTable.Clone());
            string clave = grdCargosDocentesActual.GetRowValues(grdCargosDocentesActual.FocusedRowIndex, grdCargosDocentesActual.KeyFieldName).ToString();
            foreach (DataRow FRow in ds.Tables[0].ChildRelations[2].ChildTable.Rows)
            {
                if (FRow[grdCargosDocentesActual.KeyFieldName].ToString() == clave)
                {
                    foreach (DataRow row in FRow.GetChildRows(ds.Tables[0].ChildRelations[2].ChildTable.ChildRelations[0]))
                    {
                        ds2.Tables[0].ImportRow(row);
                    }
                }
            }
            grdActCurricular.KeyFieldName = ds.Tables[0].ChildRelations[2].ChildTable.PrimaryKey[0].Caption;
            grdActCurricular.DataSource   = ds2;
            grdActCurricular.DataBind();
        }
    }
Esempio n. 2
0
        public static bool ChangeStep(string changeInfo, string type)
        {
            FRow fRow = new FRow("ChangeInfo");

            fRow["ChangeInfo"] = OperatorProvider.Provider.GetCurrent().UserName + "操作:" + changeInfo;
            fRow["Type"]       = type;
            return(fRow.Insert());
        }
Esempio n. 3
0
        public void CodeGeneratorUpdate(TableEntity entity)
        {
            FRow fRow = new FRow("Sys_TableInfo", entity.Id);

            fRow["ClassPrefix"]     = entity.ClassPrefix;
            fRow["Description"]     = entity.Description;
            fRow["OutputModel"]     = entity.OutputModel;
            fRow["SelectListField"] = entity.SelectListField;
            fRow["SelectFormField"] = entity.SelectFormField;
            fRow.Update();
        }
Esempio n. 4
0
        public Task Execute(IJobExecutionContext context)
        {
            return(Task.Run(async() =>
            {
                string f_Id = "", msg = "成功";
                int logStatus = 1;
                JobDataMap jobData = null;
                AutoJobEntity autoJobEntity = null;
                try
                {
                    jobData = context.JobDetail.JobDataMap;
                    f_Id = jobData["Id"].ToString();
                    // 获取数据库中的任务
                    autoJobEntity = autoJobApp.GetForm(f_Id);
                    if (autoJobEntity != null)
                    {
                        if (autoJobEntity.JobStatus == 1)
                        {
                            CronTriggerImpl trigger = context.Trigger as CronTriggerImpl;
                            if (trigger != null)
                            {
                                if (trigger.CronExpressionString != autoJobEntity.CronExpression)
                                {
                                    // 更新任务周期
                                    trigger.CronExpressionString = autoJobEntity.CronExpression;
                                    await JobScheduler.GetScheduler().RescheduleJob(trigger.Key, trigger);
                                }

                                #region 执行任务
                                switch (context.JobDetail.Key.Name)
                                {
                                case "Comrms":    //期货
                                    if (!new GetComrmsJob().Start())
                                    {
                                        logStatus = 0;
                                        msg = "失败";
                                    }
                                    break;

                                default:
                                    //todo
                                    break;
                                }
                                #endregion
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    msg = ex.ToString();
                    logStatus = 0;
                }

                try
                {
                    if (autoJobEntity != null)
                    {
                        if (autoJobEntity.JobStatus == 1)
                        {
                            //更新下次运行时间
                            DbHelper.ExecuteNonQuery("update Sys_AutoJob set NextStartTime='" + context.NextFireTimeUtc.Value.DateTime.AddHours(8) + "' where F_Id='" + autoJobEntity.F_Id + "'");

                            //记录执行状态
                            FRow fRow = new FRow("Sys_AutoJobLog");
                            fRow["F_CreatorTime"] = context.JobDetail.Key.Group;
                            fRow["JobGroupName"] = context.JobDetail.Key.Name;
                            fRow["LogStatus"] = logStatus;
                            fRow["F_Description"] = msg;
                            fRow.Insert();
                        }
                    }
                }
                catch (Exception ex)
                {
                    LogFactory.GetLogger().Error(ex);
                }
            }));
        }