예제 #1
0
        public string AddEntryCard(string userId, int loginId, int profileId, string card)
        {
            ResponseModel resp = new ResponseModel();

            var user = _userservices.GetUserProfiles(userManager.GetUserId(User).ToString(), 0, 0);

            if (profileId > 0 && loginId > 0 && !string.IsNullOrEmpty(card) && card.Length == 10)
            {
                EntryCard Card = new EntryCard
                {
                    Card      = card,
                    ProfileId = profileId,
                    LoginId   = loginId,
                    UserId    = userId,

                    CreateProfileId = user.ProfileId,
                    EditProfileId   = user.ProfileId,

                    CreateLogiId = user.LoginId,
                    EditLogiId   = user.LoginId
                };

                resp = _userservices.AddEntryCard(Card);
            }
            else if (card.Length != 10)
            {
                resp.message  = "wn|Tarjeta NO Adicionada, número de digitos <> 10|ADICION DE TARJETA";
                resp.response = false;
            }

            if (resp.response)
            {
                resp.message = "ok|Tarjeta Adicionada (" + resp.identity.ToString() + ")|ADICION DE TARJETA";
            }
            else
            {
                if (!string.IsNullOrEmpty(resp.message))
                {
                    resp.message = "wn|Tarjeta NO Adicionada, revise información|ADICION DE TARJETA";
                }
            }

            return(resp.message);
        }