Esempio n. 1
0
        public bool Approve(int id, string name)
        {
            var partner = FindById(id);
            var store   = _store.FindByID(partner.StoreID);

            partner.ModifiedID   = _user.GetByName(name).Result.ID;
            partner.ModifiedDate = DateTime.Now;
            partner.isWorking    = true;
            var mess = new Message();

            mess.CreatedDate = DateTime.Now;
            mess.DataID      = partner.StoreID;
            mess.Description = "Your apply to store " + store.Name + " is accepted.";
            mess.IsRead      = false;
            mess.MessageType = MESS_STORE;
            mess.SentID      = partner.UseID;
            mess.FromID      = store.UserID;
            _mess.CreateMessage(mess);
            return(_repo.Edit(partner.Translate <PartnerDTO, Partner>()));
        }