/// <summary> /// 删除数据 /// </summary> /// <param name="keyValue">主键</param> public void RemoveForm(string keyValue) { try { var data = dataItemservice.GetDataItemListByItemCode("'SocketUrl'"); string IP = ""; int Port = 0; foreach (var item in data) { if (item.ItemName == "IP") { IP = item.ItemValue; } else if (item.ItemName == "Port") { Port = Convert.ToInt32(item.ItemValue); } } service.RemoveForm(keyValue, IP, Port); } catch (Exception) { throw; } }
/// <summary> /// 流程配置条件提供程序 /// </summary> /// <param name="orgid"></param> /// <param name="deptmentid"></param> /// <param name="roleid"></param> ///<param name="roleid"></param> /// <param name="useraccounts"></param> /// <returns></returns> public IList <UserInfoEntity> GetUserListByAnyCondition(string orgid, string deptmentcode, string rolecode, string majorclassify = "") { string sql = string.Format(@"select distinct a.* from v_userinfo a left join base_department b on a.departmentcode = b.encode left join base_userrelation c on a.userid = c.userid left join base_role d on c.objectid = d.roleid where 1=1 and a.organizeid ='{0}' and a.userid <> 'System' and a.enabledmark = 1 and a.deletemark=0 and a.ispresence ='是' ", orgid); //角色 判定依据是 传入的用户为空 if (!rolecode.IsEmpty()) { string lastrole = "'" + rolecode.Replace(",", "','") + "'"; sql += string.Format(" and ( d.encode in ({0})", lastrole); //专业分类 if (!majorclassify.IsEmpty()) { string specialtytype = string.Empty; //判断是否启用专业分类 (整改责任单位关联人员专用) var isenablemajorclassify = idataitemdetailservice.GetDataItemListByItemCode("'ChangeDeptRelevancePerson'").Where(p => p.ItemValue == orgid).Count() > 0; if (isenablemajorclassify) { var majorEntity = idataitemdetailservice.GetEntity(majorclassify); if (null != majorEntity) { specialtytype = majorEntity.ItemValue; } if (!string.IsNullOrEmpty(specialtytype)) { sql += string.Format(" or (a.rolename like '%专工%' and (','||a.specialtytype||',') like '%,{0},%')", specialtytype); } } } sql += ")"; } //部门 if (!deptmentcode.IsEmpty()) { sql += string.Format(" and (a.departmentcode = '{0}' or a.departmentid='{0}') ", deptmentcode); } sql += string.Format(" order by a.sortcode "); var list = this.BaseRepository().FindList(sql).ToList(); return(list); }
/// <summary> /// 通过编码获取 /// </summary> /// <param name="itemCode"></param> /// <returns></returns> public IEnumerable <DataItemModel> GetDataItemListByItemCode(string itemCode) { return(service.GetDataItemListByItemCode(itemCode)); }