Exemplo n.º 1
0
        public MyResult ConfirmConnect(int par0, bool par1)
        {
            EPeople people = DBBase.Get <EPeople>(par0);

            if (par1)
            {
                people.State = Entity.Enum.PeopleState.Normal;
                EPeople other = DBBase.Query <EPeople>(string.Format("UserID={0} and PeopleID={1}", people.PeopleID, people.UserID)).FirstOrDefault();
                if (other != null)
                {
                    other.State = Entity.Enum.PeopleState.Normal;
                    DBBase.Change(other);
                }
                DBBase.Change(people);
            }
            else
            {
                EPeople other = DBBase.Query <EPeople>(string.Format("UserID={0} and PeopleID={1}", people.PeopleID, people.UserID)).FirstOrDefault();
                if (other != null)
                {
                    DBBase.Delete <EPeople>(other.ID);
                }
                DBBase.Delete <EPeople>(people.ID);
            }
            return(ServiceResult("ok"));
        }
Exemplo n.º 2
0
        public MyResult Delete(string par0, int par1)
        {
            ServiceReturn ret  = new ServiceReturn();
            Assembly      asmb = Assembly.GetAssembly(typeof(ServiceReturn));
            Type          type = asmb.GetType(par0);

            DBBase.Delete(type, par1);
            return(ServiceResult(par1.ToString()));
        }
Exemplo n.º 3
0
        public MyResult DisConnect(int par0)
        {
            EPeople people = DBBase.Query <EPeople>(string.Format("UserID={0} and PeopleID={1}", MySession.UserID, par0)).FirstOrDefault();
            EPeople other  = DBBase.Query <EPeople>(string.Format("UserID={0} and PeopleID={1}", par0, MySession.UserID)).FirstOrDefault();

            if (people != null)
            {
                DBBase.Delete <EPeople>(people.ID);
            }
            if (other != null)
            {
                DBBase.Delete <EPeople>(other.ID);
            }
            return(ServiceResult("ok"));
        }