public ActionResult Login(AccountModel.LoginModel model, string returnUrl)
        {
            if (ModelState.IsValid)
            {

                using (UsersRepository usersRepository = new UsersRepository())
                {
                    Users user = usersRepository.GetUserByLoginModel(model);
                    if ( user== null)
                        ModelState.AddModelError("LogOnError", "The user name or password provided is incorrect.");
                    else
                    {
                        FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
                        Session["UserID"] = user.UserID;
                        Session["MyMenu"] = null;
                        if (Url.IsLocalUrl(returnUrl) && returnUrl.Length > 1 && returnUrl.StartsWith("/")
                           && !returnUrl.StartsWith("//") && !returnUrl.StartsWith("/\\"))
                        {
                            return Redirect(returnUrl);
                        }
                        else
                        {
                            //Redirect to default page
                            return RedirectToAction("RedirectToDefault");
                        }
                    }
                }

            }

            // If we got this far, something failed, redisplay form

            return View(model);
        }
Beispiel #2
0
        public ViewResult MainViewResult()
        {
            var viewResult = new ViewResult();
            viewResult.ViewName = "Index";

            var userProducts = new ProductModel(Domain.User.Products);
            userProducts.Refresh();

            var userAccount = new AccountModel(Domain.User.Account);
            userAccount.Refresh();

            var vmProducts = new ProductModel(Domain.VM.Products);
            vmProducts.Refresh();

            var vmBankAccount = new AccountModel(Domain.VM.BankAccount);
            vmBankAccount.Refresh();

            viewResult.ViewBag.UserProducts = userProducts;
            viewResult.ViewBag.UserAccount = userAccount;
            viewResult.ViewBag.VMProducts = vmProducts;
            viewResult.ViewBag.VMBankAccount = vmBankAccount;
            viewResult.ViewBag.VMUserAccount = Domain.VM.UserAccount;

            return viewResult;
        }
        public object Post(AccountModel request)
        {
            var session = this.GetSession();
            ValidationResult validations = new AccountValidator().Validate(request);
            if (!validations.IsValid)
            {
                request.ResponseResult.ResultStatus = ResultStatuses.Error;
                foreach (var item in validations.Errors)
                {
                    request.ResponseResult.Messages.Add(item.ErrorMessage);
                }

                return request;
            }

            string hash, salt;
            new SaltedHash().GetHashAndSaltString(request.Password, out hash, out salt);

            try
            {
                var roles = new List<string>();
                if (request.IsMember)
                {
                    roles.Add("Member");
                }
                else
                {
                    roles.Add("Author");
                }

                var newUser = UserAuthRepository.CreateUserAuth(new UserAuth
                {
                    DisplayName = request.UserName,
                    Email = request.Email,
                    FirstName = request.FirstName,
                    LastName = request.LastName,
                    PrimaryEmail = request.Email,
                    UserName = request.UserName,
                    Salt = salt,
                    PasswordHash = hash,
                    FullName = "{0} {1}".Fmt(request.FirstName, request.LastName),
                    Roles = roles
                }, request.Password);
            }
            catch (ArgumentException ex)
            {
                request.ResponseResult.ResultStatus = ResultStatuses.Error;
                request.ResponseResult.Messages.Add(ex.Message);

                return request;
            }

            request.ResponseResult.ResultStatus = ResultStatuses.Success;
            return request;
        }
        public void Save(AccountModel account)
        {
            if (account != null)
            {
                MongoCollection<AccountModel> accountsDB = Tools.MongoConnector.Instance.DataBase.GetCollection<AccountModel>(ACCOUNT_DB_NAME);
                accountsDB.Save(account);

                //Can be Optimize
                HttpRuntime.Cache.Remove(ACCOUNT_KEY);
            }
        }
 public AccountViewModel(AccountModel model)
 {
     Email = model.Email;
     Password = model.Password;
     FirstName = model.FirstName;
     MiddleInitial = model.MiddleInitial;
     LastName = model.LastName;
     DateOfBirth = model.DateOfBirth;
     PhoneNumber = model.PhoneNumber;
     AddressLine1 = model.AddressLine1;
     AddressLine2 = model.AddressLine2;
     ZipCode = model.ZipCode;
 }
Beispiel #6
0
        public void SetAccount()
        {
            if (AccountDetails == null)
            {
                AccountDetails = new AccountModel();
            }
            else
            {
                AccountDetails.Name += "A";
            }

            RaisePropertyChanged(() => AccountDetailsName);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="controller"></param>
        /// <param name="model"></param>
        public SyncAccounts(Controller controller, AccountModel model)
        {
            _controller = controller;
            _model = model;
            var accountSettings = _model.ServerAccountSettings.Query().First();

            // If this doesn't exist, the server probably hasn't been fully linked yet.
            var serverIdentifier = accountSettings.Identifier;
            if (serverIdentifier == null)
                return;

            _appServerAccountId = AppModel.GetServerAccountForIdentifier(serverIdentifier).Id;

            //_syncLoopThread = new Thread(Run);
        }
        public object Get(AccountModel request)
        {
            var userAuth = UserAuthRepository.GetUserAuthByUserName(request.UserName);

            return new
            {
                Id = userAuth.Id,
                FirstName = userAuth.FirstName,
                LastName = userAuth.LastName,
                UserName = userAuth.UserName,
                DisplayName = userAuth.DisplayName,
                Email = userAuth.Email,
                IsMember = userAuth.Roles.Contains("Member")
            };
        }
Beispiel #9
0
        public ActionResult Account()
        {
            ShopConfigInfo shopConfigInfo = BSPConfig.ShopConfig;

            AccountModel model = new AccountModel();
            model.RegType = StringToIntArray(shopConfigInfo.RegType);
            model.ReservedName = shopConfigInfo.ReservedName;
            model.RegTimeSpan = shopConfigInfo.RegTimeSpan;
            model.IsWebcomeMsg = shopConfigInfo.IsWebcomeMsg;
            model.WebcomeMsg = shopConfigInfo.WebcomeMsg;
            model.LoginType = StringToIntArray(shopConfigInfo.LoginType);
            model.ShadowName = shopConfigInfo.ShadowName;
            model.IsRemember = shopConfigInfo.IsRemember;
            model.LoginFailTimes = shopConfigInfo.LoginFailTimes;

            return View(model);
        }
 /// <summary>
 /// 初始化一个新的临时素材服务实例。
 /// </summary>
 /// <param name="accountModel">账号模型。</param>
 public TemporaryMaterialService(AccountModel accountModel)
 {
     _accountModel = accountModel;
 }
Beispiel #11
0
 public void add(AccountModel account)
 {
     Accounts.Add(account);
 }
Beispiel #12
0
 /// <summary>
 /// 初始化一个新的用户群组服务实例。
 /// </summary>
 /// <param name="accountModel">账号模型。</param>
 public UserGroupService(AccountModel accountModel)
 {
     _accountModel = accountModel;
 }
 public Users GetUserByLoginModel(AccountModel.LoginModel Login)
 {
     return(userContext.UserProfiles.FirstOrDefault(u=>(u.UserName==Login.UserName && u.Password==Login.Password)));
 }
Beispiel #14
0
 /// <summary>
 /// 初始化一个卡券服务。
 /// </summary>
 /// <param name="accountModel">账号模型。</param>
 public CardService(AccountModel accountModel)
 {
     _accountModel = accountModel;
 }
Beispiel #15
0
 private static bool Auth()
 {
     return(AccountModel.AuthenticateMobile("Checkin").IsValid);
 }
Beispiel #16
0
 public OAuthService(AccountModel accountModel)
 {
     _accountModel = accountModel;
 }
 public ActionResult UpdateAccount(AccountModel viewModel)
 {
     viewModel.aAccount.PassWord = bllMethods.PassWordHash(viewModel.aAccount.PassWord);
     dataMethods.UpdateAccountAdmin(MappingMethods.MapAccountPOtoDO(viewModel.aAccount));
     return(RedirectToAction("ViewAccounts", "Admin"));
 }
        public async Task ShouldReturnListofTransactionSummaryViewModelGroupedByCategoryWithMaxMinandAverageAmountWhenStorageHasData()
        {
            var mockStorage = new Mock <IStorage>();
            var account     = new AccountModel
            {
                AccountId   = "testAccountId",
                AccountName = "TestAccount",
                AccountType = "TestAccountType"
            };
            var accounts = new List <AccountModel> {
                account
            };
            var transaction1 =
                new TransactionModel
            {
                Amount              = 1,
                Description         = "testDesc",
                TransactionCategory = "testCategory",
                TransactionType     = "testTransaction"
            };
            var transaction2 =
                new TransactionModel
            {
                Amount              = 10,
                Description         = "testDesc",
                TransactionCategory = "testCategory",
                TransactionType     = "testTransaction"
            };
            var transaction3 =
                new TransactionModel
            {
                Amount              = 20,
                Description         = "testDesc",
                TransactionCategory = "testCategory",
                TransactionType     = "testTransaction"
            };
            var transactions = new List <TransactionModel> {
                transaction1, transaction2, transaction3
            };
            var transactionViewModel = new List <TransactionViewModel>
            {
                new TransactionViewModel
                {
                    Account     = account,
                    Transaction = transactions
                }
            };

            mockStorage.Setup(x => x.Get <List <TransactionViewModel> >("transactionViewModel")).Returns(transactionViewModel);
            var handler = new TransactionSummaryHandler(mockStorage.Object);

            var result = await handler.Handle(It.IsAny <GetTransactionSummaryQuery>(), It.IsAny <CancellationToken>());

            Assert.IsTrue(result.Response.Count > 0);
            Assert.IsTrue(result.Response[0].TransactionSummary[0].AverageAmount == "10.33");
            Assert.IsTrue(result.Response[0].TransactionSummary[0].MinAmount == "1");
            Assert.IsTrue(result.Response[0].TransactionSummary[0].MaxAmount == "20");
            Assert.IsTrue(result.Response[0].TransactionSummary[0].TransactionCategory == "testCategory");

            Assert.IsInstanceOfType(result.Response, typeof(List <TransactionSummaryViewModel>));
        }
        /// <summary>
        /// Function used to Add/Update Account information
        /// </summary>
        /// <param name="accountModel"></param>
        public void AddUpdateAccount(AccountModel accountModel)
        {
            Account account = new Account();

            if (accountModel.ParentAccountId == 0)
            {
                accountModel.ParentAccountId = null;
            }
            if (accountModel.AccountTypeId == 0)
            {
                accountModel.AccountTypeId = null;
            }
            if (accountModel.IndustryId == 0)
            {
                accountModel.IndustryId = null;
            }


            //if account id is 0 then account will be added
            if (accountModel.AccountId == 0)
            {
                AutoMapper.Mapper.Map(accountModel, account);
                account.CreatedDate  = DateTime.UtcNow;
                account.ModifiedDate = DateTime.UtcNow;
                account.Address      = ValidateAddress(account.Address, accountModel.AddressModel);
                account.Address1     = ValidateAddress(account.Address1, accountModel.AddressModel1);


                accountRepository.Insert(account);
            }
            else   //if account id is not 0 then account will be updated
            {
                account = accountRepository.SingleOrDefault(x => x.AccountId == accountModel.AccountId);

                // Created by and CreatedDate will not change during mapping
                accountModel.CreatedBy   = account.CreatedBy;
                accountModel.CreatedDate = account.CreatedDate;

                AutoMapper.Mapper.Map(accountModel, account);
                account.ModifiedDate = DateTime.UtcNow;
                account.Address      = ValidateAddress(account.Address, accountModel.AddressModel);
                account.Address1     = ValidateAddress(account.Address1, accountModel.AddressModel1);
                accountRepository.Update(account);
            }


            List <int> listAllExistingTagIds       = new List <int>();
            List <int> listNewTagIds               = new List <int>();
            List <int> listContactAssociatedTagIds = new List <int>();
            List <int> listDeleteTagIds            = new List <int>();

            listContactAssociatedTagIds = account.AccountTags.Select(x => x.TagId).ToList();

            if (!string.IsNullOrEmpty(accountModel.AccountTagIds))
            {
                string[] arrTagIds = accountModel.AccountTagIds.Split(',');
                for (int i = 0; i < arrTagIds.Length; i++)
                {
                    int tagId = arrTagIds[i].Decrypt();

                    if (listContactAssociatedTagIds.Where(x => x == tagId).Count() == 0)
                    {
                        listNewTagIds.Add(tagId);
                    }
                    else
                    {
                        listAllExistingTagIds.Add(tagId);
                    }
                }
            }


            if (!string.IsNullOrEmpty(accountModel.NewTagNames))
            {
                List <int> lisNewAddedTagIds = new List <int>();
                lisNewAddedTagIds = AddTagsToSystem(accountModel.NewTagNames, accountModel.CompanyId, accountModel.CreatedBy.Value);

                if (lisNewAddedTagIds.Count > 0)
                {
                    listNewTagIds = listNewTagIds.Concat(lisNewAddedTagIds).ToList();
                }
            }
            for (int i = 0; i < listContactAssociatedTagIds.Count; i++)
            {
                if (listAllExistingTagIds.Where(x => x == listContactAssociatedTagIds[i]).Count() == 0)
                {
                    listDeleteTagIds.Add(listContactAssociatedTagIds[i]);
                }
            }

            //Associate Tagids to contact
            if (listNewTagIds.Count > 0)
            {
                AccountTag accountTag;
                for (int i = 0; i < listNewTagIds.Count; i++)
                {
                    accountTag           = new AccountTag();
                    accountTag.AccountId = account.AccountId;
                    accountTag.TagId     = listNewTagIds[i];
                    accountTagRepository.Insert(accountTag);
                }
            }

            if (listDeleteTagIds.Count > 0)
            {
                accountTagRepository.Delete(x => x.AccountId == account.AccountId && listDeleteTagIds.Contains(x.TagId));
            }
        }
        /// <summary>
        /// 账号密码是否匹配
        /// </summary>
        /// <param name="acc"></param>
        /// <param name="pwd"></param>
        /// <returns></returns>
        public bool IsMatch(string acc, string pwd)
        {
            AccountModel model = accModelDic[acc];

            return(model.password == pwd);
        }
        public void Creat(string acc, string pwd)
        {
            AccountModel model = new AccountModel(id.Add_Get(), acc, pwd);

            accModelDic.Add(model.account, model);
        }
Beispiel #22
0
        /// <summary>
        /// Action加上[SupportFilter]在执行actin之前执行以下代码,通过[SupportFilter(ActionName="Index")]指定参数
        /// </summary>
        /// <param name="filterContext">页面传过来的上下文</param>
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            //过滤危险字符,需要设置规则,暂时注掉,需要开启
            //var actionParameters = filterContext.ActionDescriptor.GetParameters();
            //foreach (var p in actionParameters)
            //{
            //    if (p.ParameterType == typeof(string))
            //    {
            //        if (filterContext.ActionParameters[p.ParameterName] != null)
            //        {
            //            filterContext.ActionParameters[p.ParameterName] = ResultHelper.Formatstr(filterContext.ActionParameters[p.ParameterName].ToString());
            //        }
            //    }
            //}
            //读取请求上下文中的Controller,Action,Id
            var routes = new RouteCollection();

            RouteConfig.RegisterRoutes(routes);
            RouteData routeData = routes.GetRouteData(filterContext.HttpContext);
            //取出区域的控制器Action,id
            string ctlName = filterContext.Controller.ToString();

            string[] routeInfo  = ctlName.Split('.');
            string   controller = null;
            string   action     = null;
            string   id         = null;

            int iAreas = Array.IndexOf(routeInfo, "Areas");

            if (iAreas > 0)
            {
                //取区域及控制器
                Area = routeInfo[iAreas + 1];
            }
            int ctlIndex = Array.IndexOf(routeInfo, "Controllers");

            ctlIndex++;
            controller = routeInfo[ctlIndex].Replace("Controller", "").ToLower();

            string url = HttpContext.Current.Request.Url.ToString().ToLower();

            string[] urlArray    = url.Split('/');
            int      urlCtlIndex = Array.IndexOf(urlArray, controller);

            urlCtlIndex++;
            if (urlArray.Count() > urlCtlIndex)
            {
                action = urlArray[urlCtlIndex];
            }
            urlCtlIndex++;
            if (urlArray.Count() > urlCtlIndex)
            {
                id = urlArray[urlCtlIndex];
            }
            //url
            action = string.IsNullOrEmpty(action) ? "Index" : action;
            int actionIndex = action.IndexOf("?", 0);

            if (actionIndex > 1)
            {
                action = action.Substring(0, actionIndex);
            }
            id = string.IsNullOrEmpty(id) ? "" : id;

            //URL路径
            string       filePath = HttpContext.Current.Request.FilePath;
            AccountModel account  = filterContext.HttpContext.Session["Account"] as AccountModel;

            if (LoginUserManage.ValidateIsLogined(account) && ValiddatePermission(account, controller, action, filePath) && !LoginUserManage.ValidateRelogin(account))
            {
                //已经登录,有权限,且没有单机登录限制
                return;
            }
            else
            {
                filterContext.Result = new EmptyResult();
                return;
            }
        }
 public AccountCreationViewModel()
 {
     NewAccount = new AccountModel();
 }
 public CustomServiceSessionService(AccountModel accountModel)
 {
     _accountModel = accountModel;
 }
        private void InitAccountData(object sender, RoutedEventArgs e)
        {
            string pathToFile = _cp.GetFullPath(_pageLinkFileName);

            // Check Address List existing
            if (File.Exists(pathToFile))
            {
                //var serializer = new JsonSerializer();

                // Deserialize name and pass
                UniversalSerializeDataClass <List <string> > deserilazeData = new UniversalSerializeDataClass <List <string> >();
                PageLinkArray.PageListLink = deserilazeData.DeserializeData(pathToFile);

                // Check null
                if (PageLinkArray.PageListLink != null)
                {
                    // Change color and set successful message
                    ErrorLabel.Foreground = new SolidColorBrush(Colors.Green);
                    ErrorLabel.Content   += $"Page link list load success!\nList count: {PageLinkArray.PageListLink.Count}";

                    // Add dresses to text block
                    foreach (var item in PageLinkArray.PageListLink)
                    {
                        PageLinkBlock.Text += item;
                        PageLinkBlock.Text += "\r\n";
                    }
                }
                else
                {
                    // Change color and set failed message
                    ErrorLabel.Foreground = new SolidColorBrush(Colors.Red);
                    ErrorLabel.Content   += "Page link list load FAILED!\nPlease, add links to list!";
                }
            }
            else
            {
                // Change color and set failed message
                ErrorLabel.Foreground = new SolidColorBrush(Colors.Red);
                ErrorLabel.Content   += "Page link list NOT EXISTS!\nPlease, add links to list!";
            }

            if (File.Exists(_fullPath))
            {
                // Save button disable
                SaveButton.IsEnabled = false;

                // Deserialize name and pass
                UniversalSerializeDataClass <AccountModel> deSerializeData = new UniversalSerializeDataClass <AccountModel>();
                _am = deSerializeData.DeserializeData(_fullPath);

                // Check for null
                if (_am == null)
                {
                    ErrorLabel.Foreground = new SolidColorBrush(Colors.Red);
                    ErrorLabel.Content   += "\nAccount Data load failed!";
                    File.Delete(_fullPath);
                    return;
                }

                // Set values to textboxes
                UserNameBox.Text     = _am.UserName;
                PasswordBox.Password = _am.UserPassword;

                // Change color and set successful message
                ErrorLabel.Foreground = new SolidColorBrush(Colors.Green);
                ErrorLabel.Content   += "\nAccount Data load success!";
            }
            else
            {
                // Set save button to enable
                SaveButton.IsEnabled = true;
            }
        }
Beispiel #26
0
 /// <summary>
 /// 初始化一个二维码服务实例。
 /// </summary>
 /// <param name="accountModel">账号模型。</param>
 public QrCodeService(AccountModel accountModel)
 {
     _accountModel = accountModel;
 }
Beispiel #27
0
        public static bool Insert_2(SewingMasterModel model, AccountModel account)
        {
            DateTime dtDefault         = new DateTime(2000, 01, 01);
            var      @ProductNo        = new SqlParameter("@ProductNo", model.ProductNo);
            var      @Sequence         = new SqlParameter("@Sequence", model.Sequence);
            var      @SewingLine       = new SqlParameter("@SewingLine", model.SewingLine);
            var      @SewingStartDate  = new SqlParameter("@SewingStartDate", model.SewingStartDate);
            var      @SewingFinishDate = new SqlParameter("@SewingFinishDate", model.SewingFinishDate);
            var      @SewingQuota      = new SqlParameter("@SewingQuota", model.SewingQuota);

            var @SewingPrep = new SqlParameter("@SewingPrep", model.SewingPrep);

            var @SewingActualStartDate  = new SqlParameter("@SewingActualStartDate", model.SewingActualStartDate);
            var @SewingActualFinishDate = new SqlParameter("@SewingActualFinishDate", model.SewingActualFinishDate);

            DateTime sewingActualStartDateAutoDt  = TimeHelper.Convert(model.SewingActualStartDateAuto);
            DateTime sewingActualFinishDateAutoDt = TimeHelper.Convert(model.SewingActualFinishDateAuto);

            string sewingActualStartDateAutoString = "";

            if (sewingActualStartDateAutoDt != dtDefault)
            {
                sewingActualStartDateAutoString = String.Format("{0:MM/dd/yyyy}", sewingActualStartDateAutoDt);
            }
            string sewingActualFinishDateAutoString = "";

            if (sewingActualFinishDateAutoDt != dtDefault)
            {
                sewingActualFinishDateAutoString = String.Format("{0:MM/dd/yyyy}", sewingActualFinishDateAutoDt);
            }

            var @SewingActualStartDateAuto  = new SqlParameter("@SewingActualStartDateAuto", sewingActualStartDateAutoString);
            var @SewingActualFinishDateAuto = new SqlParameter("@SewingActualFinishDateAuto", sewingActualFinishDateAutoString);

            //var @SewingBalance                      = new SqlParameter("@SewingBalance", model.SewingBalance);

            var sewingBalanceInsert = model.SewingBalance;

            if (model.SewingBalance_Date != dtDefault)
            {
                sewingBalanceInsert = model.SewingBalance_Date.ToShortDateString();
            }
            var @SewingBalance = new SqlParameter("@SewingBalance", sewingBalanceInsert);


            var @CutAStartDate  = new SqlParameter("@CutAStartDate", model.CutAStartDate);
            var @CutAFinishDate = new SqlParameter("@CutAFinishDate", model.CutAFinishDate);
            var @CutAQuota      = new SqlParameter("@CutAQuota", model.CutAQuota);

            var @CutAActualStartDate  = new SqlParameter("@CutAActualStartDate", model.CutAActualStartDate);
            var @CutAActualFinishDate = new SqlParameter("@CutAActualFinishDate", model.CutAActualFinishDate);

            var cutABalanceInsert = model.CutABalance;

            if (model.CutABalance_Date != dtDefault)
            {
                cutABalanceInsert = model.CutABalance_Date.ToShortDateString();
            }
            var @CutABalance = new SqlParameter("@CutABalance", cutABalanceInsert);


            var @PrintingBalance   = new SqlParameter("@PrintingBalance", model.PrintingBalance);
            var @H_FBalance        = new SqlParameter("@H_FBalance", model.H_FBalance);
            var @EmbroideryBalance = new SqlParameter("@EmbroideryBalance", model.EmbroideryBalance);

            var @CutBActualStartDate = new SqlParameter("@CutBActualStartDate", model.CutBActualStartDate);

            var @CutBBalance = new SqlParameter("@CutBBalance", model.CutBBalance);
            var @AutoCut     = new SqlParameter("@AutoCut", model.AutoCut);
            var @LaserCut    = new SqlParameter("@LaserCut", model.LaserCut);
            var @HuasenCut   = new SqlParameter("@HuasenCut", model.HuasenCut);


            var @CutBStartDate = new SqlParameter("@CutBStartDate", model.CutBStartDate);
            var @AtomCutA      = new SqlParameter("@AtomCutA", model.AtomCutA);
            var @AtomCutB      = new SqlParameter("@AtomCutB", model.AtomCutB);
            var @LaserCutA     = new SqlParameter("@LaserCutA", model.LaserCutA);
            var @LaserCutB     = new SqlParameter("@LaserCutB", model.LaserCutB);
            var @HuasenCutA    = new SqlParameter("@HuasenCutA", model.HuasenCutA);
            var @HuasenCutB    = new SqlParameter("@HuasenCutB", model.HuasenCutB);
            var @ComelzCutA    = new SqlParameter("@ComelzCutA", model.ComelzCutA);
            var @ComelzCutB    = new SqlParameter("@ComelzCutB", model.ComelzCutB);

            var @IsSequenceUpdate         = new SqlParameter("@IsSequenceUpdate", model.IsSequenceUpdate);
            var @IsSewingLineUpdate       = new SqlParameter("@IsSewingLineUpdate", model.IsSewingLineUpdate);
            var @IsSewingStartDateUpdate  = new SqlParameter("@IsSewingStartDateUpdate", model.IsSewingStartDateUpdate);
            var @IsSewingFinishDateUpdate = new SqlParameter("@IsSewingFinishDateUpdate", model.IsSewingFinishDateUpdate);
            var @IsSewingQuotaUpdate      = new SqlParameter("@IsSewingQuotaUpdate", model.IsSewingQuotaUpdate);

            var @IsSewingPrepUpdate = new SqlParameter("@IsSewingPrepUpdate", model.IsSewingPrepUpdate);

            var @IsSewingActualStartDateUpdate  = new SqlParameter("@IsSewingActualStartDateUpdate", model.IsSewingActualStartDateUpdate);
            var @IsSewingActualFinishDateUpdate = new SqlParameter("@IsSewingActualFinishDateUpdate", model.IsSewingActualFinishDateUpdate);

            var @IsSewingActualStartDateAutoUpdate  = new SqlParameter("@IsSewingActualStartDateAutoUpdate", model.IsSewingActualStartDateAutoUpdate);
            var @IsSewingActualFinishDateAutoUpdate = new SqlParameter("@IsSewingActualFinishDateAutoUpdate", model.IsSewingActualFinishDateAutoUpdate);

            var @IsSewingBalanceUpdate        = new SqlParameter("@IsSewingBalanceUpdate", model.IsSewingBalanceUpdate);
            var @IsCutAStartDateUpdate        = new SqlParameter("@IsCutAStartDateUpdate", model.IsCutAStartDateUpdate);
            var @IsCutAFinishDateUpdate       = new SqlParameter("@IsCutAFinishDateUpdate", model.IsCutAFinishDateUpdate);
            var @IsCutAQuotaUpdate            = new SqlParameter("@IsCutAQuotaUpdate", model.IsCutAQuotaUpdate);
            var @IsCutAActualStartDateUpdate  = new SqlParameter("@IsCutAActualStartDateUpdate", model.IsCutAActualStartDateUpdate);
            var @IsCutAActualFinishDateUpdate = new SqlParameter("@IsCutAActualFinishDateUpdate", model.IsCutAActualFinishDateUpdate);
            var @IsCutABalanceUpdate          = new SqlParameter("@IsCutABalanceUpdate", model.IsCutABalanceUpdate);
            var @IsPrintingBalanceUpdate      = new SqlParameter("@IsPrintingBalanceUpdate", model.IsPrintingBalanceUpdate);
            var @IsH_FBalanceUpdate           = new SqlParameter("@IsH_FBalanceUpdate", model.IsH_FBalanceUpdate);
            var @IsEmbroideryBalanceUpdate    = new SqlParameter("@IsEmbroideryBalanceUpdate", model.IsEmbroideryBalanceUpdate);

            var @IsCutBActualStartDateUpdate = new SqlParameter("@IsCutBActualStartDateUpdate", model.IsCutBActualStartDateUpdate);
            var @IsCutBBalanceUpdate         = new SqlParameter("@IsCutBBalanceUpdate", model.IsCutBBalanceUpdate);
            var @IsAutoCutUpdate             = new SqlParameter("@IsAutoCutUpdate", model.IsAutoCutUpdate);
            var @IsLaserCutUpdate            = new SqlParameter("@IsLaserCutUpdate", model.IsLaserCutUpdate);
            var @IsHuasenCutUpdate           = new SqlParameter("@IsHuasenCutUpdate", model.IsHuasenCutUpdate);

            var @IsCutBStartDateUpdate = new SqlParameter("@IsCutBStartDateUpdate", model.IsUpdateCutBStartDate);
            var @IsAtomCutAUpdate      = new SqlParameter("@IsAtomCutAUpdate", model.IsUpdateAtomCutA);
            var @IsAtomCutBUpdate      = new SqlParameter("@IsAtomCutBUpdate", model.IsUpdateAtomCutB);
            var @IsLaserCutAUpdate     = new SqlParameter("@IsLaserCutAUpdate", model.IsUpdateLaserCutA);
            var @IsLaserCutBUpdate     = new SqlParameter("@IsLaserCutBUpdate", model.IsUpdateLaserCutB);
            var @IsHuasenCutAUpdate    = new SqlParameter("@IsHuasenCutAUpdate", model.IsUpdateHuasenCutA);
            var @IsHuasenCutBUpdate    = new SqlParameter("@IsHuasenCutBUpdate", model.IsUpdateHuasenCutB);
            var @IsComelzCutAUpdate    = new SqlParameter("@IsComelzCutAUpdate", model.IsUpdateComelzCutA);
            var @IsComelzCutBUpdate    = new SqlParameter("@IsComelzCutBUpdate", model.IsUpdateComelzCutB);

            var @Reviser = new SqlParameter("@Reviser", account.FullName);

            var @SewingActualStartDate_Date  = new SqlParameter("@SewingActualStartDate_Date", model.SewingActualStartDate_Date);
            var @SewingActualFinishDate_Date = new SqlParameter("@SewingActualFinishDate_Date", model.SewingActualFinishDate_Date);

            var @CutAActualStartDate_Date  = new SqlParameter("@CutAActualStartDate_Date", model.CutAActualStartDate_Date);
            var @CutAActualFinishDate_Date = new SqlParameter("@CutAActualFinishDate_Date", model.CutAActualFinishDate_Date);


            using (var db = new SaovietMasterScheduleEntities())
            {
                db.CommandTimeout = 120;
                if (db.ExecuteStoreCommand(@"EXEC spm_InsertSewingMaster_10 @ProductNo, @Sequence, @SewingLine, @SewingStartDate, @SewingFinishDate, @SewingQuota, @SewingPrep, @SewingActualStartDate, @SewingActualFinishDate, @SewingActualStartDateAuto, @SewingActualFinishDateAuto, @SewingBalance, @CutAStartDate, @CutAFinishDate, @CutAQuota, @CutAActualStartDate, @CutAActualFinishDate, @CutABalance, @PrintingBalance, @H_FBalance, @EmbroideryBalance, @CutBActualStartDate, @CutBBalance, @AutoCut, @LaserCut, @HuasenCut, @CutBStartDate, @AtomCutA, @AtomCutB, @LaserCutA, @LaserCutB, @HuasenCutA, @HuasenCutB, @ComelzCutA, @ComelzCutB, @IsSequenceUpdate, @IsSewingLineUpdate, @IsSewingStartDateUpdate, @IsSewingFinishDateUpdate, @IsSewingQuotaUpdate, @IsSewingPrepUpdate, @IsSewingActualStartDateUpdate, @IsSewingActualFinishDateUpdate, @IsSewingActualStartDateAutoUpdate, @IsSewingActualFinishDateAutoUpdate, @IsSewingBalanceUpdate, @IsCutAStartDateUpdate, @IsCutAFinishDateUpdate, @IsCutAQuotaUpdate, @IsCutAActualStartDateUpdate, @IsCutAActualFinishDateUpdate, @IsCutABalanceUpdate, @IsPrintingBalanceUpdate, @IsH_FBalanceUpdate, @IsEmbroideryBalanceUpdate, @IsCutBActualStartDateUpdate, @IsCutBBalanceUpdate, @IsAutoCutUpdate, @IsLaserCutUpdate, @IsHuasenCutUpdate, @IsCutBStartDateUpdate, @IsAtomCutAUpdate, @IsAtomCutBUpdate, @IsLaserCutAUpdate, @IsLaserCutBUpdate, @IsHuasenCutAUpdate, @IsHuasenCutBUpdate, @IsComelzCutAUpdate, @IsComelzCutBUpdate, @Reviser, @SewingActualStartDate_Date, @SewingActualFinishDate_Date, @CutAActualStartDate_Date, @CutAActualFinishDate_Date",
                                           @ProductNo, @Sequence, @SewingLine, @SewingStartDate, @SewingFinishDate, @SewingQuota, @SewingPrep, @SewingActualStartDate, @SewingActualFinishDate, @SewingActualStartDateAuto, @SewingActualFinishDateAuto, @SewingBalance, @CutAStartDate, @CutAFinishDate, @CutAQuota, @CutAActualStartDate, @CutAActualFinishDate, @CutABalance, @PrintingBalance, @H_FBalance, @EmbroideryBalance, @CutBActualStartDate, @CutBBalance, @AutoCut, @LaserCut, @HuasenCut, @CutBStartDate, @AtomCutA, @AtomCutB, @LaserCutA, @LaserCutB, @HuasenCutA, @HuasenCutB, @ComelzCutA, @ComelzCutB, @IsSequenceUpdate, @IsSewingLineUpdate, @IsSewingStartDateUpdate, @IsSewingFinishDateUpdate, @IsSewingQuotaUpdate, @IsSewingPrepUpdate, @IsSewingActualStartDateUpdate, @IsSewingActualFinishDateUpdate, @IsSewingActualStartDateAutoUpdate, @IsSewingActualFinishDateAutoUpdate, @IsSewingBalanceUpdate, @IsCutAStartDateUpdate, @IsCutAFinishDateUpdate, @IsCutAQuotaUpdate, @IsCutAActualStartDateUpdate, @IsCutAActualFinishDateUpdate, @IsCutABalanceUpdate, @IsPrintingBalanceUpdate, @IsH_FBalanceUpdate, @IsEmbroideryBalanceUpdate, @IsCutBActualStartDateUpdate, @IsCutBBalanceUpdate, @IsAutoCutUpdate, @IsLaserCutUpdate, @IsHuasenCutUpdate, @IsCutBStartDateUpdate, @IsAtomCutAUpdate, @IsAtomCutBUpdate, @IsLaserCutAUpdate, @IsLaserCutBUpdate, @IsHuasenCutAUpdate, @IsHuasenCutBUpdate, @IsComelzCutAUpdate, @IsComelzCutBUpdate, @Reviser, @SewingActualStartDate_Date, @SewingActualFinishDate_Date, @CutAActualStartDate_Date, @CutAActualFinishDate_Date) > 0)
                {
                    return(true);
                }
                return(false);
            }
        }
 /// <summary>
 /// 初始化一个新的自定义菜单服务实例。
 /// </summary>
 /// <param name="accountModel">账号模型。</param>
 public CustomMenuService(AccountModel accountModel)
 {
     _accountModel = accountModel;
 }
 public NewAccountRegisterBalancePageViewModel(AccountModel accountModel, Mediator mediator)
 {
     GoToNextPage     = new RelayCommand <object>(arg => mediator.Invoke("OnGoToNextPage"));
     GoToPreviousPage = new RelayCommand <object>(arg => mediator.Invoke("OnGoToPreviousPage"));
     AccountModel     = accountModel;
 }
 /// <summary>
 /// Update the account with the specified account details.
 /// </summary>
 public void UpdateUserAccount(AccountModel account)
 {
     _accountManager.UpdateUserAccount(_userName, account, LatestValuationDate ?? DateTime.Today);
 }
Beispiel #31
0
 /// <summary>
 /// 初始化一个新的临时素材服务实例。
 /// </summary>
 /// <param name="accountModel">账号模型。</param>
 public TemporaryMaterialService(AccountModel accountModel)
 {
     _accountModel = accountModel;
 }
Beispiel #32
0
        public async Task <IActionResult> Create(AccountModel model, SysAccount account)
        {
            await _webMenu.SaveChangesAsync();

            return(View());
        }
Beispiel #33
0
        /// <summary>
        /// Performs ExpenseDB initialization
        /// </summary>
        /// <param name="context">ExpenseDbContext to initialize the db</param>
        internal static void InitializeDatabase(ExpenseDbContext context)
        {
            TruncateDB(context);

            context.Users.AddOrUpdate(new UserModel {
                Name = "Demo user", Email = "*****@*****.**"
            });

            Random random = new Random();

            var account = new AccountModel()
            {
                Name = "testerAccount"
            };

            context.Accounts.AddOrUpdate(account);

            var badge1 = new BadgeModel
            {
                Accounts    = new List <AccountBadgeModel>(),
                BadgeImgUri = "badge.png",
                Name        = "PassionatePennyPincher",
                Description = "Save >=20k $ within all completed plans"
            };

            context.Badges.AddOrUpdate(badge1);

            context.Badges.AddOrUpdate(new BadgeModel
            {
                Accounts    = new List <AccountBadgeModel>(),
                BadgeImgUri = "badge.png",
                Name        = "PlanCompleter",
                Description = "Complete at least 5 plans"
            });

            var accountBadge = new AccountBadgeModel()
            {
                Account  = account,
                Badge    = badge1,
                Achieved = DateTime.Now
            };

            context.AccountBadges.AddOrUpdate(accountBadge);

            var user = new UserModel()
            {
                AccessType = AccountAccessTypeModel.Full,
                Name       = "tester",
                Email      = "*****@*****.**",
                Account    = account
            };

            context.Users.AddOrUpdate(user);

            var user2 = new UserModel()
            {
                Name  = "tester2",
                Email = "*****@*****.**",
            };

            context.Users.AddOrUpdate(user2);

            var costType1 = new CostTypeModel()
            {
                Name    = "Strava",
                Account = account
            };

            var costType2 = new CostTypeModel()
            {
                Name    = "Zábava",
                Account = account
            };

            context.CostTypes.AddOrUpdate(costType1);
            context.CostTypes.AddOrUpdate(costType2);

            var cost1 = new CostInfoModel()
            {
                Account     = account,
                Created     = DateTime.Now,
                Description = "Fajný rohlík",
                IsIncome    = false,
                Periodicity = PeriodicityModel.None,
                Money       = 20,
                Type        = costType1
            };

            var cost2 = new CostInfoModel()
            {
                Account     = account,
                Created     = DateTime.Now,
                Description = "Chlebík",
                IsIncome    = false,
                Periodicity = PeriodicityModel.None,
                Money       = 50,
                Type        = costType1
            };

            var cost3 = new CostInfoModel()
            {
                Account     = account,
                Created     = DateTime.Now,
                Description = "Futsal",
                IsIncome    = false,
                Periodicity = PeriodicityModel.None,
                Money       = 100,
                Type        = costType2
            };

            var cost4 = new CostInfoModel()
            {
                Account     = account,
                Created     = DateTime.Now,
                Description = "Byt",
                IsIncome    = false,
                Periodicity = PeriodicityModel.Month,
                Money       = 200,
                Type        = costType1
            };

            var cost5 = new CostInfoModel()
            {
                Account     = account,
                Created     = DateTime.Now,
                Description = "Výplata",
                IsIncome    = true,
                Periodicity = PeriodicityModel.Day,
                Money       = 1000,
                Type        = costType1
            };

            var cost6 = new CostInfoModel()
            {
                Account     = account,
                Created     = DateTime.Now,
                Description = "Príjem",
                IsIncome    = true,
                Periodicity = PeriodicityModel.None,
                Money       = 2700,
                Type        = costType1
            };

            context.CostInfos.AddOrUpdate(cost1);
            context.CostInfos.AddOrUpdate(cost2);
            context.CostInfos.AddOrUpdate(cost3);
            context.CostInfos.AddOrUpdate(cost4);
            context.CostInfos.AddOrUpdate(cost5);
            context.CostInfos.AddOrUpdate(cost6);

            for (int i = 0; i < 30; i++)
            {
                var cost = new CostInfoModel()
                {
                    Account     = account,
                    Created     = DateTime.UtcNow.AddDays(-random.Next(0, 14)),
                    Description = "Seeded expense",
                    IsIncome    = false,
                    Periodicity = PeriodicityModel.None,
                    Money       = (decimal)(random.NextDouble() * 150),
                    Type        = costType1
                };
                context.CostInfos.Add(cost);
            }

            var plan1 = new PlanModel()
            {
                Account      = account,
                Start        = DateTime.ParseExact("22/11/2016", "dd/MM/yyyy", null),
                Deadline     = DateTime.ParseExact("24/12/2016", "dd/MM/yyyy", null),
                Description  = "Ušetriť na rohlík",
                IsCompleted  = false,
                PlannedMoney = 100,
                PlannedType  = costType1,
                PlanType     = PlanTypeModel.Save
            };

            var plan2 = new PlanModel()
            {
                Account      = account,
                Start        = DateTime.ParseExact("15/11/2016", "dd/MM/yyyy", null),
                Deadline     = DateTime.ParseExact("20/11/2016", "dd/MM/yyyy", null),
                Description  = "Ušetriť na Škodovku",
                IsCompleted  = false,
                PlannedMoney = 5200,
                PlannedType  = costType2,
                PlanType     = PlanTypeModel.Save
            };

            var plan3 = new PlanModel()
            {
                Account      = account,
                Start        = DateTime.ParseExact("22/11/2016", "dd/MM/yyyy", null),
                Deadline     = DateTime.ParseExact("24/12/2016", "dd/MM/yyyy", null),
                Description  = "Nemíňať na jedlo",
                IsCompleted  = false,
                PlannedMoney = 2000,
                PlannedType  = costType1,
                PlanType     = PlanTypeModel.MaxSpend
            };

            var plan4 = new PlanModel()
            {
                Account      = account,
                Start        = DateTime.ParseExact("11/10/2016", "dd/MM/yyyy", null),
                Deadline     = DateTime.ParseExact("15/10/2016", "dd/MM/yyyy", null),
                Description  = "Ušetrené na niečo",
                IsCompleted  = true,
                PlannedMoney = 2000,
                PlannedType  = costType1,
                PlanType     = PlanTypeModel.MaxSpend
            };

            var plan5 = new PlanModel()
            {
                Account      = account,
                Start        = DateTime.ParseExact("15/11/2016", "dd/MM/yyyy", null),
                Deadline     = DateTime.ParseExact("24/12/2016", "dd/MM/yyyy", null),
                Description  = "Ušetriť na Škodovku",
                IsCompleted  = false,
                PlannedMoney = 3200,
                PlannedType  = costType2,
                PlanType     = PlanTypeModel.Save
            };

            context.Plans.AddOrUpdate(plan1);
            context.Plans.AddOrUpdate(plan2);
            context.Plans.AddOrUpdate(plan3);
            context.Plans.AddOrUpdate(plan4);
            context.Plans.AddOrUpdate(plan5);

            context.CostTypes.AddOrUpdate(new CostTypeModel {
                CostInfoList = new List <CostInfoModel>(), Name = "Food", Account = account
            });

            context.SaveChanges();
        }
Beispiel #34
0
        public ActionResult Account(AccountModel model)
        {
            if (ModelState.IsValid)
            {
                ShopConfigInfo shopConfigInfo = BSPConfig.ShopConfig;

                shopConfigInfo.RegType = model.RegType == null ? "" : CommonHelper.IntArrayToString(model.RegType, "");
                shopConfigInfo.ReservedName = model.ReservedName ?? "";
                shopConfigInfo.RegTimeSpan = model.RegTimeSpan;
                shopConfigInfo.IsWebcomeMsg = model.IsWebcomeMsg;
                shopConfigInfo.WebcomeMsg = model.WebcomeMsg ?? "";
                shopConfigInfo.LoginType = model.LoginType == null ? "" : CommonHelper.IntArrayToString(model.LoginType, "");
                shopConfigInfo.ShadowName = model.ShadowName ?? "";
                shopConfigInfo.IsRemember = model.IsRemember;
                shopConfigInfo.LoginFailTimes = model.LoginFailTimes;

                BSPConfig.SaveShopConfig(shopConfigInfo);
                Emails.ResetShop();
                SMSes.ResetShop();
                AddAdminOperateLog("修改账号设置");
                return PromptView(Url.Action("account"), "修改账号设置成功");
            }
            return View(model);
        }
Beispiel #35
0
 /// <summary>
 /// 初始化一个新的群发服务实例。
 /// </summary>
 /// <param name="accountModel">账号模型。</param>
 public GroupMessageService(AccountModel accountModel)
 {
     _accountModel = accountModel;
 }
Beispiel #36
0
 public QrCodeService(AccountModel accountModel)
 {
     _accountModel = accountModel;
 }
Beispiel #37
0
 public SummaryPageViewModel(AccountModel accountModel, Mediator mediator)
 {
     Done             = new CloseWindowCommand();
     GoToPreviousPage = new RelayCommand <object>(arg => mediator.Invoke("OnGoToPreviousPage"));
     AccountModel     = accountModel;
 }
        public ActionResult Index(AccountModel objModel, string returnUrl)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    using (var db = new TestEntity())
                    {
                        Membership.ApplicationName = "/";
                        tblUserInformation objUserInfo = db.tblUserInformations.Where(x => x.aspnet_Users.UserName.ToLower().Equals(objModel.UserName.ToLower())).FirstOrDefault();
                        if (objUserInfo != null)
                        {
                            //if (objUserInfo.Status == 1)
                            //{
                            if (Membership.ValidateUser(objModel.UserName, objModel.Password))
                            {
                                string VisitorsIPAddr = string.Empty;
                                if (Request.UserHostAddress.Length != 0)
                                {
                                    VisitorsIPAddr = Request.UserHostAddress;
                                }

                                //tbllastlogin objLastLogin = new tbllastlogin();
                                //objLastLogin.idUser = objUserInfo.id;
                                //objLastLogin.IpAddress = VisitorsIPAddr;
                                //objLastLogin.DateTimeStamp = DateTime.Now;
                                //db.tbllastlogins.Add(objLastLogin);
                                //db.SaveChanges(User.Identity.Name);

                                FormsAuthentication.RedirectFromLoginPage(objModel.UserName, objModel.RememberMe);
                                FormsAuthentication.SetAuthCookie(objModel.UserName, objModel.RememberMe);
                                if (Session["Username"] == null)
                                {
                                    Session["Username"] = objUserInfo.FirstName + " " + objUserInfo.LastName;
                                    string host = HttpContext.Request.Url.Host;
                                }
                                if (objModel.RememberMe == true)
                                {
                                    HttpCookie cookie = new HttpCookie("YourAppLogin");
                                    cookie.Values.Add("LoginName", objModel.UserName);
                                    cookie.Expires = DateTime.Now.AddMinutes(1440);
                                    //cookie.Expires = DateTime.Now.AddMinutes(15);
                                    Response.Cookies.Add(cookie);
                                }
                                else
                                {
                                    HttpCookie cookie = new HttpCookie("YourAppLogin");
                                    cookie.Values.Add("LoginName", null);
                                    cookie.Expires = DateTime.Now.AddDays(0);
                                    Response.Cookies.Add(cookie);
                                }

                                if (returnUrl == null || returnUrl == "")
                                {
                                    return RedirectToAction("Index", "Home");
                                }
                                else
                                {
                                    return Redirect(returnUrl);
                                }
                            }
                            else
                            {
                                ViewData["error"] = 1;
                                ViewData["message"] = "Invalid User Name or password";
                            }
                        }
                        else
                        {
                            ViewData["error"] = 1;
                            ViewData["message"] = "Invalid User Name or password";
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ViewData["error"] = 1;
                ViewData["message"] = ex.Message.ToString();
            }
            return View();
        }
Beispiel #39
0
 public void AddHttpAuthenticationHeaders(AccountModel account)
 {
     client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", account.Credentials);
 }
 /// <summary>
 /// 初始化一个新的群发服务实例。
 /// </summary>
 /// <param name="accountModel">账号模型。</param>
 public GroupMessageService(AccountModel accountModel)
 {
     _accountModel = accountModel;
 }
 /// <summary>
 /// 初始化一个新的永久素材服务实例。
 /// </summary>
 /// <param name="accountModel">账号模型。</param>
 public ForeverMaterialService(AccountModel accountModel)
 {
     _accountModel = accountModel;
 }
Beispiel #42
0
 private void notifyNewUser()
 {
     AccountModel.SendNewUserEmail(user.Username);
 }
 /// <summary>
 /// 初始化一个新的模板消息服务实例。
 /// </summary>
 /// <param name="accountModel">账号模型。</param>
 public TemplateMessageService(AccountModel accountModel)
 {
     _accountModel = accountModel;
 }
        public void updatePassword(int idUsuario, string ContrasenaNueva)
        {
            AccountModel acc = new AccountModel();

            acc.updatePassword(idUsuario, ContrasenaNueva);
        }
        public async Task <ActionResult> CreateAccounts(AccountModel account)
        {
            await userService.CreateAccount(account);

            return(Created("Created", account.Points));
        }
Beispiel #46
0
 public UserService(AccountModel accountModel)
 {
     _accountModel = accountModel;
 }
Beispiel #47
0
 /// <summary>
 /// 初始化一个新的授权服务实例。
 /// </summary>
 /// <param name="accountModel">账号模型。</param>
 /// <param name="openAccountModel">开放平台账号模型。</param>
 public OAuthService(AccountModel accountModel, Open.Api.AccountModel openAccountModel)
 {
     _accountModel = accountModel;
     _openAccountModel = openAccountModel;
 }
 /// <summary>
 /// 初始化一个新的客服消息服务实例。
 /// </summary>
 /// <param name="accountModel">账号模型。</param>
 public CustomServiceMessageService(AccountModel accountModel)
 {
     _accountModel = accountModel;
 }
Beispiel #49
0
        public bool Post(AccountModel accountModel)
        {
            var check = _account.Register(accountModel);

            return(check);
        }
Beispiel #50
0
 /// <summary>
 /// 初始化一个卡券服务。
 /// </summary>
 /// <param name="accountModel">账号模型。</param>
 public CardService(AccountModel accountModel)
 {
     _accountModel = accountModel;
 }
Beispiel #51
0
 /// <summary>
 /// 初始化一个新的多客服会话服务实例。
 /// </summary>
 /// <param name="accountModel">账号模型。</param>
 public CustomServiceSessionService(AccountModel accountModel)
 {
     _accountModel = accountModel;
 }
Beispiel #52
0
 public StoreService(AccountModel accountModel)
 {
     _accountModel = accountModel;
 }
Beispiel #53
0
 public AccountModel UpdateAccount(AccountModel account)
 {
     throw new System.NotImplementedException();
 }
Beispiel #54
0
 public SignInModels(AccountModel account, TrainerModel trainer)
 {
     Account = account;
     Trainer = trainer;
 }
 public AccountExpItemVM(AccountModel model, MainVM main) : base(main)
 {
     IsBroken = false;
     _model   = model;
     this.Children.Add(new DummyExpItemVM(main));
     this.ContextMenuItems.Add(new MenuItemVM()
     {
         Caption = "Refresh",
         Command = new LambdaCommand(async(o) =>
         {
             await this.LoadDatabases();
         })
     });
     this.ContextMenuItems.Add(new MenuItemVM()
     {
         Caption = "Create database",
         Command = new LambdaCommand(async(o) =>
         {
             if (IsBroken)
             {
                 MessageBox.Show("Can't create database on a broken connect, check error message, try to reenter credentials.");
                 return;
             }
             var dlg = new NameSelector("New database name");
             if (dlg.ShowDialog() == true && dlg.Value.IsNotEmpty())
             {
                 var created = await _model.CreateDatabase(dlg.Value);
                 this.Children.Insert(0, new DatabaseExpItemVM(this, created, this.Main));
             }
         })
     });
     this.ContextMenuItems.Add(new MenuItemVM()
     {
         Caption = "Change access data",
         Command = new LambdaCommand((o) =>
         {
             var oldEndpoint = _model.Endpoint;
             DocDbAccountCredentialsDlg.ShowDialog(_model.Credentials, async(creds) =>
             {
                 await performWithIsBrokenTest(async() =>
                 {
                     this.Children.Clear();
                     await _model.RefreshCredentials();
                     foreach (var db in this._model.Databases)
                     {
                         this.Children.Add(new DatabaseExpItemVM(this, db, this.Main));
                     }
                     Config.Instance.ChangeAccountCredentials(oldEndpoint, _model.Credentials);
                 });
             });
         })
     });
     this.ContextMenuItems.Add(new MenuItemVM()
     {
         Caption = "Remove",
         Command = new LambdaCommand((o) =>
         {
             MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show("Are you sure?", "Removal Confirmation", System.Windows.MessageBoxButton.YesNo);
             if (messageBoxResult == MessageBoxResult.Yes)
             {
                 main.Explorer.RootItems.Remove(this);
                 Config.Instance.RemoveAccount(_model.Endpoint);
             }
         })
     });
 }
 public object Put(AccountModel todo)
 {
     return "success";
 }
Beispiel #57
0
 /// <summary>
 /// 初始化一个新的授权服务实例。
 /// </summary>
 /// <param name="accountModel">账号模型。</param>
 public OAuthService(AccountModel accountModel)
     : this(accountModel, null)
 {
 }