public JsonResult InsertLoginInfo(BrandLogin logInfo)
        {
            var result   = new Result();
            var userId   = (long)_sessiondictionary[1].Id;
            var userName = _sessiondictionary[2].Name;

            try
            {
                var existUser = _brandManager.LoginNameExist(new BrandLogin()
                {
                    Name = logInfo.Name
                });

                if (existUser == null)
                {
                    logInfo.AddedBy   = userId;
                    logInfo.AddedDate = DateTime.Now;
                    result            = _brandManager.InsertLoginInfo(logInfo);
                }
                else
                {
                    result.IsSuccess = false;
                    result.Message   = "Current Name Already Exists";
                }
            }
            catch (Exception ex)
            {
            }
            return(Json(result, JsonRequestBehavior.AllowGet));

            return(Json(result));
        }
 public BrandLogin LoginNameExist(BrandLogin logInfo)
 {
     try
     {
         return(_ibrand.LoginNameExist(logInfo));
     }
     catch (Exception ex)
     { throw ex; }
 }
        public Result InsertLoginInfo(BrandLogin logInfo)
        {
            var result = new Result();

            try
            {
                result.IsSuccess = _ibrand.InsertLoginInfo(logInfo);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(result);
        }
Exemple #4
0
        public bool InsertLoginInfo(BrandLogin logInfo)
        {
            try
            {
                _entities.BrandLogins.Add(logInfo);
                _entities.SaveChanges();


                return(true);
            }
            catch (Exception exception)
            {
                throw exception;
            }
        }
Exemple #5
0
        public BrandLogin LoginNameExist(BrandLogin logInfo)
        {
            BrandLogin log;

            try
            {
                DateTime startDate = DateTime.Today;
                DateTime endDate   = startDate.AddDays(1).AddTicks(-1);

                log = _entities.BrandLogins.FirstOrDefault(a => a.Name == logInfo.Name);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(log);
        }