public void SureRendingReply(Guid itemId)
        {
            var item = GenericService.GetModel(itemId);

            if (item == null)
            {
                throw new Exception("用户不存在,或已被删除!");
            }

            item.ApplyState = 99;

            var newItem = new DZAFCPortal.Entity.MyFriends();

            newItem.ID              = Guid.NewGuid().ToString();
            newItem.UserAccount     = item.MyFriendAccount;
            newItem.MyFriendAccount = item.UserAccount;
            newItem.ApplyState      = 99;

            //判断用户是否在另一用户列表中
            var _temp = GenericService.GetAll(p => p.UserAccount == newItem.UserAccount && p.MyFriendAccount == newItem.MyFriendAccount).FirstOrDefault();

            if (_temp != null)
            {
                _temp.ApplyState = 99;
                GenericService.Update(_temp);
            }
            else
            {
                GenericService.Add(newItem);
            }

            GenericService.Save();
        }
        public void IgnorRendingReply(Guid itemId)
        {
            var item = GenericService.GetModel(itemId);

            if (item == null)
            {
                throw new Exception("用户不存在,或已被删除!");
            }

            item.ApplyState = -99;

            GenericService.Update(item);
            GenericService.Save();
        }
 public string GetDicTypeNameByID(string id)
 {
     return(GenericService.GetModel(id).Name);
 }
Beispiel #4
0
 public string GetDicNameByID(string id)
 {
     return(GenericService.GetModel(id).DisplayName);
 }