/// <summary> /// 实体类NewsModel值添加到List<T_PF_DISTRIBUTEUSER> /// </summary> /// <param name="cilientModel"></param> /// <returns></returns> private ObservableCollection <T_PF_DISTRIBUTEUSER> ModelEntity(NewsModel cilientModel) { ObservableCollection <T_PF_DISTRIBUTEUSER> ButeUserModel = new ObservableCollection <T_PF_DISTRIBUTEUSER>(); // NewsId = cilientModel.NEWSID.Length > 0 ? cilientModel.NEWSID : Guid.NewGuid().ToString(); foreach (var item in cilientModel.VIEWER) { T_PF_DISTRIBUTEUSER model = new T_PF_DISTRIBUTEUSER() { CREATECOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID, CREATEDATE = DateTime.Now, CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID, CREATEPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID, CREATEUSERID = Common.CurrentLoginUserInfo.EmployeeID, CREATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName, OWNERCOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID, OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID, OWNERID = Common.CurrentLoginUserInfo.EmployeeID, OWNERNAME = Common.CurrentLoginUserInfo.EmployeeName, OWNERPOSTID = Common.CurrentLoginUserInfo.EmployeeID, UPDATEUSERID = Common.CurrentLoginUserInfo.EmployeeID, UPDATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName, UPDATEDATE = DateTime.Now, //新闻关联表ID赋值 DISTRIBUTEUSERID = Guid.NewGuid().ToString(), MODELNAME = item.MODELNAMES, //新闻ID赋值 FORMID = NewsId,//cilientModel.NEWSID.Length > 0 ? cilientModel.NEWSID : Guid.NewGuid().ToString(), VIEWTYPE = "3", //用户权限赋值 VIEWER = item.VIEWERS }; ButeUserModel.Add(model); } return(ButeUserModel); }
/// <summary> /// 实体类NewsModel值添加到List<T_PF_DISTRIBUTEUSER> /// </summary> /// <param name="cilientModel"></param> /// <returns></returns> private ObservableCollection<T_PF_DISTRIBUTEUSER> ModelEntity(NewsModel cilientModel) { ObservableCollection<T_PF_DISTRIBUTEUSER> ButeUserModel = new ObservableCollection<T_PF_DISTRIBUTEUSER>(); // NewsId = cilientModel.NEWSID.Length > 0 ? cilientModel.NEWSID : Guid.NewGuid().ToString(); foreach (var item in cilientModel.VIEWER) { T_PF_DISTRIBUTEUSER model = new T_PF_DISTRIBUTEUSER() { CREATECOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID, CREATEDATE = DateTime.Now, CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID, CREATEPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID, CREATEUSERID = Common.CurrentLoginUserInfo.EmployeeID, CREATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName, OWNERCOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID, OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID, OWNERID = Common.CurrentLoginUserInfo.EmployeeID, OWNERNAME = Common.CurrentLoginUserInfo.EmployeeName, OWNERPOSTID = Common.CurrentLoginUserInfo.EmployeeID, UPDATEUSERID = Common.CurrentLoginUserInfo.EmployeeID, UPDATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName, UPDATEDATE = DateTime.Now, //新闻关联表ID赋值 DISTRIBUTEUSERID = Guid.NewGuid().ToString(), MODELNAME = item.MODELNAMES, //新闻ID赋值 FORMID = NewsId,//cilientModel.NEWSID.Length > 0 ? cilientModel.NEWSID : Guid.NewGuid().ToString(), VIEWTYPE = "3", //用户权限赋值 VIEWER = item.VIEWERS }; ButeUserModel.Add(model); } return ButeUserModel; }