Ejemplo n.º 1
0
        /// <summary>
        /// 单条记录授权或重新授权
        /// </summary>
        /// <param name="entity1"></param>
        /// <param name="keyValue"></param>
        /// <param name="Power">是否受过权 true 更改权限 false 添加权限</param>
        public List <AddJurisdictionEntity> SaveUserFace(TemporaryUserEntity entity1, string keyValue, bool Power)
        {
            List <AddJurisdictionEntity> taskIds = new List <AddJurisdictionEntity>();
            var res = DbFactory.Base().BeginTrans();

            try
            {
                DataItemDetailService data = new DataItemDetailService();
                var    pitem     = data.GetItemValue("Hikappkey");  //密钥
                var    baseurl   = data.GetItemValue("HikBaseUrl"); //海康地址
                string Key       = string.Empty;
                string Signature = string.Empty;
                if (!string.IsNullOrEmpty(pitem))
                {
                    Key       = pitem.Split('|')[0];
                    Signature = pitem.Split('|')[1];
                }
                Repository <TemporaryUserEntity> inlogdb = new Repository <TemporaryUserEntity>(DbFactory.Base());
                TemporaryUserEntity entity = inlogdb.FindEntity(keyValue);
                if (entity != null)
                {
                    List <TemporaryUserEntity> dellist = new List <TemporaryUserEntity>();
                    dellist.Add(entity);
                    entity.UserImg    = entity1.UserImg;
                    entity.ImgData    = entity1.ImgData;
                    entity.PassPost   = entity1.PassPost;
                    entity.PassPostId = entity1.PassPostId;
                    entity.startTime  = entity1.startTime;
                    entity.EndTime    = entity1.EndTime;
                    res.Update(entity);
                    res.Commit();
                    List <TemporaryUserEntity> list = new List <TemporaryUserEntity>();
                    list.Add(entity);
                    if (Power)
                    {     //更改权限
                        if (entity1.Remark == "1")
                        { //更换人脸(仅用于页面状态临时判断)
                            string msg = UpdateHumanFace(entity, baseurl, Key, Signature);
                        }
                        var delEntity = DelEquipmentRecord(dellist, baseurl, Key, Signature);
                        taskIds.Add(delEntity);//删除权限集
                    }
                    else
                    {//添加权限
                        SetLoadUserCarNo(entity, baseurl, Key, Signature);
                    }
                    var addEntity = UploadUserlimits(list, baseurl, Key, Signature);
                    taskIds.Add(addEntity);//添加权限集
                }
            }
            catch (Exception)
            {
                res.Rollback();
            }
            return(taskIds);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 保存表单(新增、修改)
        /// </summary>
        /// <param name="keyValue">主键值</param>
        /// <param name="entity">实体对象</param>
        /// <param name="moduleName">模块名称(值:设备工器具、特种设备工器具)</param>
        /// <returns></returns>
        public void SaveForm(string keyValue, ToolsAuditEntity entity, string moduleName)
        {
            var      res     = DbFactory.Base().BeginTrans();
            Operator curUser = ERCHTMS.Code.OperatorProvider.Provider.Current();

            try
            {
                string state = string.Empty;

                string outengineerid = keyValue;


                #region  保存工器具
                Repository <ToolsEntity> repAudit = new Repository <ToolsEntity>(DbFactory.Base());
                ToolsEntity smEntity = repAudit.FindEntity(entity.TOOLSID);

                #region //审核信息表
                ToolsAuditEntity aidEntity = new ToolsAuditEntity();
                aidEntity.AUDITID       = Guid.NewGuid().ToString();
                aidEntity.AUDITRESULT   = entity.AUDITRESULT;   //通过
                aidEntity.AUDITTIME     = DateTime.Now;         //审核时间
                aidEntity.AUDITPEOPLE   = entity.AUDITPEOPLE;   //审核人员姓名
                aidEntity.AUDITPEOPLEID = entity.AUDITPEOPLEID; //审核人员id
                aidEntity.TOOLSID       = smEntity.TOOLSID;     //关联的业务ID
                aidEntity.AUDITDEPTID   = entity.AUDITDEPTID;   //审核部门id
                aidEntity.AUDITDEPT     = entity.AUDITDEPT;     //审核部门
                aidEntity.AUDITOPINION  = entity.AUDITOPINION;  //审核意见
                aidEntity.AUDITFILE     = entity.AUDITFILE;     //审核附件
                aidEntity.REMARK        = entity.REMARK;        //备注
                aidEntity.FlowId        = entity.FlowId;
                SaveFormToolAudit("", aidEntity);
                #endregion
                Boolean IsNextFlow = true; //判断是否走下一步流程; 当安全专工跟电气专工验收工器具时没有验收完所有工器具时会继续到专工验收
                Boolean IsPass     = true; //判断是否所有工器具都没有验收通过  false 为所有工器具都没有验收通过
                #region   审核通过
                if (entity.AUDITRESULT == "0")
                {
                    ManyPowerCheckEntity powerentity = new ManyPowerCheckService().GetEntity(entity.FlowId);
                    if (powerentity.FLOWNAME.Contains("验收"))
                    {
                        List <ProjecttoolsEntity> toollist = projecttoolsservice.GetList(" and toolsid ='" + smEntity.TOOLSID + "'").ToList();
                        if (toollist.Where(t => t.Status == null).Count() > 0) //判断是否有没有验收的数据
                        {
                            IsNextFlow = false;
                        }
                        else
                        {
                            if (toollist.Where(t => t.Status == "1").Count() == toollist.Count()) //判断验收不通过的数量是否等于工器具数量
                            {
                                IsPass = false;
                            }
                        }
                    }
                    if (IsNextFlow && IsPass)
                    {
                        ManyPowerCheckEntity mpcEntity = peopleReview.CheckAuditPower(curUser, out state, moduleName, outengineerid, false, entity.FlowId);
                        //0表示流程未完成,1表示流程结束
                        if (null != mpcEntity)
                        {
                            smEntity.FLOWDEPT     = mpcEntity.CHECKDEPTID;
                            smEntity.FLOWDEPTNAME = mpcEntity.CHECKDEPTNAME;
                            smEntity.FLOWROLE     = mpcEntity.CHECKROLEID;
                            smEntity.FLOWROLENAME = mpcEntity.CHECKROLENAME;
                            smEntity.ISSAVED      = "1";
                            smEntity.ISOVER       = "0";
                            smEntity.FlowId       = mpcEntity.ID;
                            smEntity.FLOWNAME     = mpcEntity.CHECKDEPTNAME + "审核中";
                        }
                        else
                        {
                            smEntity.FLOWDEPT     = "";
                            smEntity.FLOWDEPTNAME = "";
                            smEntity.FLOWROLE     = "";
                            smEntity.FLOWROLENAME = "";
                            smEntity.ISSAVED      = "1";
                            smEntity.ISOVER       = "1";
                            smEntity.FLOWNAME     = "";
                            #region 更新工程流程状态
                            Repository <StartappprocessstatusEntity> proecss = new Repository <StartappprocessstatusEntity>(DbFactory.Base());
                            StartappprocessstatusEntity startProecss         = proecss.FindList(string.Format("select * from epg_startappprocessstatus t where t.outengineerid='{0}'", smEntity.OUTENGINEERID)).ToList().FirstOrDefault();
                            startProecss.EQUIPMENTTOOLSTATUS = "1";
                            res.Update <StartappprocessstatusEntity>(startProecss);
                            #endregion
                            #region  步设备
                            if (moduleName == "特种设备工器具")
                            {
                                new SpecialEquipmentService().SyncSpecificTools(smEntity.OUTENGINEERID, smEntity.OUTPROJECTID, smEntity.TOOLSID);
                            }
                            #endregion
                        }
                    }
                }
                #endregion
                #region  审核不通过
                if (entity.AUDITRESULT == "1" || IsPass == false)
                {
                    smEntity.FLOWDEPT     = "";
                    smEntity.FLOWDEPTNAME = "";
                    smEntity.FLOWROLE     = "";
                    smEntity.FLOWROLENAME = "";
                    smEntity.ISSAVED      = "0"; //处于登记阶段
                    smEntity.ISOVER       = "0"; //是否完成状态赋值为未完成
                    smEntity.FLOWNAME     = "";
                    #region 审核不通过保存工器具历史数据
                    var str = JsonConvert.SerializeObject(smEntity);
                    HistoryToolsEntity histools = JsonConvert.DeserializeObject <HistoryToolsEntity>(str);
                    histools.ID      = Guid.NewGuid().ToString();
                    histools.TOOLSID = smEntity.TOOLSID;
                    res.Insert <HistoryToolsEntity>(histools);
                    //施工机具
                    Repository <ProjecttoolsEntity> protools      = new Repository <ProjecttoolsEntity>(DbFactory.Base());
                    List <ProjecttoolsEntity>       protools_list = protools.FindList(string.Format(@"select * from epg_projecttools t where t.toolsid='{0}'", smEntity.TOOLSID)).ToList();
                    res.ExecuteBySql(string.Format("update epg_projecttools set Status='',CHECKOPTION=''  where toolsid='{0}'", smEntity.TOOLSID));
                    if (protools_list.Count > 0)
                    {
                        var str_protools = JsonConvert.SerializeObject(protools_list);
                        List <HistoryProtoolsEntity> hisprolist = JsonConvert.DeserializeObject <List <HistoryProtoolsEntity> >(str_protools);
                        for (int i = 0; i < hisprolist.Count; i++)
                        {
                            hisprolist[i].ID = Guid.NewGuid().ToString();
                            //同步附件
                            var file1 = fileService.GetFiles(protools_list[i].PROJECTTOOLSID);
                            if (file1.Rows.Count > 0)
                            {
                                var key = hisprolist[i].ID;
                                foreach (DataRow item in file1.Rows)
                                {
                                    FileInfoEntity itemFile = new FileInfoEntity();
                                    itemFile.FileName = item["FileName"].ToString();
                                    itemFile.FilePath = item["filepath"].ToString();
                                    itemFile.FileSize = item["filesize"].ToString();
                                    itemFile.RecId    = key;
                                    fileService.SaveForm(itemFile.FileId, itemFile);
                                }
                            }
                            hisprolist[i].TOOLSID = histools.ID;
                        }
                        res.Insert <HistoryProtoolsEntity>(hisprolist);
                    }
                    //特种设备
                    Repository <SpecificToolsEntity> spetools      = new Repository <SpecificToolsEntity>(DbFactory.Base());
                    List <SpecificToolsEntity>       spetools_list = spetools.FindList(string.Format(@"select * from epg_specifictools t where t.toolsid='{0}'", smEntity.TOOLSID)).ToList();
                    if (spetools_list.Count > 0)
                    {
                        var str_spetools = JsonConvert.SerializeObject(spetools_list);
                        List <HistorySpecificToolsEntity> hisspelist = JsonConvert.DeserializeObject <List <HistorySpecificToolsEntity> >(str_spetools);
                        for (int i = 0; i < hisspelist.Count; i++)
                        {
                            hisspelist[i].SPECIFICTOOLSID = Guid.NewGuid().ToString();
                            hisspelist[i].TOOLSID         = histools.ID;
                            //同步附件
                            var file1 = fileService.GetFiles(spetools_list[i].REGISTERCARDFILE);
                            var file2 = fileService.GetFiles(spetools_list[i].QUALIFIED);
                            var file3 = fileService.GetFiles(spetools_list[i].CHECKREPORTFILE);
                            var file4 = fileService.GetFiles(spetools_list[i].SPECIFICTOOLSFILE);
                            if (file1.Rows.Count > 0)
                            {
                                hisspelist[i].REGISTERCARDFILE = Guid.NewGuid().ToString();
                                var key = hisspelist[i].REGISTERCARDFILE;
                                foreach (DataRow item in file1.Rows)
                                {
                                    FileInfoEntity itemFile = new FileInfoEntity();
                                    itemFile.FileName = item["FileName"].ToString();
                                    itemFile.FilePath = item["filepath"].ToString();
                                    itemFile.FileSize = item["filesize"].ToString();
                                    itemFile.RecId    = key;
                                    fileService.SaveForm(itemFile.FileId, itemFile);
                                }
                            }
                            if (file2.Rows.Count > 0)
                            {
                                hisspelist[i].QUALIFIED = Guid.NewGuid().ToString();
                                var key = hisspelist[i].QUALIFIED;
                                foreach (DataRow item in file2.Rows)
                                {
                                    FileInfoEntity itemFile = new FileInfoEntity();
                                    itemFile.FileName = item["FileName"].ToString();
                                    itemFile.FilePath = item["filepath"].ToString();
                                    itemFile.FileSize = item["filesize"].ToString();
                                    itemFile.RecId    = key;
                                    fileService.SaveForm(itemFile.FileId, itemFile);
                                }
                            }
                            if (file3.Rows.Count > 0)
                            {
                                hisspelist[i].CHECKREPORTFILE = Guid.NewGuid().ToString();
                                var key = hisspelist[i].CHECKREPORTFILE;
                                foreach (DataRow item in file3.Rows)
                                {
                                    FileInfoEntity itemFile = new FileInfoEntity();
                                    itemFile.FileName = item["FileName"].ToString();
                                    itemFile.FilePath = item["filepath"].ToString();
                                    itemFile.FileSize = item["filesize"].ToString();
                                    itemFile.RecId    = key;
                                    fileService.SaveForm(itemFile.FileId, itemFile);
                                }
                            }
                            if (file4.Rows.Count > 0)
                            {
                                hisspelist[i].SPECIFICTOOLSFILE = Guid.NewGuid().ToString();
                                var key = hisspelist[i].SPECIFICTOOLSFILE;
                                foreach (DataRow item in file4.Rows)
                                {
                                    FileInfoEntity itemFile = new FileInfoEntity();
                                    itemFile.FileName = item["FileName"].ToString();
                                    itemFile.FilePath = item["filepath"].ToString();
                                    itemFile.FileSize = item["filesize"].ToString();
                                    itemFile.RecId    = key;
                                    fileService.SaveForm(itemFile.FileId, itemFile);
                                }
                            }
                        }
                        res.Insert <HistorySpecificToolsEntity>(hisspelist);
                    }
                    //获取当前业务对象的所有审核记录
                    var shlist = GetAuditList(entity.TOOLSID);
                    //批量更新审核记录关联ID
                    foreach (ToolsAuditEntity mode in shlist)
                    {
                        mode.TOOLSID = histools.ID; //对应新的ID
                        //同步附件
                        var file = fileService.GetFiles(mode.AUDITFILE);
                        if (file.Rows.Count > 0)
                        {
                            var key = histools.ID;
                            foreach (DataRow item in file.Rows)
                            {
                                FileInfoEntity itemFile = new FileInfoEntity();
                                itemFile.FileName = item["FileName"].ToString();
                                itemFile.FilePath = item["filepath"].ToString();
                                itemFile.FileSize = item["filesize"].ToString();
                                itemFile.RecId    = key;
                                fileService.SaveForm(itemFile.FileId, itemFile);
                            }
                        }
                        res.Update <ToolsAuditEntity>(mode);
                    }
                    #endregion
                }
                res.Update <ToolsEntity>(smEntity);
                res.Commit();
                #endregion
                #endregion
            }
            catch (Exception ex)
            {
                res.Rollback();
            }
        }
Ejemplo n.º 3
0
 public DistrictPersonService()
 {
     _context = (DbFactory.Base() as Database).dbcontext;
 }
Ejemplo n.º 4
0
        public List <DrillrecordAssessEntity> GetAssessList(string drillrecordid)
        {
            Repository <DrillrecordAssessEntity> AssessReg = new Repository <DrillrecordAssessEntity>(DbFactory.Base());

            return(AssessReg.IQueryable().Where(p => p.DrillRecordId == drillrecordid).ToList());
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 获取历史记录实体
        /// </summary>
        /// <param name="keyValue">主键值</param>
        /// <returns>返回对象Json</returns>
        public DrillplanrecordHistoryEntity GetHistoryEntity(string keyValue)
        {
            Repository <DrillplanrecordHistoryEntity> historyReg = new Repository <DrillplanrecordHistoryEntity>(DbFactory.Base());

            return(historyReg.FindEntity(keyValue));
        }
Ejemplo n.º 6
0
 /// <summary>
 /// 定义仓储
 /// </summary>
 /// <param name="connString">连接字符串</param>
 /// <returns></returns>
 public IRepository BaseRepository(string connString)
 {
     return(new Repository(DbFactory.Base(connString, DatabaseType.SqlServer)));
 }
Ejemplo n.º 7
0
        /// <summary>
        /// 保存表单(新增、修改)
        /// </summary>
        /// <param name="keyValue">主键值</param>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        public void SaveForm(string keyValue, string CheckItemName, List <CarcheckitemhazardousEntity> HazardousArray, List <CarcheckitemmodelEntity> ItemArray)
        {
            //开始事物
            var res = DbFactory.Base().BeginTrans();

            try
            {
                CarcheckitemEntity item;
                if (!string.IsNullOrEmpty(keyValue))
                {
                    Repository <CarcheckitemEntity> inlogdb = new Repository <CarcheckitemEntity>(DbFactory.Base());
                    item = inlogdb.FindEntity(keyValue);
                    item.Modify(keyValue);
                    item.CheckItemName = CheckItemName;
                    res.Update <CarcheckitemEntity>(item);
                    res.Delete <CarcheckitemhazardousEntity>(it => it.CID == keyValue);
                    res.Delete <CarcheckitemmodelEntity>(it => it.CID == keyValue);
                }
                else
                {
                    item = new CarcheckitemEntity();
                    item.Create();
                    item.CheckItemName  = CheckItemName;
                    item.CreateUserName = OperatorProvider.Provider.Current().UserName;
                    res.Insert <CarcheckitemEntity>(item);
                }

                for (int i = 0; i < HazardousArray.Count; i++)
                {
                    HazardousArray[i].Create();
                    HazardousArray[i].CID = item.ID;
                }

                for (int i = 0; i < ItemArray.Count; i++)
                {
                    ItemArray[i].Create();
                    ItemArray[i].CID = item.ID;
                }

                res.Insert <CarcheckitemmodelEntity>(ItemArray);
                res.Insert <CarcheckitemhazardousEntity>(HazardousArray);

                res.Commit();
            }
            catch (Exception ex)
            {
                res.Rollback();
                throw;
            }
        }
Ejemplo n.º 8
0
 /// <summary>
 /// 获取复审信息
 /// </summary>
 /// <param name="keyValue"></param>
 /// <returns></returns>
 public CertAuditEntity GetAuditEntity(string keyValue)
 {
     return(DbFactory.Base().FindEntity <CertAuditEntity>(keyValue));
 }
Ejemplo n.º 9
0
        /// <summary>
        /// 保存表单(新增、修改)
        /// </summary>
        /// <param name="keyValue">主键值</param>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        public void SaveForm(string keyValue, LaborrecyclingEntity entity, string json, string InfoId)
        {
            var res = DbFactory.Base().BeginTrans();

            try
            {
                LaborissueEntity issue = new LaborissueEntity();
                issue.Create();
                issue.LaborOperationTime     = DateTime.Now;
                issue.LaborOperationUserName = OperatorProvider.Provider.Current().UserName;
                issue.Type = 1;//表示发放记录
                //新增记录母表
                res.Insert <LaborissueEntity>(issue);

                Repository <DepartmentEntity> inlogdb = new Repository <DepartmentEntity>(DbFactory.Base());
                DepartmentEntity dept = inlogdb.FindEntity(entity.DeptId);

                Repository <DepartmentEntity> orgdb = new Repository <DepartmentEntity>(DbFactory.Base());
                DepartmentEntity org = orgdb.FindEntity(dept.OrganizeId);

                if (org.Nature.Contains("省级"))
                {
                    entity.OrgCode = org.DeptCode;
                }
                else
                {
                    entity.OrgCode = org.EnCode;
                }

                entity.OrgId      = org.OrganizeId;
                entity.OrgName    = org.FullName;
                entity.InfoId     = InfoId;
                entity.SueId      = issue.ID;
                entity.RecentTime = DateTime.Now;


                if (!string.IsNullOrEmpty(keyValue))
                {
                    entity.Modify(keyValue);
                    res.Update <LaborrecyclingEntity>(entity);
                }
                else
                {
                    entity.Create();
                    res.Insert <LaborrecyclingEntity>(entity);
                }
                json = json.Replace("&nbsp;", "");
                List <LaborequipmentinfoEntity> list = Newtonsoft.Json.JsonConvert.DeserializeObject <List <LaborequipmentinfoEntity> >(json);
                for (int i = 0; i < list.Count; i++)
                {
                    list[i].ID = "";
                    list[i].Create();
                    list[i].AssId     = entity.ID;
                    list[i].LaborType = 2;
                }

                res.Insert <LaborequipmentinfoEntity>(list);
                res.Commit();
            }
            catch (Exception e)
            {
                res.Rollback();
                throw e;
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 获取所有临时人员列表
        /// </summary>
        /// <param name="keyValue"></param>
        /// <returns></returns>
        public List <TemporaryUserEntity> GetUserList()
        {
            string sql = "select userid,ModifyUserId,CreateUserId,ModifyDate,CreateDate,CreateUserOrgCode,CreateUserDeptCode,GroupsName,Groupsid,UserName,Gender,Identifyid,ComName,Tel,startTime,EndTime,PassPost,ISDebar,UserImg,Remark,Istemporary,Postname from BIS_TEMPORARYUSER where ISDebar!=1 ";
            Repository <TemporaryUserEntity> inlogdb = new Repository <TemporaryUserEntity>(DbFactory.Base());
            List <TemporaryUserEntity>       old     = inlogdb.FindList(sql).ToList();

            return(old);
        }
Ejemplo n.º 11
0
 /// <summary>
 /// 定义仓储
 /// </summary>
 /// <param name="connString">连接字符串</param>
 /// <returns></returns>
 public IRepository <T> BaseRepository(string connString, DatabaseType type)
 {
     return(new Repository <T>(DbFactory.Base(connString, type)));
 }
Ejemplo n.º 12
0
        /// <summary>
        /// 移除禁入名单
        /// </summary>
        /// <param name="list"></param>
        public List <AddJurisdictionEntity> RemoveForbidden(string list)
        {
            //开始事物
            var res = DbFactory.Base().BeginTrans();
            List <AddJurisdictionEntity> taskIds = new List <AddJurisdictionEntity>();

            try
            {
                Repository <TemporaryUserEntity>   inlogdb = new Repository <TemporaryUserEntity>(DbFactory.Base());
                Repository <ForbiddenRecordEntity> Frecord = new Repository <ForbiddenRecordEntity>(DbFactory.Base());
                DataItemDetailService data = new DataItemDetailService();
                var    pitem     = data.GetItemValue("Hikappkey");  //密钥
                var    baseurl   = data.GetItemValue("HikBaseUrl"); //海康地址
                string Key       = string.Empty;
                string Signature = string.Empty;
                if (!string.IsNullOrEmpty(pitem))
                {
                    Key       = pitem.Split('|')[0];
                    Signature = pitem.Split('|')[1];
                }
                List <TemporaryUserEntity>   list1 = new List <TemporaryUserEntity>();
                List <ForbiddenRecordEntity> list2 = new List <ForbiddenRecordEntity>();
                foreach (var UserId in list.Split(','))
                {
                    if (string.IsNullOrEmpty(UserId))
                    {
                        continue;
                    }
                    TemporaryUserEntity old = inlogdb.FindEntity(UserId);
                    if (old != null)
                    {
                        old.ISDebar = 0;
                        list1.Add(old);
                        //移除禁入记录
                        List <ForbiddenRecordEntity> Rlist = Frecord.IQueryable(it => it.UserId == UserId).OrderByDescending(t => t.CreateDate).ToList();
                        if (Rlist != null)
                        {
                            Rlist[0].EndTime = DateTime.Now;
                            list2.Add(Rlist[0]);
                        }
                    }
                }
                var Invalidentity = UploadUserlimits(list1, baseurl, Key, Signature);
                taskIds.Add(Invalidentity);
                res.Update <TemporaryUserEntity>(list1);
                res.Update <ForbiddenRecordEntity>(list2);
                res.Commit();
            }
            catch (Exception er)
            {
                res.Rollback();
            }
            return(taskIds);
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 加入禁入名单
        /// </summary>
        /// <param name="list"></param>
        public List <AddJurisdictionEntity> SaveForbidden(List <TemporaryUserEntity> list)
        {
            //开始事物
            var res = DbFactory.Base().BeginTrans();
            List <AddJurisdictionEntity> taskIds = new List <AddJurisdictionEntity>();

            try
            {
                Repository <TemporaryUserEntity>   inlogdb = new Repository <TemporaryUserEntity>(DbFactory.Base());
                Repository <ForbiddenRecordEntity> Frecord = new Repository <ForbiddenRecordEntity>(DbFactory.Base());
                DataItemDetailService data = new DataItemDetailService();
                var    pitem     = data.GetItemValue("Hikappkey");  //密钥
                var    baseurl   = data.GetItemValue("HikBaseUrl"); //海康地址
                string Key       = string.Empty;
                string Signature = string.Empty;
                if (!string.IsNullOrEmpty(pitem))
                {
                    Key       = pitem.Split('|')[0];
                    Signature = pitem.Split('|')[1];
                }
                List <TemporaryUserEntity>   list1 = new List <TemporaryUserEntity>();
                List <ForbiddenRecordEntity> list2 = new List <ForbiddenRecordEntity>();
                foreach (var entity in list)
                {
                    TemporaryUserEntity old = inlogdb.FindEntity(entity.USERID);
                    if (old != null)
                    {
                        old.ISDebar = 1;
                        old.Remark  = entity.Remark;
                        list1.Add(old);
                        //禁入记录
                        ForbiddenRecordEntity RecordEntity = new ForbiddenRecordEntity();
                        RecordEntity.Create();
                        RecordEntity.StartTime = DateTime.Now;
                        RecordEntity.Remark    = entity.Remark;
                        RecordEntity.UserId    = old.USERID;
                        list2.Add(RecordEntity);
                    }
                }
                res.Update <TemporaryUserEntity>(list1);
                res.Insert <ForbiddenRecordEntity>(list2);
                res.Commit();
                if (list1.Count > 0)
                {
                    list1.ForEach(a => a.EndTime = DateTime.Now.AddDays(-1));
                }
                ;
                var Invalidentity = UploadUserlimits(list1, baseurl, Key, Signature);
                taskIds.Add(Invalidentity);
            }
            catch (Exception er)
            {
                res.Rollback();
            }
            return(taskIds);
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 批量权限设置
        /// </summary>
        /// <param name="list"></param>
        public List <AddJurisdictionEntity> SaveCycle(List <TemporaryUserEntity> list)
        {
            //开始事物
            var res = DbFactory.Base().BeginTrans();
            List <AddJurisdictionEntity> taskIds = new List <AddJurisdictionEntity>();

            try
            {
                List <TemporaryUserEntity>       list1      = new List <TemporaryUserEntity>();
                List <TemporaryUserEntity>       addlist    = new List <TemporaryUserEntity>();
                List <TemporaryUserEntity>       updatelist = new List <TemporaryUserEntity>();
                Repository <TemporaryUserEntity> inlogdb    = new Repository <TemporaryUserEntity>(DbFactory.Base());
                DataItemDetailService            data       = new DataItemDetailService();
                var    pitem     = data.GetItemValue("Hikappkey");  //密钥
                var    baseurl   = data.GetItemValue("HikBaseUrl"); //海康地址
                string Key       = string.Empty;
                string Signature = string.Empty;
                if (!string.IsNullOrEmpty(pitem))
                {
                    Key       = pitem.Split('|')[0];
                    Signature = pitem.Split('|')[1];
                }
                foreach (var entity in list)
                {
                    TemporaryUserEntity old = inlogdb.FindEntity(entity.USERID);
                    if (old != null)
                    {
                        old.EndTime   = entity.EndTime;
                        old.startTime = entity.startTime;
                        if (old.Istemporary == 0 && string.IsNullOrEmpty(old.PassPost))
                        {//添加权限
                            old.PassPost = entity.PassPost;
                            addlist.Add(old);
                        }
                        else
                        {//更改权限
                            updatelist.Add(old);
                            old.PassPost = entity.PassPost;
                        }
                        list1.Add(old);
                    }
                }
                SetLoadUserCarNo1(addlist, baseurl, Key, Signature);
                var delEntity = DelEquipmentRecord(updatelist, baseurl, Key, Signature);
                var addEntity = UploadUserlimits(list1, baseurl, Key, Signature);
                taskIds.Add(delEntity); //删除权限集
                taskIds.Add(addEntity); //添加权限集

                res.Update <TemporaryUserEntity>(list1);
                res.Commit();
            }
            catch (Exception er)
            {
                res.Rollback();
            }
            return(taskIds);
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 保存表单(新增、修改)
        /// </summary>
        /// <param name="keyValue">主键值</param>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        public void SaveForm(string keyValue, DrillrecordevaluateEntity entity)
        {
            Operator currUser = OperatorProvider.Provider.Current();
            //开始事务
            var res = DbFactory.Base().BeginTrans();

            try
            {
                Repository <DrillplanrecordEntity> planRecord = new Repository <DrillplanrecordEntity>(DbFactory.Base());
                DrillplanrecordEntity Record = planRecord.FindEntity(entity.DrillRecordId);
                string moduleName            = "厂级演练记录评价";
                if (!string.IsNullOrWhiteSpace(Record.DrillLevel))
                {
                    switch (Record.DrillLevel)
                    {
                    case "厂级":
                        moduleName = "厂级演练记录评价";
                        break;

                    case "部门级":
                        moduleName = "部门级演练记录评价";
                        break;

                    case "班组级":
                        moduleName = "班组级演练记录评价";
                        break;

                    default:
                        break;
                    }
                }
                ManyPowerCheckEntity nextCheck = peopleReview.CheckEvaluateForNextFlow(currUser, moduleName, Record);
                if (nextCheck == null)
                {
                    //评价结束
                    Record.IsOverEvaluate   = 1;
                    Record.EvaluateRole     = "";
                    Record.EvaluateDeptId   = "";
                    Record.EvaluateDeptCode = "";
                    Record.EvaluateRoleId   = "";
                }
                else
                {
                    Record.EvaluateRole     = nextCheck.CHECKROLENAME;
                    Record.EvaluateDeptId   = nextCheck.CHECKDEPTID;
                    Record.EvaluateDeptCode = nextCheck.CHECKDEPTCODE;
                    Record.NodeId           = nextCheck.ID;
                    Record.NodeName         = nextCheck.FLOWNAME;
                    Record.EvaluateRoleId   = nextCheck.CHECKROLEID;
                    Record.IsOverEvaluate   = 0;
                }
                res.Update <DrillplanrecordEntity>(Record);
                entity.Create();
                entity.SingImg = string.IsNullOrWhiteSpace(entity.SingImg) ? "" : entity.SingImg.ToString().Replace("../..", "");
                res.Insert <DrillrecordevaluateEntity>(entity);
                res.Commit();
            }
            catch (Exception ex)
            {
                res.Rollback();
                throw ex;
            }
        }
Ejemplo n.º 16
0
        /// <summary>
        /// 保存表单(新增、修改)
        /// </summary>
        /// <param name="keyValue">主键值</param>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        public void SaveListForm(string json)
        {
            var res = DbFactory.Base().BeginTrans();

            try
            {
                json = json.Replace("&nbsp;", "");
                List <Laborff> list = Newtonsoft.Json.JsonConvert.DeserializeObject <List <Laborff> >(json);

                string ids = "";
                foreach (Laborff item in list)
                {
                    if (ids == "")
                    {
                        ids = "'" + item.ID + "'";
                    }
                    else
                    {
                        ids += ",'" + item.ID + "'";
                    }
                }

                LaborissueEntity issue = new LaborissueEntity();
                issue.Create();
                issue.LaborOperationTime     = DateTime.Now;
                issue.LaborOperationUserName = OperatorProvider.Provider.Current().UserName;
                issue.Type = 1;//表示回收记录
                //新增记录母表
                res.Insert <LaborissueEntity>(issue);

                Repository <LaborinfoEntity> labordb = new Repository <LaborinfoEntity>(DbFactory.Base());
                string sql = string.Format(@"select * from bis_laborinfo where id in({0})", ids);
                List <LaborinfoEntity>      laborlist  = labordb.FindList(sql).ToList();
                List <LaborrecyclingEntity> detaillist = new List <LaborrecyclingEntity>();
                for (int i = 0; i < laborlist.Count; i++)
                {
                    Laborff ff = list.Where(it => it.ID == laborlist[i].ID).FirstOrDefault();
                    LaborrecyclingEntity le = new LaborrecyclingEntity();
                    le.PostId                 = laborlist[i].PostId;
                    le.DeptCode               = laborlist[i].DeptCode;
                    le.DeptId                 = laborlist[i].DeptId;
                    le.DeptName               = laborlist[i].DeptName;
                    le.InfoId                 = laborlist[i].ID;
                    le.IssueNum               = ff.Count;
                    le.LaborOperationTime     = DateTime.Now;
                    le.LaborOperationUserName = OperatorProvider.Provider.Current().UserName;
                    le.Name       = laborlist[i].Name;
                    le.RecentTime = DateTime.Now;
                    le.Model      = laborlist[i].Model;
                    le.Note       = laborlist[i].Note;
                    le.No         = laborlist[i].No;
                    le.OrgCode    = laborlist[i].OrgCode;
                    le.OrgId      = laborlist[i].OrgId;
                    le.OrgName    = laborlist[i].OrgName;
                    le.PostName   = laborlist[i].PostName;
                    le.SueId      = issue.ID;
                    le.Type       = laborlist[i].Type;
                    le.Unit       = laborlist[i].Unit;
                    le.Create();
                    detaillist.Add(le);



                    //先获取当前用品标准下所有需发放人员
                    Repository <LaborequipmentinfoEntity> equdb = new Repository <LaborequipmentinfoEntity>(DbFactory.Base());
                    string equsql = string.Format("select * from bis_laborequipmentinfo where assid='{0}'",
                                                  laborlist[i].ID);
                    List <LaborequipmentinfoEntity> equlist  = equdb.FindList(equsql).ToList();
                    List <LaborequipmentinfoEntity> laborque = new List <LaborequipmentinfoEntity>();
                    foreach (LaborequipmentinfoEntity equ in equlist)
                    {
                        LaborequipmentinfoEntity eq = new LaborequipmentinfoEntity();
                        eq.UserName  = equ.UserName;
                        eq.AssId     = le.ID;
                        eq.Brand     = "";
                        eq.LaborType = 2;
                        eq.Reson     = "";
                        eq.ShouldNum = ff.PerCount;
                        eq.Size      = "";
                        eq.UserId    = equ.UserId;
                        eq.Create();
                        laborque.Add(eq);
                    }



                    res.Insert <LaborequipmentinfoEntity>(laborque);
                }


                res.Insert <LaborrecyclingEntity>(detaillist);
                res.Update <LaborinfoEntity>(laborlist);

                res.Commit();
            }
            catch (Exception e)
            {
                res.Rollback();
                throw e;
            }
        }
Ejemplo n.º 17
0
 public CheckCategoryService()
 {
     _context = (DbFactory.Base() as Database).dbcontext;
 }
Ejemplo n.º 18
0
 public void SaveWorkMeetingForm(string keyValue, WorkMeetingEntity entity, List <WorkmeetingmeasuresEntity> list, string ids)
 {
     entity.ID = keyValue;
     if (entity.MEETINGTYPE == "收工会")
     {
         var e = this.BaseRepository().FindEntity(entity.StartMeetingid);
         e.IsOver = 1;//开收工会闭环
         this.BaseRepository().Update(e);
         for (int i = 0; i < list.Count; i++)
         {
             list[i].Workmeetingid = keyValue;
         }
     }
     if (!string.IsNullOrEmpty(keyValue))
     {
         var res = new Repository <WorkmeetingmeasuresEntity>(DbFactory.Base());
         WorkMeetingEntity re = this.BaseRepository().FindEntity(keyValue);
         if (re == null)
         {
             entity.Create();
             if (this.BaseRepository().Insert(entity) > 0)
             {
                 for (int i = 0; i < list.Count; i++)
                 {
                     list[i].Create();
                     list[i].CreateDate = list[i].CreateDate.Value.AddSeconds(i);
                 }
                 res.Insert(list);
             }
         }
         else
         {
             entity.Modify(keyValue);
             entity.ids = null;
             if (this.BaseRepository().Update(entity) > 0)
             {
                 int count = res.ExecuteBySql(string.Format("delete from epg_workmeetingmeasures where workmeetingid='{0}'", entity.ID));
                 for (int i = 0; i < list.Count; i++)
                 {
                     list[i].Create();
                     list[i].CreateDate = list[i].CreateDate.Value.AddSeconds(i);
                 }
                 res.Insert(list);
             }
         }
     }
     else
     {
         //手机端传空Id,需要处理关联Id
         entity.Create();
         var res = new Repository <WorkmeetingmeasuresEntity>(DbFactory.Base());
         if (this.BaseRepository().Insert(entity) > 0)
         {
             for (int i = 0; i < list.Count; i++)
             {
                 if (!string.IsNullOrWhiteSpace(list[i].ID))
                 {
                     list[i].ID = "";
                 }
                 list[i].Workmeetingid = entity.ID;
                 list[i].Create();
                 list[i].CreateDate = list[i].CreateDate.Value.AddSeconds(i);
             }
             res.Insert(list);
         }
     }
     if (!string.IsNullOrWhiteSpace(ids))
     {
         var listids = ids.Split(',');
         for (int i = 0; i < listids.Length; i++)
         {
             var e = new DangerdataService().GetEntity(listids[i]);
             if (e != null)
             {
                 e.UserNum += 1;
                 new DangerdataService().SaveForm(e.ID, e);
             }
         }
     }
 }
Ejemplo n.º 19
0
 /// <summary>
 /// 定义仓储(基础库)
 /// </summary>
 /// <returns></returns>
 public IRepository BaseRepository()
 {
     return(new Repository(DbFactory.Base()));
 }
Ejemplo n.º 20
0
 public CheckTemplateService()
 {
     _context = (DbFactory.Base() as Database).dbcontext;
 }
Ejemplo n.º 21
0
        public DataTable GetAssessRecordList(Pagination pagination, string queryJson)
        {
            DatabaseType dataType = DbHelper.DbType;

            if (queryJson.Length > 0)
            {
                var queryParam = queryJson.ToJObject();
                if (!queryParam["drillrecordid"].IsEmpty())
                {
                    string drillrecordid = queryParam["drillrecordid"].ToString();
                    pagination.conditionJson += string.Format(" and drillrecordid = '{0}'", drillrecordid);
                }
            }

            Repository <DrillrecordAssessEntity> AssessReg = new Repository <DrillrecordAssessEntity>(DbFactory.Base());

            return(AssessReg.FindTableByProcPager(pagination, dataType));
        }
Ejemplo n.º 22
0
        /// <summary>
        /// 保存表单(新增、修改)
        /// </summary>
        /// <param name="keyValue">主键值</param>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        public void SaveForm(string keyValue, ConferenceEntity entity)
        {
            bool b = true;

            entity.Id = keyValue;
            Repository <ConferenceUserEntity> rep = new Repository <ConferenceUserEntity>(DbFactory.Base());

            if (!string.IsNullOrEmpty(keyValue))
            {
                ConferenceEntity se = this.BaseRepository().FindEntity(keyValue);
                if (se != null)
                {
                    b = false;
                }
            }
            if (b)
            {
                entity.Create();
                this.BaseRepository().Insert(entity);
            }
            else
            {
                entity.Modify(keyValue);
                this.BaseRepository().Update(entity);
                rep.ExecuteBySql(string.Format("delete BIS_ConferenceUser where ConferenceID='{0}' ", keyValue));
            }
            //增加子表记录
            var arrId   = entity.UserId.Split(',');
            var arrName = entity.UserName.Split(',');
            List <ConferenceUserEntity> list = new List <ConferenceUserEntity>();

            for (int i = 0; i < arrId.Length; i++)
            {
                ConferenceUserEntity newEntity = new ConferenceUserEntity();
                newEntity.Create();
                newEntity.UserID       = arrId[i];
                newEntity.UserName     = arrName[i];
                newEntity.ConferenceID = entity.Id;
                newEntity.Issign       = "1";
                newEntity.ReviewState  = "0";
                list.Add(newEntity);
            }
            rep.Insert(list);
        }
Ejemplo n.º 23
0
        /// <summary>
        /// 获取历史记录
        /// </summary>
        /// <param name="pagination"></param>
        /// <param name="queryJson"></param>
        /// <returns></returns>
        public DataTable GetHistoryPageListJson(Pagination pagination, string queryJson)
        {
            DatabaseType dataType = DbHelper.DbType;
            Repository <DrillplanrecordHistoryEntity> historyReg = new Repository <DrillplanrecordHistoryEntity>(DbFactory.Base());

            return(historyReg.FindTableByProcPager(pagination, dataType));
        }
Ejemplo n.º 24
0
        /// <summary>
        /// 删除数据
        /// </summary>
        /// <param name="keyValue">主键</param>
        public void RemoveForm(string keyValue)
        {
            Repository <ConferenceUserEntity> rep = new Repository <ConferenceUserEntity>(DbFactory.Base());

            this.BaseRepository().Delete(keyValue);
            //删除子表记录
            rep.ExecuteBySql(string.Format("delete BIS_ConferenceUser where ConferenceID='{0}' ", keyValue));
        }
Ejemplo n.º 25
0
        /// <summary>
        /// 保存历史记录
        /// </summary>
        /// <param name="keyValue"></param>
        /// <param name="entity"></param>
        public void SaveHistoryForm(string keyValue, DrillplanrecordHistoryEntity entity)
        {
            var res = DbFactory.Base().BeginTrans();

            try
            {
                res.Insert <DrillplanrecordHistoryEntity>(entity);
                Repository <DrillrecordAssessEntity> audit = new Repository <DrillrecordAssessEntity>(DbFactory.Base());
                List <DrillrecordAssessEntity>       list  = audit.FindList(string.Format(@"select * from  MAE_DRILLRECORDASSESS t where t.DrillRecordId='{0}'", entity.HistoryId)).ToList();
                for (int i = 0; i < list.Count; i++)
                {
                    list[i].DrillRecordId = entity.ID;
                }
                res.Update <DrillrecordAssessEntity>(list);
                res.Commit();
            }
            catch (Exception)
            {
                res.Rollback();
            }
        }
        /// <summary>
        /// 保存表单(新增、修改)
        /// </summary>
        /// <param name="keyValue">主键值</param>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        public void SaveForm(string keyValue, SuperviseconfirmationEntity entity)
        {
            bool b = false;

            if (!string.IsNullOrWhiteSpace(keyValue))
            {
                var sl = BaseRepository().FindEntity(keyValue);
                if (sl != null)
                {
                    entity.Modify(keyValue);
                    this.BaseRepository().Update(entity);
                }
                else
                {
                    b = true;
                }
            }
            else
            {
                b = true;
            }
            if (b)
            {
                bool flag = false;
                entity.Id = keyValue;
                entity.Create();
                if (entity.SuperviseResult == "0")
                {
                    flag = false;
                }
                else if (entity.SuperviseResult == "1")
                {
                    flag        = true;
                    entity.Flag = "1";
                }
                this.BaseRepository().Insert(entity);
                Repository <SafetyworksuperviseEntity> announRes = new Repository <SafetyworksuperviseEntity>(DbFactory.Base());
                var sl = announRes.FindEntity(entity.SuperviseId);
                if (sl != null)
                {   //更新主表流程状态
                    if (flag)
                    {
                        sl.FlowState = "1";
                    }
                    else
                    {
                        sl.FlowState = "3";
                    }
                    announRes.Update(sl);
                }
                Repository <SafetyworkfeedbackEntity> feedback = new Repository <SafetyworkfeedbackEntity>(DbFactory.Base());
                var s2 = feedback.FindEntity(entity.FeedbackId);
                if (s2 != null)
                {   //更新反馈表数据状态(当前和历史数据)
                    if (flag)
                    {
                        s2.Flag = "1";
                    }
                    feedback.Update(s2);
                }
            }
        }
Ejemplo n.º 27
0
        /// <summary>
        /// 保存表单(新增、修改)
        /// </summary>
        /// <param name="keyValue">主键值</param>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        public void SaveForm(string keyValue, string state, string auditid, SafetyEamestMoneyEntity entity, List <SafetyMoneyExamineEntity> list)
        {
            var res = DbFactory.Base().BeginTrans();

            try
            {
                Operator currUser = OperatorProvider.Provider.Current();
                entity.ID     = keyValue;
                entity.ISSEND = state;
                if (!string.IsNullOrEmpty(keyValue))
                {
                    SafetyEamestMoneyEntity se = this.BaseRepository().FindEntity(keyValue);
                    if (se == null)
                    {
                        entity.Create();
                        res.Insert <SafetyEamestMoneyEntity>(entity);
                    }
                    else
                    {
                        entity.Modify(keyValue);
                        res.Update <SafetyEamestMoneyEntity>(entity);
                    }
                }
                else
                {
                    entity.Create();
                    res.Insert <SafetyEamestMoneyEntity>(entity);
                }
                //1发送审核,0保存
                if (state == "1")
                {
                    Repository <OutsouringengineerEntity> repEng = new Repository <OutsouringengineerEntity>(DbFactory.Base());
                    OutsouringengineerEntity outeng = repEng.FindEntity(entity.PROJECTID);
                    var sendDeptid = outeng.ENGINEERLETDEPTID;

                    if (currUser.RoleName.Contains("公司级用户") || currUser.RoleName.Contains("厂级部门用户") ||
                        (sendDeptid == currUser.DeptId && currUser.RoleName.Contains("负责人")) ||
                        (sendDeptid == currUser.DeptId && currUser.RoleName.Contains("安全管理员")) || (sendDeptid == currUser.DeptId && currUser.RoleName.Contains("专工")))
                    {
                        AptitudeinvestigateauditEntity e = new AptitudeinvestigateauditEntity();
                        if (!string.IsNullOrEmpty(auditid))
                        {
                            e               = Aptitudeinvestigateaudit.GetEntity(auditid);
                            e.AUDITDEPT     = currUser.DeptId;
                            e.AUDITDEPT     = currUser.DeptName;
                            e.AUDITPEOPLE   = currUser.UserName;
                            e.AUDITPEOPLEID = currUser.UserId;
                            e.AUDITRESULT   = "0";
                        }
                        else
                        {
                            e.AUDITRESULT   = "0";
                            e.AUDITDEPT     = currUser.DeptId;
                            e.AUDITDEPT     = currUser.DeptName;
                            e.AUDITPEOPLE   = currUser.UserName;
                            e.AUDITPEOPLEID = currUser.UserId;
                            e.APTITUDEID    = entity.ID;
                            //Aptitudeinvestigateaudit.SaveForm(auditid, e);
                        }
                        Aptitudeinvestigateaudit.SaveForm(auditid, e);
                        Repository <StartappprocessstatusEntity> proecss = new Repository <StartappprocessstatusEntity>(DbFactory.Base());
                        StartappprocessstatusEntity startProecss         = proecss.FindList(string.Format("select * from epg_startappprocessstatus t where t.outengineerid='{0}'", entity.PROJECTID)).ToList().FirstOrDefault();
                        startProecss.SECURITYSTATUS = "1";

                        startprocess.SaveForm(startProecss.ID, startProecss);
                    }
                    else
                    {
                        AptitudeinvestigateauditEntity e = new AptitudeinvestigateauditEntity();
                        if (!string.IsNullOrEmpty(auditid))
                        {
                            e               = Aptitudeinvestigateaudit.GetEntity(auditid);
                            e.AUDITDEPT     = currUser.DeptId;
                            e.AUDITDEPT     = currUser.DeptName;
                            e.AUDITPEOPLE   = currUser.UserName;
                            e.AUDITPEOPLEID = currUser.UserId;
                            e.AUDITRESULT   = "2";
                            Aptitudeinvestigateaudit.SaveForm(auditid, e);
                        }
                        else
                        {
                            e.AUDITRESULT   = "2";
                            e.AUDITDEPT     = currUser.DeptId;
                            e.AUDITDEPT     = currUser.DeptName;
                            e.AUDITPEOPLE   = currUser.UserName;
                            e.AUDITPEOPLEID = currUser.UserId;
                            e.APTITUDEID    = entity.ID;
                            Aptitudeinvestigateaudit.SaveForm(auditid, e);
                        }
                    }
                }
                //string sql = string.Format("delete epg_safetymoneyexamine t where t.safetymoneyid='{0}'", keyValue);
                //res.ExecuteBySql(sql);
                if (list.Count > 0)
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        list[i].Create();
                        list[i].ExamineDept     = currUser.DeptName;
                        list[i].ExamineDeptId   = currUser.DeptId;
                        list[i].ExamineToDept   = entity.DEPTNAME;
                        list[i].ExamineToDeptId = entity.DEPTID;
                    }
                    res.Insert <SafetyMoneyExamineEntity>(list);
                }
                res.Commit();
            }
            catch (System.Exception)
            {
                res.Rollback();
            }
        }
Ejemplo n.º 28
0
        /// <summary>
        /// 保存评估记录
        /// </summary>
        /// <param name="keyValue"></param>
        /// <param name="entity"></param>
        public void AssessRecordSaveForm(string keyValue, DrillrecordAssessEntity entity)
        {
            var res = DbFactory.Base().BeginTrans();

            try
            {
                Repository <DrillrecordAssessEntity> planRecord = new Repository <DrillrecordAssessEntity>(DbFactory.Base());
                entity.Create();
                entity.AssessRecordSignImg = string.IsNullOrWhiteSpace(entity.AssessRecordSignImg) ? "" : entity.AssessRecordSignImg.ToString().Replace("../..", "");
                res.Insert <DrillrecordAssessEntity>(entity);
                res.Commit();
            }
            catch (Exception)
            {
                res.Rollback();
            }
        }
Ejemplo n.º 29
0
 /// <summary>
 /// ctor
 /// </summary>
 public DangerAnalysisService()
 {
     _context = (DbFactory.Base() as Database).dbcontext;
 }
Ejemplo n.º 30
0
        /// <summary>
        /// 获取临时人员实体
        /// </summary>
        /// <param name="keyValue"></param>
        /// <returns></returns>
        public TemporaryUserEntity GetEmptyUserEntity(string keyValue)
        {
            Repository <TemporaryUserEntity> inlogdb = new Repository <TemporaryUserEntity>(DbFactory.Base());
            TemporaryUserEntity old = inlogdb.FindEntity(keyValue);

            return(old);
        }