示例#1
0
        /// <summary>
        /// 批量确认
        /// </summary>
        /// <param name="SuperviseIds">督办任务ID(多个用逗号分隔)</param>
        /// <param name="result">审核结果(0:同意,1:不同意)</param>
        /// <param name="signImg">签名照片路径</param>
        /// <returns></returns>
        public bool MutilConfirm(string SuperviseIds, string result, string signImg, string remark = "")
        {
            try
            {
                SuperviseconfirmationBLL superviseconfirmationbll = new SuperviseconfirmationBLL();
                DepartmentBLL            departmentBLL            = new DepartmentBLL();
                string sql   = string.Format("update BIS_SAFETYWORKSUPERVISE set FlowState='3',remark='{1}' where id in('{0}')", SuperviseIds.Trim(',').Replace(",", "','"), remark);
                int    count = new DepartmentBLL().ExecuteSql(sql);
                if (count > 0)
                {
                    string[] arr = SuperviseIds.Trim(',').Split(',');
                    foreach (string str in arr)
                    {
                        DataTable dt = departmentBLL.GetDataTable(string.Format(@"select t1.id
 from BIS_SafetyWorkSupervise t left join (select id, superviseid from BIS_SafetyWorkFeedback where flag = '0') t1
on t.id = t1.superviseid left join(select feedbackid from BIS_SuperviseConfirmation where flag = '0') t2 on t1.id = t2.feedbackid
where t.id = '{0}'", str));
                        if (dt.Rows.Count > 0)
                        {
                            SuperviseconfirmationEntity sf = new SuperviseconfirmationEntity
                            {
                                SuperviseResult  = result,
                                ConfirmationDate = DateTime.Now,
                                SignUrl          = signImg,
                                FeedbackId       = dt.Rows[0][0].ToString(),
                                SuperviseId      = str,
                                Flag             = "0"
                            };
                            superviseconfirmationbll.SaveForm(str, sf);
                        }
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }