Esempio n. 1
0
        private object GetParties(string formid, string formType)
        {
            List <law_party> lawParties = new List <law_party>();
            DataTable        dt         = new DataTable();

            QueryDb.Fill(dt, "where Associatedobjecttype=@0 and AssociationobjectID=@1", formType, formid);
            if (dt.Rows.Count > 0)
            {
                foreach (var d in dt.Rows)
                {
                    var       dr       = d as DataRow;
                    law_party lawParty = new law_party();
                    lawParty.address           = (string)dr["address"];
                    lawParty.Contactnumber     = (string)dr["Contactnumber"];
                    lawParty.IDcard            = (string)dr["IDcard"];
                    lawParty.Name              = (string)dr["Name"];
                    lawParty.Nameoflegalperson = (string)dr["Nameoflegalperson"];
                    lawParty.Nationality       = (string)dr["Nationality"];
                    lawParty.Occupation        = (string)dr["Occupation"];
                    lawParty.Typesofparties    = (string)dr["TypesofpartiesID"];
                    lawParty.Gender            = (string)dr["Gender"];
                    lawParties.Add(lawParty);
                }
                return(lawParties);
            }
            return(null);
        }
        public object Handle(APIContext context)
        {
            var data = JsonHelper.DeserializeJsonToObject <form_confiscatedFinishReq>(context.Data);

            if (data.formConfiscated == null)
            {
                return(null);
            }
            if (!string.IsNullOrEmpty(data.EventInfoId))
            {
                data.formConfiscated.EventInfoId = data.EventInfoId;
            }
            if (!string.IsNullOrEmpty(data.SourceTaskId))
            {
                data.formConfiscated.TaskId = data.SourceTaskId;
            }
            QueryDb.BeginTransaction();
            try
            {
                CreateInfo(data.formConfiscated, data.formConfiscatedItems);
                _sHBaseService.CreatTasksAndCreatWorkrecor(data.NextTasks, data.SourceTaskId); //创建下一步任务
                _sHBaseService.UpdateWorkTaskState(data.SourceTaskId, WorkTaskStatus.Close);   //关闭任务
            }
            catch (Exception)
            {
                QueryDb.AbortTransaction();
                throw new Exception();
            }
            QueryDb.CompleteTransaction();
            return(true);
        }
        /// <summary>
        /// 创建表单和当事人
        /// </summary>
        /// <param name="TaskSurvey"></param>
        /// <param name="law_Parties"></param>
        /// <returns></returns>
        private void CreateInfo(law_punishmentInfo lawpunishmentInfo, List <law_party> law_Parties, List <attachment> attachments)
        {
            var lawpunishment_Info = base.Create(lawpunishmentInfo) as string;//保存原始信息

            lawpunishmentInfo.ID = lawpunishment_Info;
            if (law_Parties != null && law_Parties.Count > 0)//创建当事人
            {
                foreach (var l in law_Parties)
                {
                    l.Associatedobjecttype = "law_punishmentInfo";
                    l.AssociationobjectID  = lawpunishment_Info;
                    l.ID           = Guid.NewGuid().ToString();
                    l.CreateDate   = DateTime.Now;
                    l.CreateUserID = SysContext.WanJiangUserID;
                    QueryDb.Insert(l);
                }
            }
            if (attachments != null && attachments.Count > 0)
            {
                foreach (var a in attachments)
                {
                    a.Associatedobjecttype = "law_punishmentInfo";
                    a.AssociationobjectID  = lawpunishment_Info;
                    a.ID           = Guid.NewGuid().ToString();
                    a.CreateDate   = DateTime.Now;
                    a.CreateUserID = SysContext.WanJiangUserID;
                    QueryDb.Insert(a);
                }
            }
            //更新案件信息
            if (string.IsNullOrEmpty(lawpunishmentInfo.TaskId))
            {
                if (!string.IsNullOrEmpty(lawpunishmentInfo.CaseId))
                {
                    var caseinfo = QueryDb.FirstOrDefault <case_Info>("where Id=@0", lawpunishmentInfo.CaseId);
                    if (caseinfo != null)
                    {
                        caseinfo.CaseStatus = "做出处罚决定";
                        QueryDb.Update(caseinfo);
                    }
                }
            }
            else
            {
                var tasknow = ServiceHelper.GetService("work_task").GetDetailData(lawpunishmentInfo.TaskId, null);
                if (tasknow != null)
                {
                    var caseid = (string)tasknow["CaseID"];
                    if (!string.IsNullOrEmpty(caseid))
                    {
                        var caseinfo = QueryDb.FirstOrDefault <case_Info>("where Id=@0", caseid);
                        if (caseinfo != null)
                        {
                            caseinfo.CaseStatus = "做出处罚决定";
                            QueryDb.Update(caseinfo);
                        }
                    }
                }
            }
        }
        public object Handle(APIContext context)
        {
            var data = JsonHelper.DeserializeJsonToObject <form_confiscatedFinishReq>(context.Data);

            if (data.formConfiscatedItems == null)
            {
                return(null);
            }
            QueryDb.BeginTransaction();
            try
            {
                CreateInfo(data.formConfiscatedItems, data.SourceTaskId, data.EventInfoId);

                EndEvent(data.SourceTaskId, data.EventInfoId);

                _sHBaseService.CreatTasksAndCreatWorkrecor(data.NextTasks, data.SourceTaskId);
            }
            catch (Exception)
            {
                QueryDb.AbortTransaction();
                throw new Exception();
            }
            QueryDb.CompleteTransaction();
            return(true);
        }
        //注意isfine isgood是不是被添加字段修改了
        public object Handle(APIContext context)
        {
            var data = JsonHelper.DeserializeJsonToObject <law_punishmentInfoFinishReq>(context.Data);

            if (data.LawPunishmentInfo == null)
            {
                throw new Exception("没有主体数据");
            }
            QueryDb.BeginTransaction();
            data.LawPunishmentInfo.EventInfoId = data.EventInfoId;
            data.LawPunishmentInfo.TaskId      = data.SourceTaskId;
            try
            {
                CreateInfo(data.LawPunishmentInfo, data.LawParties, data.Attachments);
                _sHBaseService.CreatTasksAndCreatWorkrecor(data.NextTasks, data.SourceTaskId);
                _sHBaseService.UpdateWorkTaskState(data.SourceTaskId, WorkTaskStatus.Close);//关闭任务
            }
            catch (Exception e)
            {
                QueryDb.AbortTransaction();
                throw new Exception(e.Message);
            }
            QueryDb.CompleteTransaction();
            //打印预生成
            var PDFSerivce = ServiceHelper.GetService("form_printPDFService") as form_printPDFService;

            PDFSerivce.AsposeToPdf(new APIContext()
            {
                Data = @"{""formId"":""" + data.LawPunishmentInfo.ID + @""",""formType"":""law_punishmentInfo""}"
            });
            return(true);
        }
Esempio n. 6
0
        private void bntConfirm_Click(object sender, EventArgs e)
        {
            if (tBxJobName.Text != "")
            {
                currentJob.JobName     = tBxJobName.Text;
                currentJob.ReceiptDate = dTPReceiptDate.Value;
                if (!checkBox1.Checked)
                {
                    currentJob.DismissDate = dTPDissmissDate.Value;
                }
                else
                {
                    currentJob.DismissDate = DateTime.MinValue;
                }
                currentJob.DismissReason = tBxDismissReason.Text;
                if (currentJob.Id == 0)
                {
                    QueryDb.InsertRecentJob(currentJob);
                }
                else
                {
                    QueryDb.UpdateRecentJob(currentJob);
                }

                updateDGW(currentJob.ProfileId);
                this.Close();
            }
            else
            {
                MessageBox.Show("Введите название места работы.");
            }
        }
Esempio n. 7
0
        public object Handle(APIContext context)
        {
            var data = JsonHelper.DeserializeJsonToObject <case_coverFinishReq>(context.Data);

            if (data.CaseCover == null)
            {
                throw new Exception("没有主体数据");
            }
            data.CaseCover.TaskId      = data.SourceTaskId;
            data.CaseCover.EventInfoId = data.EventInfoId;
            QueryDb.BeginTransaction();
            try
            {
                CreateInfo(data.CaseCover);
                _sHBaseService.CreatTasksAndCreatWorkrecor(data.NextTasks, data.SourceTaskId);
                _sHBaseService.UpdateWorkTaskState(data.SourceTaskId, WorkTaskStatus.Close);//关闭任务
            }
            catch (Exception e)
            {
                QueryDb.AbortTransaction();
                throw e;
            }
            QueryDb.CompleteTransaction();
            return(true);
        }
Esempio n. 8
0
        /// <summary>
        /// 创建表单和当事人
        /// </summary>
        /// <param name="TaskSurvey"></param>
        /// <param name="law_Parties"></param>
        /// <returns></returns>
        private void CreateInfo(task_survey TaskSurvey, List <law_party> law_Parties, List <attachment> attachments)
        {
            var tasksurvey = base.Create(TaskSurvey) as string;
            var _Lawpartys = ServiceHelper.GetService("law_partyService");

            if (law_Parties != null && law_Parties.Count > 0) //创建当事人
            {
                foreach (var l in law_Parties)                //原始的当事人
                {
                    l.Associatedobjecttype = "task_survey";
                    l.AssociationobjectID  = tasksurvey;
                    l.ID           = Guid.NewGuid().ToString();
                    l.CreateUserID = SysContext.WanJiangUserID;
                    QueryDb.Insert(l);
                    // ServiceHelper.GetService("law_partyService").Create(l);
                }
                if (attachments != null && attachments.Count > 0)
                {
                    foreach (var a in attachments)
                    {
                        a.Associatedobjecttype = "task_survey";
                        a.AssociationobjectID  = tasksurvey;
                        a.ID           = Guid.NewGuid().ToString();
                        a.CreateUserID = SysContext.WanJiangUserID;
                        QueryDb.Insert(a);
                        // _attachment.Create(a);
                    }
                }
            }
        }
        /// <summary>
        /// 获取执法人员
        /// </summary>
        /// <param name="aPIContext"></param>
        /// <returns></returns>
        private Model.Entity.loc_field_staff GetStaff(APIContext aPIContext)
        {
            var locationKey = aPIContext.Context;//根据地址关键词获取用户

            Model.Entity.loc_field_staff rev = QueryDb.FirstOrDefault <Model.Entity.loc_field_staff>("where Lawenforcer=1 and EnforcementScope like @0", new object[] { $"%{locationKey}%" });
            return(rev);
        }
Esempio n. 10
0
        public object Handle(APIContext context)
        {
            var data = JsonHelper.DeserializeJsonToObject <case_InfoFinishReq>(context.Data);

            if (data.CaseInfo == null)
            {
                throw new Exception("没有主体数据");
            }
            data.CaseInfo.TaskId      = data.SourceTaskId;
            data.CaseInfo.EventInfoId = data.EventInfoId;
            QueryDb.BeginTransaction();
            try
            {
                string caseid = CreateInfo(data.CaseInfo, data.LawParties);
                if (data.NextTasks != null || data.NextTasks.Length > 0)
                {
                    foreach (var t in data.NextTasks)
                    {
                        t.CaseID = caseid;
                    }
                }
                _sHBaseService.CreatTasksAndCreatWorkrecor(data.NextTasks, data.SourceTaskId);
                _sHBaseService.UpdateWorkTaskState(data.SourceTaskId, WorkTaskStatus.Close);//关闭任务
            }
            catch (Exception e)
            {
                QueryDb.AbortTransaction();
                throw e;
            }
            QueryDb.CompleteTransaction();
            return(true);
        }
Esempio n. 11
0
        public object Handle(APIContext context)
        {
            var data = JsonHelper.DeserializeJsonToObject <task_surveyFinishReq>(context.Data);

            if (data.TaskSurvey == null)
            {
                throw new Exception("没有主体数据");
            }
            ;
            QueryDb.BeginTransaction();
            data.TaskSurvey.TaskId      = data.SourceTaskId;
            data.TaskSurvey.EventInfoId = data.EventInfoId;
            try
            {
                CreateInfo(data.TaskSurvey, data.LawParties, data.Attachments);
                switch (data.TaskSurvey.ProcessingDecisions)
                {
                case 0:
                    EndEvent(data.SourceTaskId, data.EventInfoId);
                    break;

                default:
                    _sHBaseService.CreatTasksAndCreatWorkrecor(data.NextTasks, data.SourceTaskId);
                    break;
                }
            }
            catch (Exception e)
            {
                QueryDb.AbortTransaction();
                throw e;
            }
            QueryDb.CompleteTransaction();
            return(true);
        }
Esempio n. 12
0
        private void btnReport_Click(object sender, EventArgs e)
        {
            if (profileDataGridView.SelectedRows.Count > 0)
            {
                int[] profileIds = new int[profileDataGridView.SelectedRows.Count];
                int   i          = 0;
                foreach (DataGridViewRow row in profileDataGridView.SelectedRows)
                {
                    profileIds[i] = Convert.ToInt32(row.Cells["Id"].Value);
                    i++;
                }
                DataTable          profiles    = QueryDb.SelectProfilesByIds(profileIds);
                DataTable          recentJobs  = QueryDb.SelectJobsByProfileIds(profileIds);
                List <ProfileJobs> profJobList = new List <ProfileJobs>();
                foreach (var profile in profiles.AsEnumerable())
                {
                    ProfileJobs pj = new ProfileJobs();
                    pj.Profile = new Profile(profile);
                    DataTable jobs = recentJobs.AsEnumerable()
                                     .Where(r => r.Field <int>("ProfileId") == pj.Profile.Id).CopyToDataTable();
                    foreach (var job in jobs.AsEnumerable())
                    {
                        RecentJob rj = new RecentJob(job);
                        pj.AddRecentJob(rj);
                    }

                    profJobList.Add(pj);
                }
                ReportForm report = new ReportForm(profJobList);
                report.Show();
            }
        }
Esempio n. 13
0
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            if (tbxFullName.Text != "" && tbxBirthPlace.Text != "" && tbxPassportData.Text != "" &&
                tbxPersonalQualities.Text != "" && tbxCharacteristics.Text != "")
            {
                currProfile.FullName          = tbxFullName.Text;
                currProfile.BirthDate         = dtpBirthDay.Value;
                currProfile.BirthPlace        = tbxBirthPlace.Text;
                currProfile.PassportData      = tbxPassportData.Text;
                currProfile.PersonalQualities = tbxPersonalQualities.Text;
                currProfile.Characteristics   = tbxCharacteristics.Text;
                if (currProfile.EntryDate == DateTime.MinValue)
                {
                    currProfile.EntryDate = DateTime.Today;
                }
                if (currProfile.Id == 0)
                {
                    QueryDb.InsertProfile(currProfile);
                }
                else
                {
                    QueryDb.UpdateProfile(currProfile);
                }

                updateDGW();
                this.Close();
            }
            else
            {
                MessageBox.Show("Заполните все поля.");
            }
        }
Esempio n. 14
0
        /// <summary>
        /// 创建任务
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private object CreateTask(APIContext context)
        {
            var data = JsonHelper.DeserializeJsonToObject <work_task>(context.Data);

            QueryDb.BeginTransaction();
            try
            {
                CreatTasksAndCreatWorkrecor(new work_task[] { data }, "");
                if (!string.IsNullOrEmpty(data.WorkAddress))
                {
                    UpdateEventStateHandler(data.EventInfoId, EventStatus.doning, data.WorkAddress + " " + data.MainHandler);
                }
                else
                {
                    UpdateEventState(data.EventInfoId, EventStatus.doning);
                }
                QueryDb.CompleteTransaction();
            }
            catch (Exception e)
            {
                QueryDb.AbortTransaction();
                throw e;
            }
            return(true);
        }
Esempio n. 15
0
        private void task_surveyService_OnAfterGetDetailData(object query, object data)
        {
            var    o        = data as Dictionary <string, object>;
            string taskType = o["ProcessingDecisions"].ToString();

            if (taskType == "1")
            {
                o["ProcessingDecisions"] = "不予处罚";
            }
            if (taskType == "2")
            {
                o["ProcessingDecisions"] = "移送其他部门";
            }
            if (taskType == "3")
            {
                o["ProcessingDecisions"] = "处罚程序";
            }

            var res_dictionary = QueryDb.FirstOrDefault <res_dictionary>("where DicCode=@0", "EventType");
            var dicItems       = QueryDb.Query <res_dictionaryItems>("SELECT * FROM res_dictionaryitems where DicID=@0", res_dictionary.ID).ToDictionary(k => k.ID, v => v.Title);
            var eventType      = o["EventType"].ToString();

            if (dicItems.ContainsKey(eventType))
            {
                o["EventType"] = dicItems[eventType];
            }
        }
Esempio n. 16
0
 public CourseController(UserManager <ApplicationUser> userManager, ILoggerFactory loggerFactory,
                         QueryDb queryDb, IMapper mapper)
 {
     this.userManager = userManager;
     this.queryDb     = queryDb;
     _logger          = loggerFactory.CreateLogger <CourseController>();
     this.mapper      = mapper;
 }
Esempio n. 17
0
 public ApiController(QueryDb queryDb, IMapper mapper, IHttpContextAccessor httpContextAccessor, SyncService syncService, IOptions <ConfigurationOptions> options)
 {
     _queryDb             = queryDb;
     _mapper              = mapper;
     _httpContextAccessor = httpContextAccessor;
     _syncService         = syncService;
     _options             = options.Value;
 }
Esempio n. 18
0
        object HandleState(APIContext context)
        {
            List <object> retList = new List <object>();

            retList.Add(new { StateName = "待受理", Count = QueryDb.ExecuteScalar <int>("SELECT count(*) FROM event_info where (evtState='unAccept' or (evtState!='unAccept' and evtState!='doing' and evtState!='done')) and OriginalID is not null ") });
            retList.Add(new { StateName = "处理中", Count = QueryDb.ExecuteScalar <int>("SELECT count(*) FROM event_info where evtState='doing' and OriginalID is not null") });
            retList.Add(new { StateName = "已处理", Count = QueryDb.ExecuteScalar <int>("SELECT count(*) FROM event_info where evtState='done' and OriginalID is not null") });
            return(retList);
        }
Esempio n. 19
0
        private void Event_infoService_OnAfterSave(object entity, object viewdata, bool isCreate)
        {
            var eventInfo = viewdata as event_info;

            if (string.IsNullOrWhiteSpace(eventInfo.OriginalID) && !isCreate) //四方德信修改了上传的事件数据的状态, 同步修改备份数据
            {
                QueryDb.Execute(string.Format("update event_info set evtState='{0}' where OriginalID='{1}'", eventInfo.evtState, eventInfo.objId));
            }
        }
Esempio n. 20
0
 private void selectJobsByProfile(object sender, DataGridViewCellEventArgs e)
 {
     if (Convert.ToInt32(((DataTable)profileDataGridView.DataSource).Rows[e.RowIndex]["Id"]) > 0)
     {
         int       id       = Convert.ToInt32(((DataTable)profileDataGridView.DataSource).Rows[e.RowIndex]["Id"]);
         string    fullName = ((DataTable)profileDataGridView.DataSource).Rows[e.RowIndex]["FullName"].ToString();
         DataTable dt       = QueryDb.GetJobsByProfile(id);
         ShowProfileForm(dt, id, fullName);
     }
 }
Esempio n. 21
0
        /// <summary>
        /// 创建后续任务
        /// </summary>
        /// <param name="NextTasks"></param>
        /// <param name="sourcetaskid"></param>
        public object CreatTasksAndCreatWorkrecor(work_task[] NextTasks, string sourcetaskid)
        {
            if (NextTasks == null)
            {
                return(null);
            }
            if (NextTasks.Length < 1)
            {
                return(null);
            }
            foreach (var Task in NextTasks)
            {
                //保存任务
                Task.LaskTaskId             = sourcetaskid;               //上一个任务id
                Task.InitiationTime         = DateTime.Now;               //状态
                Task.TaskStatus             = (int)WorkTaskStatus.Normal; //状态
                Task.ExpectedCompletionTime = DateTime.Now.AddDays(1);    //期望完成时间
                var loginClientInfo = SysContext.GetService <ClientInfo>();
                if (loginClientInfo != null)
                {
                    Task.CreateUserID = loginClientInfo.UserId ?? null;  //任务创建人
                }
                string id = SaveWorkTask(Task);
                Task.ID = id;
                //发送待办
                if (!string.IsNullOrEmpty(Task.AppLinks))
                {
                    Task.AppLinks += (Task.AppLinks.Contains("?") ? "&" : "?") + "taskid=" + Task.ID;
                }
                if (!string.IsNullOrEmpty(Task.PCLinks))
                {
                    Task.PCLinks += (Task.PCLinks.Contains("?") ? "&" : "?") + "taskid=" + Task.ID;
                }
                var dic = new Dictionary <string, string>();
                dic.Add("任务说明", Task.TaskContent);
                dic.Add("任务发起时间", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                dic.Add("期望完成时间", Task.ExpectedCompletionTime.Value.ToString("yyyy-MM-dd HH:mm:ss"));

                if (Task.TaskType.ToUpper() == TaskType.Punishment.ToString().ToUpper())
                {
                    string taskTypeStr = QueryDb.ExecuteScalar <string>("select title from res_dictionaryitems where itemcode=@0", Task.TaskType);  //获取任务类型中文描述
                    string caseNumber  = QueryDb.ExecuteScalar <string>("select caseNumber from case_info where id=@0", Task.CaseID);
                    Task.TaskTitle = caseNumber + "-" + taskTypeStr;
                }

                Task.TodotaskID = CreateWorkrecor(Task.AssignUsers, Task.TaskTitle, Task.AppLinks, dic);   //待办id

                //记录待办id
                ServiceHelper.GetService("work_task").Update(Task);  //修改关联的

                //修改关联事件状态已分配任务
                UpdateEventState(Task.EventInfoId, EventStatus.dispose);
            }
            return(true);
        }
Esempio n. 22
0
        public object Handle(APIContext context)
        {
            List <object> retList = new List <object>();

            retList.Add(new { TypeName = "钉钉", Count = QueryDb.ExecuteScalar <int>("SELECT count(*) FROM event_info where reportType='DD_REPORT' and OriginalID is not null") });
            retList.Add(new { TypeName = "微信", Count = QueryDb.ExecuteScalar <int>("SELECT count(*) FROM event_info where reportType='WX_REPORT' and OriginalID is not null") });
            retList.Add(new { TypeName = "AI告警", Count = QueryDb.ExecuteScalar <int>("SELECT count(*) FROM event_info where reportType='AI_REPORT' and OriginalID is not null") });
            retList.Add(new { TypeName = "APP", Count = QueryDb.ExecuteScalar <int>("SELECT count(*) FROM event_info where reportType='APP_REPORT' and OriginalID is not null") });
            retList.Add(new { TypeName = "其他", Count = QueryDb.ExecuteScalar <int>("SELECT count(*) FROM event_info where reportType='OTHER' and OriginalID is not null") });
            return(retList);
        }
Esempio n. 23
0
        public override object Create(object postdata)
        {
            var data    = postdata as FormSaveDto;
            var formDat = ConvertToFormData(data);

            QueryDb.BeginTransaction();
            QueryDb.Insert(data.FormBase);
            QueryDb.Insert(formDat);
            QueryDb.CompleteTransaction();
            return(base.Create(postdata));
        }
Esempio n. 24
0
        static void Main(string[] args)
        {
            ManageDb.Add200PersonsToDB();
            QueryDb.GetPersonsYoungest();
            QueryDb.GetPersonsOldest();
            QueryDb.GetPersonMagicAge();
            QueryDb.GetPersonsShortestName();
            QueryDb.GetPersonLongestName();

            Console.WriteLine("Procedūros atliktos");
            Console.ReadLine();
        }
Esempio n. 25
0
        private object FORMBYEVENT(APIContext context)
        {
            string id = JsonHelper.DeserializeJsonToObject <string>(context.Data);

            if (string.IsNullOrEmpty(id))
            {
                return(null);
            }
            var list = QueryDb.Query <formwith_eventcase>("SELECT * FROM formwith_eventcase where EventInfoId=@0 Order by CreatTime desc", id);

            //TODO

            return(list);
        }
Esempio n. 26
0
        private object GetAllFormByEventId(string eventinfoid)
        {
            if (string.IsNullOrEmpty(eventinfoid))
            {
                return(null);
            }
            ServiceConfig userServiceConfig = ServiceHelper.GetServiceConfig("user");
            var           formall           = QueryDb.Query <formwith_eventcase>("where EventInfoId=@0 order by CreateDate", eventinfoid);
            List <Dictionary <string, object> > formlist = new List <Dictionary <string, object> >();

            foreach (var f in formall)
            {
                try
                {
                    Dictionary <string, object> temp = new Dictionary <string, object>();
                    if (!string.IsNullOrEmpty(f.CreateUserID))
                    {
                        var user = SysContext.GetOtherDB(userServiceConfig.model.dbName).First <user>($"select * from user where Id='{f.CreateUserID}'");
                        temp.Add("CreateUser", user.Name);
                    }
                    else
                    {
                        temp.Add("CreateUser", "");
                    }
                    temp.Add("CreateDate", f.CreateDate);

                    if (f.FormType == "case_report")
                    {
                        temp.Add("state", f.FormState);
                        if (f.FormState == "审核通过")
                        {
                            closeDate = f.CreateDate.ToString();
                        }
                    }
                    else
                    {
                        temp.Add("state", "已完成");
                    }

                    temp.Add("FormType", f.FormName);
                    formlist.Add(temp);
                }
                catch (Exception e)
                {
                    continue;
                }
            }
            return(formlist);
        }
Esempio n. 27
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedRows.Count > 0)
     {
         int[] jobIds = new int[dataGridView1.SelectedRows.Count];
         int   i      = 0;
         foreach (DataGridViewRow row in dataGridView1.SelectedRows)
         {
             jobIds[i] = Convert.ToInt32(row.Cells["Id"].Value);
             i++;
         }
         QueryDb.DeleteRecentJobsByJobId(jobIds);
         updateDGVfromDb(profileId);
     }
 }
Esempio n. 28
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (profileDataGridView.SelectedRows.Count > 0)
     {
         int[] profileIds = new int[profileDataGridView.SelectedRows.Count];
         int   i          = 0;
         foreach (DataGridViewRow row in profileDataGridView.SelectedRows)
         {
             profileIds[i] = Convert.ToInt32(row.Cells["Id"].Value);
             i++;
         }
         QueryDb.DeleteProfileByIds(profileIds);
         updateDGVfromDb();
     }
 }
 /// <summary>
 /// 结束事件和任务
 /// </summary>
 /// <param name="TaskId"></param>
 /// <param name="EventId"></param>
 /// <returns></returns>
 public object EndEvent(string TaskId, string EventId)
 {
     try
     {
         QueryDb.BeginTransaction();
         _sHBaseService.UpdateWorkTaskState(TaskId, WorkTaskStatus.Close); //关闭任务
         _sHBaseService.UpdateEventState(EventId, EventStatus.finish);     //事件改为完成
     }
     catch (Exception)
     {
         QueryDb.AbortTransaction();
         throw new Exception();
     }
     QueryDb.CompleteTransaction();
     return(true);
 }
Esempio n. 30
0
 public AccountController(
     UserManager <ApplicationUser> userManager,
     SignInManager <ApplicationUser> signInManager,
     IEmailSender emailSender,
     ISmsSender smsSender,
     ILoggerFactory loggerFactory,
     QueryDb queryDb,
     IMapper mapper)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _emailSender   = emailSender;
     _smsSender     = smsSender;
     _logger        = loggerFactory.CreateLogger <AccountController>();
     this.queryDb   = queryDb;
     this.mapper    = mapper;
 }