Ejemplo n.º 1
0
        public ActionResult ManagerMainSiteAdd()
        {
            IList <BaseDictionary> baseDictionaries = BaseService.GetBaseDictionaries(ValueTypeEnum.Language);

            ViewBag.CommonManagers = ManageService.GetMainManagerTypeManagers(ManagerTypeEnum.Common);
            return(View(baseDictionaries));
        }
Ejemplo n.º 2
0
        public ActionResult UnReadTranslationList()
        {
            int pageIndex = 1;
            int pageSize  = 10;

            if (!string.IsNullOrEmpty(Request["pageIndex"]))
            {
                int.TryParse(Request["pageIndex"].ToString(), out pageIndex);
            }
            if (!string.IsNullOrEmpty(Request["pageSize"]))
            {
                int.TryParse(Request["pageSize"].ToString(), out pageSize);
            }
            long intentionId = 0;

            if (!string.IsNullOrEmpty(Request["intentionId"]))
            {
                long.TryParse(Request["intentionId"].ToString(), out intentionId);
            }
            ViewBag.IntentionId    = intentionId;
            ViewBag.Intentions     = BaseService.GetIntentions(CurrentManager.ParentId != 0 ? CurrentManager.ParentId : CurrentManager.Id);
            ViewBag.CurrentManager = CurrentManager;
            ViewBag.ChildManagers  = ManageService.GetChildManagers(CurrentManager.Id);
            return
                (View(TranslationService.GetEmailTranslations(CurrentManager.ManagerType, EmailStatusEnum.UnRead,
                                                              Utils.CoreDefaultValue.False,
                                                              CurrentManager.Id, intentionId, pageIndex, pageSize)));
        }
Ejemplo n.º 3
0
        public ActionResult ManagerProductList()
        {
            long mainSiteId = 0;

            if (!string.IsNullOrEmpty(Request["mainSiteId"]))
            {
                long.TryParse(Request["mainSiteId"].ToString(), out mainSiteId);
            }
            if (mainSiteId == 0)
            {
                return(null);
            }
            ViewBag.managerMainSiteId = mainSiteId;
            int pageIndex = 1;
            int pageSize  = 10;

            if (!string.IsNullOrEmpty(Request["pageIndex"]))
            {
                int.TryParse(Request["pageIndex"].ToString(), out pageIndex);
            }
            if (!string.IsNullOrEmpty(Request["pageSize"]))
            {
                int.TryParse(Request["pageSize"].ToString(), out pageSize);
            }
            PageModel <ManagerProduct> managerProducts = ManageService.GetManagerProducts(mainSiteId, pageIndex, pageSize);

            return(View(managerProducts));
        }
Ejemplo n.º 4
0
        public ActionResult ManagerEdit(long id, string userName, string realName,
                                        string company, int language, ManagerTypeEnum managerType, string bindEmail)
        {
            short isAutoDistribute = Utils.CoreDefaultValue.False;

            if (!string.IsNullOrEmpty(Request["isAutoDistribute"]))
            {
                isAutoDistribute = Utils.CoreDefaultValue.True;
            }
            string  responseCode = ResponseCode.NotFoundData;
            Manager manager      = ManageService.GetManagerById(id);

            if (manager != null)
            {
                manager.UserName         = userName;
                manager.RealName         = realName;
                manager.Company          = company;
                manager.Language         = language;
                manager.IsAutoDistribute = isAutoDistribute;
                manager.ManagerType      = managerType;
                manager.EncryptPassword();
                manager.BindEmail = bindEmail;
                responseCode      = ManageService.Save(CurrentManager, manager);
            }
            return(Json(InfoTools.GetMsgInfo(responseCode), JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 5
0
        public HttpResponseMessage CheckLogin(LoginQuery query)
        {
            var           returnObj = new ResultObject <List <string> >();
            List <string> retList   = new List <string>();

            //检验验证码正确与否
            string valiad_right = HttpContext.Current.Session["code"] as string;

            if (string.Compare(query.valiad, valiad_right) == 0)
            {
                //检验用户名正确与否
                Manager manager = null;
                string  result  = ManageService.Login(query.username, query.userpwd, out manager);
                if (result == ResponseCode.Ok)//正确
                {
                    //设置验证成功,保存用户名到session中
                    HttpContext.Current.Session["LoginAccount"] = query.username;
                    returnObj.Status = ServerStatus.Success;
                }
                else
                {
                    returnObj.Status = ServerStatus.SearchFailed;
                }
            }
            else
            {
                returnObj.Status = ServerStatus.SearchFailed;
            }


            returnObj.ReturnData = retList;

            return(Request.CreateResponse <ResultObject <List <string> > >(HttpStatusCode.OK, returnObj));
        }
Ejemplo n.º 6
0
        public ActionResult LogOn(LogOnModel model, string returnUrl)
        {
            if (ModelState.IsValid)
            {
                if (ManageService.UserService().IsValidateUser(model.UserName, model.Password))
                {
                    FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
                    if (Url.IsLocalUrl(returnUrl) && returnUrl.Length > 1 && returnUrl.StartsWith("/") &&
                        !returnUrl.StartsWith("//") && !returnUrl.StartsWith("/\\"))
                    {
                        return(Redirect(returnUrl));
                    }
                    else
                    {
                        return(RedirectToAction("Index", "Home"));
                    }
                }
                else
                {
                    ModelState.AddModelError("", "提供的用户名或密码不正确。");
                }
            }

            // 如果我们进行到这一步时某个地方出错,则重新显示表单
            return(View(model));
        }
Ejemplo n.º 7
0
        public ActionResult ResetPassword(long id)
        {
            string ipString = GetIP();

            ManageService.ResetPassword(id, CurrentManager, ipString);
            return(Json(InfoTools.GetMsgInfo(ResponseCode.Ok), JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 8
0
        public ActionResult Register(RegisterModel model)
        {
            if (ModelState.IsValid)
            {
                // 尝试注册用户
                int createStatus = ManageService.UserService().CreatUser(model.UserName, model.Password, model.Email, null);
                if (createStatus == 0)
                {
                    UtilEmail.SendMail(
                        model.Email,
                        Resources.Subject,
                        "您收到此邮件是因为您是Betterlife.Net网站的会员。我们很高兴地通知您,您现在已经可以观看新的管理博客了。<br/><br/>",
                        true);
                    FormsAuthentication.SetAuthCookie(model.UserName, false /* createPersistentCookie */);
                    return(RedirectToAction("Index", "Home"));
                }
                else
                {
                    ModelState.AddModelError("", ErrorCodeToString(createStatus));
                }
            }

            // 如果我们进行到这一步时某个地方出错,则重新显示表单
            return(View(model));
        }
Ejemplo n.º 9
0
        public HttpResponseMessage GetCompanyInfo(string LoginAccount, string Language)
        {
            var returnObj = new Business.WebApi.Models.ResultObject <Business.WebApi.Models.CompanyAndSummaryInfo>();

            Business.WebApi.Models.CompanyAndSummaryInfo model = new Models.CompanyAndSummaryInfo();

            //取用户登录成功后保存的session
            Business.Core.Manager manager = null;
            manager = ManageService.GetManagerByUsername(LoginAccount);
            if (manager.ParentId != 0)
            {
                manager = ManageService.GetManagerById(manager.ParentId);
            }

            if (manager != null)
            {
                model.CompanyName  = manager.Company;//公司名
                model.PeopleNum    = VisitRecordService.GetIpCount(Language, manager.UserName);
                model.ProductCount = VisitRecordService.GetVisitRecordCount(Language, manager.UserName);
            }

            returnObj.ReturnData = model;
            returnObj.Status     = Business.WebApi.Models.ServerStatus.SearchSuccess;
            return(Request.CreateResponse <Business.WebApi.Models.ResultObject <Business.WebApi.Models.CompanyAndSummaryInfo> >(HttpStatusCode.OK, returnObj));
        }
 protected override void InternalProcessRecord()
 {
     TaskLogger.LogEnter();
     if (base.FirewallRule != null)
     {
         TaskLogger.Trace("Removing Windows Firewall Rule: {0}", new object[]
         {
             base.FirewallRule.Name
         });
         base.FirewallRule.Remove();
     }
     else if (!string.IsNullOrEmpty(base.Name) && base.BinaryPath != null)
     {
         TaskLogger.Trace("Removing binary {0} from windows firewall exception", new object[]
         {
             base.Name
         });
         ManageService.RemoveAssemblyFromFirewallExceptions(base.Name, base.BinaryPath.PathName, new Task.TaskErrorLoggingDelegate(base.WriteError));
     }
     else
     {
         TaskLogger.Trace("ERROR: No Firewall Rule/Exception specified!", new object[0]);
     }
     TaskLogger.LogExit();
 }
Ejemplo n.º 11
0
        public HttpResponseMessage GetLanguageTypeList(string LoginAccount)
        {
            var           returnObj = new Business.WebApi.Models.ResultObject <List <string> >();
            List <string> retList   = new List <string>();

            //取用户登录成功后保存的session
            string emailAccount = LoginAccount;

            Business.Core.Manager manager = null;
            manager = ManageService.GetManagerByUsername(emailAccount);

            if (manager.ParentId != 0)
            {
                manager = ManageService.GetManagerById(manager.ParentId);
            }

            if (manager != null)
            {
                List <Business.Core.ManagerMainSite> mangerMainSiteList = ManagerMainSiteService.GetManagerMainSitesByManagerId(manager.Id);
                foreach (var tmp in mangerMainSiteList)
                {
                    retList.Add(tmp.LanguageName);
                }
            }

            returnObj.ReturnData = retList;
            returnObj.Status     = Business.WebApi.Models.ServerStatus.SearchSuccess;
            return(Request.CreateResponse <Business.WebApi.Models.ResultObject <List <string> > >(HttpStatusCode.OK, returnObj));
        }
Ejemplo n.º 12
0
        public HttpResponseMessage GetInfoListByIp(Business.Core.VisitRecord.AnalysisSiteQuery query)
        {
            /*****根据客户的邮箱账号,网站语言,和输入查询的ip来查询出访问信息*****/
            //取用户登录成功后保存的session
            string emailAccount = query.LoginAccount;
            //获取传过来的的网站语言
            string language = query.Language;

            Business.Core.VisitRecord.WebSiteAnalysisQuery anaysisQuery = new Core.VisitRecord.WebSiteAnalysisQuery();
            anaysisQuery.IsPager      = query.IsPager;
            anaysisQuery.Language     = query.Language;
            anaysisQuery.OrderByDesc  = query.OrderByDesc;
            anaysisQuery.OrderByValue = query.OrderByValue;
            anaysisQuery.PageIndex    = query.PageIndex;
            anaysisQuery.PageSize     = query.PageSize;
            anaysisQuery.VIp          = query.VIp;
            Business.Core.Manager manager = null;
            manager = ManageService.GetManagerByUsername(emailAccount);

            if (manager.ParentId != 0)
            {
                manager = ManageService.GetManagerById(manager.ParentId);
            }

            var returnObj   = new Business.WebApi.Models.ResultObject <List <Business.Core.VisitRecord.WebSiteAnalysisInfo> >();
            int recordcount = 0;

            returnObj.ReturnData  = VisitRecordService.GetVisitRecordList(anaysisQuery, manager.UserName, out recordcount);
            returnObj.RecordCount = recordcount;
            returnObj.Status      = Business.WebApi.Models.ServerStatus.Success;
            return(Request.CreateResponse <Business.WebApi.Models.ResultObject <List <Business.Core.VisitRecord.WebSiteAnalysisInfo> > >(HttpStatusCode.OK, returnObj));
        }
Ejemplo n.º 13
0
        public ActionResult ManagerProductEdit(long managerproductId, long mainSiteId, string productUrl,
                                               string productName, string productDescription)
        {
            string result = ManageService.ManagerProductUpdate(managerproductId, mainSiteId, productUrl, productName,
                                                               productDescription, CurrentManager.RealName);

            return(Json(InfoTools.GetMsgInfo(result), JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 14
0
        public ActionResult ManagerMainSiteEdit(long id)
        {
            ViewBag.BaseDictionaries = BaseService.GetBaseDictionaries(ValueTypeEnum.Language);
            ViewBag.CommonManagers   = ManageService.GetMainManagerTypeManagers(ManagerTypeEnum.Common);
            ManagerMainSite managerMainSite = ManageService.GetManagerMainSiteById(id);

            return(View(managerMainSite));
        }
Ejemplo n.º 15
0
 public ViewContext(IViewStrategy strategy, Form form, ManageService manageService)
 {
     _strategy       = strategy;
     _form           = form;
     _manageService  = manageService;
     allFormElements = new List <IDisposable>();
     MakeView(_form, allFormElements);
 }
Ejemplo n.º 16
0
 public delegateController(IManageRepository _manageRepository, IBomRepository _bomrepository, IPurchaseRepository _bomRepository, IStockInRepository _stockinrepository, IStockOutRepository _stockoutrepository)
 {
     manageService   = new ManageService(_manageRepository);
     bomService      = new BomService(_bomrepository);
     stockoutService = new StockOutService(_stockoutrepository);
     stockinService  = new StockInService(_stockinrepository);
     purchaseService = new PurchaseService(_bomRepository);
 }
Ejemplo n.º 17
0
        private void FormSettings()
        {
            Size          = new Size(width, height);
            manageService = new ManageService();
            counterCheck  = new bool[6];

            vc = new ViewContext(new ViewStartInput(), this, manageService);
        }
Ejemplo n.º 18
0
        public ActionResult CommonManagerMainSiteList()
        {
            IList <ManagerMainSite> managerMainSites =
                ManageService.GetManagerMainSitesByManagerId(CurrentManager.ParentId == 0
                    ? CurrentManager.Id
                    : CurrentManager.ParentId);

            return(View(managerMainSites));
        }
Ejemplo n.º 19
0
 public mainController(IAccountRepository _accountRepository, IManageRepository _manageRepository, IPurchaseRepository _purchaseRepository, IStockInRepository _stockinrepository, IStockOutRepository _stockoutrepository, IBomRepository _bomrepository)
 {
     accountService  = new AccountService(_accountRepository);
     purchaseService = new PurchaseService(_purchaseRepository);
     stockinService  = new StockInService(_stockinrepository);
     stockoutService = new StockOutService(_stockoutrepository);
     manageService   = new ManageService(_manageRepository);
     bomService      = new BomService(_bomrepository);
 }
Ejemplo n.º 20
0
        public ActionResult ChangePassword(string oldPassword, string newPassword, string confirmPassword)
        {
            string ipString     = GetIP();
            string responseCode = ManageService.ChangePassword(CurrentManager, oldPassword, newPassword, confirmPassword, ipString);

            CurrentManager.Password = string.Empty;
            CookieHelper.SaveManagerCookie(CurrentManager);
            return(Json(InfoTools.GetMsgInfo(responseCode)));
        }
Ejemplo n.º 21
0
 public IdiomsSolitaireCacheDeal(IdiomsService idiomsService, IDatabase database, BillFlowService billFlowService
                                 , MemberInfoService memberInfoService, GroupActivityService activityLogService, ManageService manageService)
 {
     IdiomsService      = idiomsService;
     this._database     = database;
     BillFlowService    = billFlowService;
     MemberInfoService  = memberInfoService;
     ActivityLogService = activityLogService;
     ManageService      = manageService;
 }
Ejemplo n.º 22
0
        public ActionResult ManagerProductEdit(long id)
        {
            ManagerProduct managerProduct = ManageService.GetManagerProductById(id);

            ViewBag.ManagerMainSite = null;
            if (managerProduct != null)
            {
                ManagerMainSite managerMainSite = ManageService.GetManagerMainSiteById(managerProduct.ManagerMainSiteId);
                ViewBag.ManagerMainSite = managerMainSite;
            }
            return(View(managerProduct));
        }
Ejemplo n.º 23
0
        public ActionResult Login(string userName, string password, bool remember)
        {
            Manager manager = null;
            string  result  = ManageService.Login(userName, password, out manager);

            if (result == ResponseCode.Ok)
            {
                ManageService.SaveLoginRecord(LoginRecordFactory.Create(userName, GetIp()));
                CookieHelper.SaveManagerCookie(manager, remember);
            }
            return(Json(InfoTools.GetMsgInfo(result)));
        }
Ejemplo n.º 24
0
        public ActionResult HasReadEnquiryList()
        {
            int pageIndex = 1;
            int pageSize  = 10;

            if (!string.IsNullOrEmpty(Request["pageIndex"]))
            {
                int.TryParse(Request["pageIndex"].ToString(), out pageIndex);
            }
            if (!string.IsNullOrEmpty(Request["pageSize"]))
            {
                int.TryParse(Request["pageSize"].ToString(), out pageSize);
            }
            long intentionId = 0;

            if (!string.IsNullOrEmpty(Request["intentionId"]))
            {
                long.TryParse(Request["intentionId"].ToString(), out intentionId);
            }
            long languageId = 0;

            if (!string.IsNullOrEmpty(Request["languageId"]))
            {
                long.TryParse(Request["languageId"].ToString(), out languageId);
            }
            long userDefinedId = 0;

            if (!string.IsNullOrEmpty(Request["userDefinedId"]))
            {
                long.TryParse(Request["userDefinedId"].ToString(), out userDefinedId);
            }
            string email = string.Empty;

            if (!string.IsNullOrEmpty(Request["email"]))
            {
                email = Request["email"];
            }
            PageModel <Enquiry> pageModel = EnquiryService.GetEnquiryPages(email, CurrentManager.Id, languageId, intentionId, userDefinedId,
                                                                           HandlerStatusEnum.HasRead, pageIndex, pageSize);

            ViewBag.CurrentManager = CurrentManager;
            ViewBag.Intentions     = BaseService.GetIntentions(CurrentManager.ParentId != 0 ? CurrentManager.ParentId : CurrentManager.Id);
            ViewBag.UserDefineds   = BaseService.GetUserDefineds(CurrentManager.ParentId != 0 ? CurrentManager.ParentId : CurrentManager.Id);
            ViewBag.ChildManagers  = ManageService.GetChildManagers(CurrentManager.Id);
            ViewBag.Languages      = BaseService.GetBaseDictionaries(ValueTypeEnum.Language);

            ViewBag.CurrentIntentionId   = intentionId;
            ViewBag.CurrentUserdefinedId = userDefinedId;
            ViewBag.CurrentLanguageId    = languageId;
            ViewBag.CurrentEmail         = email;
            return(View(pageModel));
        }
Ejemplo n.º 25
0
        public ActionResult ChangeEmail(ChangeEmailViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var service = new ManageService();

            service.ChangeEmail(User.Identity.GetUserId(), model.newEmail);

            return(RedirectToAction("Index", new { Message = ManageMessageId.ChangeEmailSuccess }));
        }
Ejemplo n.º 26
0
        public ActionResult ManagerEdit(long id)
        {
            PageManager pageManager = new PageManager();

            pageManager.BaseDictionaries = BaseService.GetBaseDictionaries(ValueTypeEnum.Language);
            pageManager.ManagerTypes     = EnumTools.GetEnumDescriptions <ManagerTypeEnum>();
            pageManager.ManagerBase      = ManageService.GetManagerById(id);
            if (CurrentManager.ManagerType == ManagerTypeEnum.Common)
            {
                pageManager.ManagerTypes.Remove(ManagerTypeEnum.Super);
            }
            return(View(pageManager));
        }
Ejemplo n.º 27
0
        public ActionResult ManagerMainSiteAdd(string siteName, long language, string siteUrl, long managerId)
        {
            Manager        manager        = ManageService.GetManagerById(managerId);
            BaseDictionary baseDictionary = BaseService.GetDictionaryById(language);

            if (manager != null && baseDictionary != null)
            {
                ManagerMainSite managerMainSite = ManagerMainSiteFactory.Create(manager.Id, manager.RealName, siteName,
                                                                                siteUrl, baseDictionary.Id, baseDictionary.Value, CurrentManager.RealName);
                string result = ManageService.MainSiteSave(managerMainSite);
                return(Json(InfoTools.GetMsgInfo(result)));
            }
            return(Json(InfoTools.GetMsgInfo(ResponseCode.Ok)));
        }
Ejemplo n.º 28
0
        protected void grdExternalPlatform_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "enable")
            {
                ManageService.UpdateStatus((Common.Enums.PlatformType) int.Parse(e.CommandArgument.ToString()), true, this.CurrentUser.UserName);
                Page.ClientScript.RegisterClientScriptBlock(GetType(), "success", "alert('启用成功');", true);
            }
            if (e.CommandName == "disable")
            {
                ManageService.UpdateStatus((Common.Enums.PlatformType) int.Parse(e.CommandArgument.ToString()), false, this.CurrentUser.UserName);
                Page.ClientScript.RegisterClientScriptBlock(GetType(), "success", "alert('禁用成功');", true);
            }

            bindDataSource();
        }
Ejemplo n.º 29
0
 private void bindDataSource()
 {
     this.grdExternalPlatform.DataSource = from item in ManageService.QuerySettings()
                                           select new
     {
         Platform         = item.Platform.GetDescription(),
         PlatformValue    = (byte)item.Platform,
         Enabled          = item.Enabled ? "启用" : "禁用",
         Deduct           = (item.Deduct * 100).TrimInvaidZero(),
         PayInterfaceText = item.StrPayInterface,
         RebateBalance    = (item.RebateBalance * 100).TrimInvaidZero(),
         ProviderAccount  = item.ProviderAccount
     };
     this.grdExternalPlatform.DataBind();
 }
Ejemplo n.º 30
0
        public ActionResult PwdChangedRecordList()
        {
            int pageIndex = 1;
            int pageSize  = 50;

            if (!string.IsNullOrEmpty(Request["pageIndex"]))
            {
                int.TryParse(Request["pageIndex"].ToString(), out pageIndex);
            }
            if (!string.IsNullOrEmpty(Request["pageSize"]))
            {
                int.TryParse(Request["pageSize"].ToString(), out pageSize);
            }
            return(View(ManageService.GetPwdChangeRecords(CurrentManager.Id, pageIndex, pageSize)));
        }
 private void Stop_Service_Click(object sender, RoutedEventArgs e)
 {
     ManageService ms = new ManageService();
     string serviceName = ms.GetServiceName(servicesHost);
     ms.StopService(serviceName);
 }
 private void UnInstal_Service_Click(object sender, RoutedEventArgs e)
 {
     ManageService ms = new ManageService();
     ms.UnInstallService(servicesHost);
 }