public JsonResult InsertCreateAccountInfo(tblCreateAccount accountInfo)
        {
            var userId   = (long)_sessiondictionary[1].Id;
            var userName = (long)_sessiondictionary[2].Id;
            var result   = new Result();

            try
            {
                var existUser = _brandManager.MobileNumberExist(new tblCreateAccount()
                {
                    Mobile = accountInfo.Mobile
                });

                if (existUser == null)
                {
                    accountInfo.AddedDate = DateTime.Now;
                    result = _brandManager.InsertCreateAccountInfo(accountInfo);
                }
                else
                {
                    result.IsSuccess = false;
                    result.Message   = "Current Mobile Number Already Exists";
                }
            }
            catch (Exception ex)
            {
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
 public tblCreateAccount MobileNumberExist(tblCreateAccount accountInfo)
 {
     try
     {
         return(_ibrand.MobileNumberExist(accountInfo));
     }
     catch (Exception ex)
     { throw ex; }
 }
        public Result InsertCreateAccountInfo(tblCreateAccount accountInfo)
        {
            var result = new Result();

            try
            {
                result.IsSuccess = _ibrand.InsertCreateAccountInfo(accountInfo);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(result);
        }
Esempio n. 4
0
        public bool InsertCreateAccountInfo(tblCreateAccount accountInfo)
        {
            try
            {
                _entities.tblCreateAccounts.Add(accountInfo);
                _entities.SaveChanges();


                return(true);
            }
            catch (Exception exception)
            {
                throw exception;
            }
        }
Esempio n. 5
0
        public tblCreateAccount MobileNumberExist(tblCreateAccount accountInfo)
        {
            tblCreateAccount account;

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

                account = _entities.tblCreateAccounts.FirstOrDefault(a => a.Mobile == accountInfo.Mobile);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(account);
        }