Ejemplo n.º 1
0
        /// <summary>
        /// Updates the card holder.
        /// </summary>
        /// <param name="userDTO">The user DTO.</param>
        /// <returns></returns>
        /// <remarks></remarks>
        public string UpdateCardHolderLastLoginDetails(CardHolder_MstDTO userDTO)
        {
            try
            {
                IPAddress localAddress = Dns.GetHostEntry(Dns.GetHostName()).AddressList.FirstOrDefault(ip => ip.AddressFamily == AddressFamily.InterNetwork);
                //start commented by abhijeet on 20/08/2019

                /*
                 * CardHolder_Mst user = repCardHolder_Mst.SingleOrDefault(u => u.CardHolder_Id == userDTO.CardHolder_Id);
                 * user.CurrentLoginDate = DateTime.Now;
                 * var UserInfo = GetUserInfoById(userDTO.CardHolder_Id);
                 * user.LastLoginDate = UserInfo.CurrentLoginDate;
                 * user.Local_IpAddress = Convert.ToString(localAddress);
                 * user.IsLoggedInCurrently = true;
                 * GeneralManager.Commit();
                 */
                //End start commented by abhijeet on 20/08/2019
                //start Added by abhijeet on 20/08/2019
                BOBCardEntities _db = new BOBCardEntities();
                _db.getCardHolderMst(userDTO.User_nm, localAddress.ToString(), localAddress.ToString());
                //End Added by abhijeet on 20/08/2019
                return("0");
            }
            catch (Exception exp)
            {
                return(Constants.GeneralErrorMessage);
            }
        }
Ejemplo n.º 2
0
        public CardHolder_MstDTO FindActiveUser(string Username, string PublicIP = "")
        {
            // var obj = repCardHolder_Mst.SingleOrDefault(c => c.User_nm == Username && c.IsActive == true && c.IsPermanentDisable == false);
            BOBCardEntities _db = new BOBCardEntities();

            IPAddress localAddress = Dns.GetHostEntry(Dns.GetHostName()).AddressList.FirstOrDefault(ip => ip.AddressFamily == AddressFamily.InterNetwork);

            var users = _db.getCardHolderMst(Username, PublicIP, localAddress.ToString()).Select(u => new CardHolder_MstDTO()
            {
                CardHolder_Id      = u.CardHolder_Id,
                User_nm            = u.User_nm,
                User_pwd           = u.User_pwd,
                Created_dt         = u.Created_dt,
                Updated_dt         = u.Updated_dt,
                IP_Address         = u.IP_Address,
                Personal_Msg       = u.Personal_Msg,
                IsActive           = u.IsActive,
                IsPermanentDisable = u.IsPermanentDisable,
                //IsLoggedInCurrently = u.IsLoggedInCurrently,
                Oracle_Customer_Id    = u.Oracle_Customer_Id,
                credit_card_number    = u.credit_card_number,
                creditcard_acc_number = u.creditcard_acc_number,
                InvalidLastLoginDt    = u.InvalidLastLoginDt,
                CurrentLoginDate      = u.CurrentLoginDate,
                LastLoginDate         = u.LastLoginDate,
                LocalIP_Address       = u.Local_IpAddress
            }).SingleOrDefault();

            //var users = repCardHolder_Mst.Find(u => u.User_nm == Username && u.IsActive == true && u.IsPermanentDisable == false).Select(u => new CardHolder_MstDTO()
            //{
            //    CardHolder_Id = u.CardHolder_Id,
            //    User_nm = u.User_nm,
            //    User_pwd = u.User_pwd,
            //    Created_dt = u.Created_dt,
            //    Updated_dt = u.Updated_dt,
            //    IP_Address = u.IP_Address,
            //    Personal_Msg = u.Personal_Msg,
            //    IsActive = u.IsActive,
            //    IsPermanentDisable = u.IsPermanentDisable,
            //    //IsLoggedInCurrently = u.IsLoggedInCurrently,
            //    Oracle_Customer_Id = u.Oracle_Customer_Id,
            //    credit_card_number = u.credit_card_number,
            //    creditcard_acc_number = u.creditcard_acc_number,
            //    InvalidLastLoginDt = u.InvalidLastLoginDt,
            //    CurrentLoginDate = u.CurrentLoginDate,
            //    LastLoginDate = u.LastLoginDate,
            //    LocalIP_Address = u.Local_IpAddress
            //}).ToList();


            var Objusers = new CardHolder_MstDTO();

            Objusers = users;
            ////if (users.Count < 2)
            ////    Objusers = users.SingleOrDefault();
            ////else

            /*
             * if (users.Count() > 0)
             *  Objusers = users.SingleOrDefault();
             * else
             *  Objusers = users.First();
             */
            //if (Objusers != null)
            //{
            //    var obj = repCardHolder_Mst.SingleOrDefault(c => c.User_nm == Username && c.IsActive == true && c.IsPermanentDisable == false);
            //    if (obj != null)
            //    {



            //        if (localAddress != null)
            //            obj.Local_IpAddress = Convert.ToString(localAddress);


            //        if (PublicIP != "")
            //            Objusers.IP_Address = PublicIP;
            //        GeneralManager.Commit();
            //    }
            //}
            return(Objusers);
        }