Ejemplo n.º 1
0
 public static void Save(ManagerInfo teamInfo)
 {
     BinaryFormatter bf = new BinaryFormatter();
     FileStream file = File.Open(BasicMechanics.SaveFile, FileMode.OpenOrCreate);
     bf.Serialize(file, teamInfo);
     file.Close();
 }
Ejemplo n.º 2
0
 public void Apply(TimeAndMaterialJobOrderRegisteredEvent evt)
 {
     Id = evt.JobOrderId;
     Customer = new CustomerInfo(evt.CustomerId, evt.CustomerName);
     Manager = new ManagerInfo(evt.ManagerId, evt.ManagerName);
     Value = new PositiveMoney(evt.Value, evt.Currency);
     DateOfStart = evt.DateOfStart;
     DateOfExpiration = evt.DateOfExpiration;
     Name = evt.JobOrderName;
     Number = evt.JobOrderNumber; 
     IsCompleted = false;
     PurchaseOrderNumber = evt.PurchaseOrderNumber;
     Description = evt.Description;
 }
Ejemplo n.º 3
0
 public void Apply(FixedPriceJobOrderRegisteredEvent evt)
 {
     Id = evt.JobOrderId;
     Customer = new CustomerInfo(evt.CustomerId, evt.CustomerName);
     Manager = new ManagerInfo(evt.ManagerId, evt.ManagerName);
     Price = new PositiveMoney(evt.Price, evt.Currency);
     DateOfStart= evt.DateOfStart;
     DueDate=evt.DueDate;
     Name = evt.JobOrderName;
     Number = evt.JobOrderNumber; 
     IsCompleted = false;
     PurchaseOrderNumber = evt.PurchaseOrderNumber;
     Description = evt.Description;
 }
Ejemplo n.º 4
0
    public void LoadManager()
    {
        ManagerInfo info = BasicMechanics.Load();
        Debug.Log("Loading save file: " + BasicMechanics.SaveFile);

        if (info != null)
        {
            this.manager = new Manager(info);
        }
        else
        {
            // alert saying save file not found, maybe create new manager.
            info = new ManagerInfo(true);
            this.manager = new Manager(info);
        }
    }
Ejemplo n.º 5
0
        public Manager(ManagerInfo info)
        {
            this.Info = info;

            if (Info.TeamsInfo != null)
            {
                Teams = Info.TeamsInfo.ConvertAll<FighterTeam>((teamInfo) => {
                    return new FighterTeam(teamInfo);
                });
            }

            if (Info.BenchedFightersInfo != null)
            {
                BenchedFighters = Info.BenchedFightersInfo.ConvertAll((fighterInfo) => {
                    return new Fighter(fighterInfo);
                });
            }
        }
Ejemplo n.º 6
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            siteid = Globals.RequestQueryNum("siteid");
            if (!this.Page.IsPostBack)
            {
                //如果当前用户已经申请过后台管理员账号,则不允许再次申请,弹出提示关闭页面
                ManagerInfo existManager = ManagerHelper.GetSiteManager(siteid);
                if (existManager != null)
                {
                    this.ShowMsg("您已在" + existManager.CreateDate.ToShortDateString() + "添加了" + existManager.UserName + "管理员,请勿重复提交!", false);
                    return;
                }

                this.dropRole.DataBind();
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                if (dropRole.Items.FindByText(masterSettings.SiteManagerRoleName) != null)
                {
                    dropRole.Items.FindByText(masterSettings.SiteManagerRoleName).Selected = true;
                }
                dropRole.Enabled = false;
            }
        }
Ejemplo n.º 7
0
        public LoginState Login(string name, string pwd, out int type)
        {
            type = -1;
            ManagerInfo mi = miDal.GetByName(name);

            if (mi == null)
            {
                return(LoginState.NameError);
            }
            else
            {
                if (mi.MPwd.Equals(Md5Helper.EncryptString(pwd)))
                {
                    type = mi.MType;
                    return(LoginState.ok);
                }
                else
                {
                    return(LoginState.PwdError);
                }
            }
        }
Ejemplo n.º 8
0
 private void btnCreate_Click(object sender, EventArgs e)
 {
     if (string.Compare(this.txtPassword.Text, this.txtPasswordagain.Text) != 0)
     {
         this.ShowMsg("请确保两次输入的密码相同", false);
     }
     else
     {
         ManagerInfo manager = new ManagerInfo {
             RoleId   = this.dropRole.SelectedValue,
             UserName = this.txtUserName.Text.Trim(),
             Email    = this.txtEmail.Text.Trim(),
             Password = HiCryptographer.Md5Encrypt(this.txtPassword.Text.Trim())
         };
         if (ManagerHelper.Create(manager))
         {
             this.txtEmail.Text    = string.Empty;
             this.txtUserName.Text = string.Empty;
             this.ShowMsg("成功添加了一个管理员", true);
         }
     }
 }
Ejemplo n.º 9
0
 private void btnEditProfile_Click(object sender, System.EventArgs e)
 {
     if (this.Page.IsValid)
     {
         ManagerInfo manager = ManagerHelper.GetManager(this.userId);
         manager.Email = this.txtprivateEmail.Text;
         if (this.ValidationManageEamilr(manager))
         {
             manager.RoleId    = this.dropRole.SelectedValue;
             manager.AgentName = this.txtAgentName.Text.Trim();
             manager.State     = Convert.ToInt32(this.DDLState.SelectedValue);
             if (ManagerHelper.Update(manager))
             {
                 this.ShowMsg("成功修改了当前管理员的个人资料", true);
             }
             else
             {
                 this.ShowMsg("当前管理员的个人信息修改失败", false);
             }
         }
     }
 }
Ejemplo n.º 10
0
        private void btnEditPassWordOK_Click(object sender, System.EventArgs e)
        {
            ManagerInfo manager = ManagerHelper.GetManager(this.userId);

            if (Globals.GetCurrentManagerUserId() == this.userId && manager.Password != HiCryptographer.Md5Encrypt(this.txtOldPassWord.Text))
            {
                this.ShowMsg("旧密码输入不正确", false);
            }
            else
            {
                if (string.IsNullOrEmpty(this.txtNewPassWord.Text) || this.txtNewPassWord.Text.Length > 20 || this.txtNewPassWord.Text.Length < 6)
                {
                    this.ShowMsg("密码不能为空,长度限制在6-20个字符之间", false);
                }
                else
                {
                    if (string.Compare(this.txtNewPassWord.Text, this.txtPassWordCompare.Text) != 0)
                    {
                        this.ShowMsg("两次输入的密码不一样", false);
                    }
                    else
                    {
                        HiConfiguration config = HiConfiguration.GetConfig();
                        if (string.IsNullOrEmpty(this.txtNewPassWord.Text) || this.txtNewPassWord.Text.Length < 6 || this.txtNewPassWord.Text.Length > config.PasswordMaxLength)
                        {
                            this.ShowMsg(string.Format("管理员登录密码的长度只能在{0}和{1}个字符之间", 6, config.PasswordMaxLength), false);
                        }
                        else
                        {
                            manager.Password = HiCryptographer.Md5Encrypt(this.txtNewPassWord.Text);
                            if (ManagerHelper.Update(manager))
                            {
                                this.ShowMsg("成功修改了管理员登录密码", true);
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 登录判断
        /// </summary>
        /// <param name="name">要检验的用户名</param>
        /// <param name="pwd">要检验的密码</param>
        /// <param name="type">登录类型标记</param>
        /// <returns>登录状态</returns>
        public LoginStatus Login(string name, string pwd, out int type)
        {
            ManagerInfo mi = miDal.GetListByName(name); //数据访问层返回的对象

            if (mi == null)                             //返回为空说明没有这个用户
            {
                type = 0;
                return(LoginStatus.UserNameError);
            }
            else
            {
                type = mi.MType;
                if (mi.MPwd.Equals(MD5Helper.EncryptString(pwd)))   //密码吻合
                {
                    return(LoginStatus.OK);
                }
                else
                {
                    return(LoginStatus.PwdError);
                }
            }
        }
Ejemplo n.º 12
0
        private void btnLockScreen_Click(object sender, RoutedEventArgs e)
        {
            ManagerInfo info = ManagerInfo.Current;

            if (!info.HasLockPassword())
            {
                SetPasswordWindow passwordWindow = new SetPasswordWindow();

                passwordWindow.ShowDialog();

                if (string.IsNullOrWhiteSpace(passwordWindow.PasswordValue))
                {
                    return;
                }

                info.SetLockPassword(passwordWindow.PasswordValue);
            }

            LockWindow lockWindow = new LockWindow(this);

            lockWindow.Show();
        }
Ejemplo n.º 13
0
    public void Fill(int managerId)
    {
        ManagerChoosen = managerId;
        manager        = Services.GetService <IManagerService>().GetManager(managerId); //BalanceManager.PlayerData.managers.FirstOrDefault(val => val.Id == managerId);
        Title.text     = manager.Name;
        Desc.text      = manager.Description;

        EfficiencyText.text = $"{(int) (manager.Efficiency(Services) * 100)}%";
        KickBackText.text   = $"{(int) (manager.MaxRollback * 100)}%";
        var spriteName = "kickback_" + managerId;

        Back.sprite = SpriteDB.SpriteRefs.FirstOrDefault(val => val.Key == spriteName).Value;

        //uiManager.ShowManagerInfo();

        HireManager.onClick.RemoveAllListeners();
        HireManager.onClick.AddListener(() =>
        {
            Services.ManagerService.HireManager(manager.Id);
            _frameTime = 1;
        });
    }
Ejemplo n.º 14
0
        public ShowPrintsCommandTest()
        {
            msi = new ManagementStorageMock();

            ManagerInfo mi = new ManagerInfo
            {
                Password = "******",
                Prints   = new HashSet <string>()
                {
                    "123", "456", "789"
                }
            };

            msi.UpdateConfig(mi);

            asi = new AdminStorageMock();

            asi.SetAdminAccess(777);

            osi           = new OrderStorageMock();
            AccessCommand = new ShowPrintsCommand(msi, asi, osi);
        }
Ejemplo n.º 15
0
        public JsonResult Change(long id, string password, long roleId, string realName, string reMark)
        {
            long        shopId      = base.CurrentSellerManager.ShopId;
            ManagerInfo managerInfo = new ManagerInfo()
            {
                Id       = id,
                Password = password,
                RoleId   = roleId,
                RealName = realName,
                Remark   = reMark,
                ShopId   = shopId
            };

            ServiceHelper.Create <IManagerService>().ChangeSellerManager(managerInfo);
            Result result = new Result()
            {
                success = true,
                msg     = "修改成功!"
            };

            return(Json(result));
        }
Ejemplo n.º 16
0
        public LoginState Login(string name, string pwd, out int type)
        {
            ManagerInfo mi = miDal.GetByName(name);

            type = 0;
            if (mi == null)
            {
                return(LoginState.NameError);
            }
            else
            {
                if (mi.Mpwd == Md5Helper.GetMd5(pwd))
                {
                    type = mi.Mtype;
                    return(LoginState.Ok);
                }
                else
                {
                    return(LoginState.PwdError);
                }
            }
        }
Ejemplo n.º 17
0
        public void AddSellerManager(ManagerInfo model, string currentSellerName)
        {
            if (model.RoleId == 0)
            {
                throw new HimallException("权限组选择不正确!");
            }
            if (CheckUserNameExist(model.UserName, false))
            {
                throw new HimallException("该用户名已存在!");
            }
            if (model.ShopId == 0)
            {
                throw new HimallException("没有权限进行该操作!");
            }
            model.PasswordSalt = Guid.NewGuid().ToString();
            model.CreateDate   = DateTime.Now;
            string str = SecureHelper.MD5(model.Password);

            model.Password = SecureHelper.MD5(string.Concat(str, model.PasswordSalt));
            context.ManagerInfo.Add(model);
            context.SaveChanges();
        }
Ejemplo n.º 18
0
        public PageModel <MessageDetial> SelectAllMessageDetial(MessageDetialQuery mdq)
        {
            int pageNum = 0;
            IQueryable <MessageDetial> mdr = context.MessageDetial.AsQueryable <MessageDetial>();

            if (mdq.MsgType != 0)
            {
                mdr = (from a in mdr where a.MsgType == mdq.MsgType select a);
            }
            string begin = mdq.BeginTime.ToString("yyyy/MM/dd", System.Globalization.DateTimeFormatInfo.InvariantInfo);
            string end   = mdq.EndTime.ToString("yyyy/MM/dd", System.Globalization.DateTimeFormatInfo.InvariantInfo);

            if (!string.IsNullOrWhiteSpace(begin) && !begin.Equals("0001/01/01") && !string.IsNullOrWhiteSpace(end) && !end.Equals("0001/01/01"))
            {
                mdr = (from a in mdr where a.SendTime >= mdq.BeginTime && a.SendTime <= mdq.EndTime select a);
            }
            if (mdq.SendObj != 0)
            {
                mdr = (from a in mdr where a.SendObj == mdq.SendObj select a);
            }
            foreach (MessageDetial mdrs in mdr.ToList())
            {
                ManagerInfo manaInfo = context.ManagerInfo.FirstOrDefault((ManagerInfo m) => m.Id == mdrs.ManagerId);
                mdrs.SendName = (manaInfo == null ? "" : manaInfo.UserName);
                if (mdrs.MessageTitleId != 20)
                {
                    mdrs.MessageTitle = ((MessageSetting.MessageModuleStatus)mdrs.MessageTitleId).ToDescription();
                }
            }
            mdr = mdr.GetPage(out pageNum, mdq.PageNo, mdq.PageSize, (IQueryable <MessageDetial> d) =>
                              from o in d
                              orderby o.SendTime descending
                              select o);
            return(new PageModel <MessageDetial>
            {
                Models = mdr,
                Total = pageNum
            });
        }
Ejemplo n.º 19
0
        public void ChangeSellerManager(ManagerInfo info)
        {
            ManagerInfo roleId = context.ManagerInfo.FindBy((ManagerInfo item) => item.Id == info.Id && item.ShopId == info.ShopId).FirstOrDefault();

            if (roleId == null)
            {
                throw new HimallException("该管理员不存在,或者已被删除!");
            }
            if (info.RoleId != 0 && roleId.RoleId != 0)
            {
                roleId.RoleId = info.RoleId;
            }
            if (!string.IsNullOrWhiteSpace(info.Password))
            {
                string str = SecureHelper.MD5(info.Password);
                roleId.Password = SecureHelper.MD5(string.Concat(str, roleId.PasswordSalt));
            }
            roleId.RealName = info.RealName;
            roleId.Remark   = info.Remark;
            context.SaveChanges();
            Cache.Remove(CacheKeyCollection.Seller(info.Id));
        }
Ejemplo n.º 20
0
        public void ProcessRequest(HttpContext context)
        {
            ManagerInfo manager   = HiContext.Current.Manager;
            Hashtable   hashtable = new Hashtable();

            if (manager == null)
            {
                this.message = "没有权限";
            }
            else
            {
                string text  = "";
                string text2 = "";
                string text3 = context.Request.QueryString["path"];
                if (text3 == null || text3 == "-1")
                {
                    text3 = "AdvertImg";
                }
                text  = string.Format("{0}/UploadImage/" + text3 + "/", HiContext.Current.GetPCHomePageSkinPath());
                text2 = ((!(context.Request.ApplicationPath != "/")) ? text : text.Substring(context.Request.ApplicationPath.Length));
                string text4 = context.Request.QueryString["order"];
                text4        = (string.IsNullOrEmpty(text4) ? "uploadtime" : text4.ToLower());
                this.message = "未知错误";
                if (this.FillTableForPath(text, text2, text4, hashtable, text3))
                {
                    string text5 = context.Request.Url.ToString();
                    text5  = text5.Substring(0, text5.IndexOf("/", 7));
                    text5 += context.Request.ApplicationPath;
                    if (text5.EndsWith("/"))
                    {
                        text5 = text5.Substring(0, text5.Length - 1);
                    }
                    hashtable["domain"] = text5;
                    this.message        = JsonMapper.ToJson(hashtable);
                }
            }
            context.Response.ContentType = "text/json";
            context.Response.Write(this.message);
        }
Ejemplo n.º 21
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            SF.BLL.manager bll   = new SF.BLL.manager();
            ManagerInfo    model = bll.GetModel(_id);

            model.RoleId = int.Parse(ddlRoleId.SelectedValue);
            //model.role_type = new BLL.manager_role().GetModel(model.role_id).role_type;
            if (cbIsLock.Checked == true)
            {
                model.islock = "0";
            }
            else
            {
                model.islock = "1";
                if (_id == 1)
                {
                    return(false);
                }
            }
            //判断密码是否更改
            if (txtPassword.Text.Trim() != defaultpassword)
            {
                //获取用户已生成的salt作为密钥加密
                model.Password = HiCryptographer.Md5Encrypt(txtPassword.Text.Trim());//DESEncrypt.Encrypt(txtPassword.Text.Trim(), model.salt);
            }
            model.realname  = txtRealName.Text.Trim();
            model.telephone = txtTelephone.Text.Trim();
            model.Email     = txtEmail.Text.Trim();

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改商户:" + model.UserName); //记录日志
                result = true;
            }

            return(result);
        }
Ejemplo n.º 22
0
        //添加操作
        private void button1_Click(object sender, EventArgs e)
        {
            //接收控件的值,用于构造对象
            ManagerInfo mi = new ManagerInfo()
            {
                MName = textBox1.Text,
                MPwd  = textBox2.Text,
                MType = radioButton1.Checked ? 1 : 0
            };

            //判断当前是要进行添加操作,还是要进行修改操作
            if (button1.Text == "添加")
            {
                if (miBll.Add(mi))
                {
                    button2_Click(null, null);
                    LoadList();
                    MessageBox.Show("添加成功");
                }
                else
                {
                    MessageBox.Show("添加失败,请重试!!!");
                }
            }
            else
            {
                mi.MId = Convert.ToInt32(textBox3.Text);
                if (miBll.Edit(mi))
                {
                    LoadList();
                    MessageBox.Show("修改成功");
                }
                else
                {
                    MessageBox.Show("修改失败,请稍后重试!!!");
                }
            }
        }
Ejemplo n.º 23
0
        public PageModel <LawInfo> GetLawInfos(LawInfoQuery model, long?userId)
        {
            int pageNum = 0;
            IQueryable <LawInfo> lawInfo = from item in base.context.LawInfo
                                           select item;

            string begin = model.BeginTime.ToString("yyyy/MM/dd");
            string end   = model.EndTime.ToString("yyyy/MM/dd");

            if (!string.IsNullOrWhiteSpace(begin) && !begin.Equals("0001/01/01") && !string.IsNullOrWhiteSpace(end) && !end.Equals("0001/01/01"))
            {
                lawInfo = (from a in lawInfo where a.CreateTime > model.BeginTime && a.CreateTime < model.EndTime select a);
            }
            if (!string.IsNullOrWhiteSpace(model.Title))
            {
                lawInfo = (from a in lawInfo where a.Title.Contains(model.Title) select a);
            }

            lawInfo = lawInfo.GetPage(out pageNum, model.PageNo, model.PageSize, (IQueryable <LawInfo> d) =>
                                      from o in d
                                      orderby o.CreateTime descending
                                      select o);
            foreach (LawInfo list in lawInfo.ToList())
            {
                if (list.UserId != 0)
                {
                    ManagerInfo manaInfo = context.ManagerInfo.FirstOrDefault((ManagerInfo m) => m.Id == list.Auditor && m.ShopId == 0);
                    list.UserName = (manaInfo == null ? "" : manaInfo.UserName);
                    ChemCloud_Dictionaries dicts = context.ChemCloud_Dictionaries.FirstOrDefault((ChemCloud_Dictionaries m) => m.DictionaryTypeId == 10 && m.DValue == list.LanguageType.ToString());
                    list.Language = dicts.DKey;
                }
            }
            return(new PageModel <LawInfo>
            {
                Models = lawInfo,
                Total = pageNum
            });
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            ManagerInfo mi = new ManagerInfo();

            //1、构造ManagerInfo对象
            mi.MName = txtName.Text;
            mi.MPwd  = txtPwd.Text;
            mi.MType = rb1.Checked ? 1 : 0;


            if (txtId.Text.Equals("添加时无编号"))//表示增加数据
            {
                //表示增加成功
                if (miBll.Add(mi))
                {
                    LoadList();
                    ClearText();
                }
                //表示增加失败
                else
                {
                    MessageBox.Show("添加失败,请稍后重试!");
                }
            }
            else//表示修改数据
            {
                mi.MId = Convert.ToInt32(txtId.Text);
                if (miBll.Edit(mi))
                {
                    LoadList();
                    ClearText();
                }
                else
                {
                    MessageBox.Show("修改失败,请稍后再试!");
                }
            }
        }
Ejemplo n.º 25
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            ManagerInfo managerInfo = null;

            if (string.Compare(this.txtPassword.Text, this.txtPasswordagain.Text) != 0)
            {
                this.ShowMsg("请确保两次输入的密码相同", false);
            }
            else
            {
                managerInfo = ManagerHelper.FindManagerByUsername(this.txtUserName.Text.Trim());
                if (managerInfo != null)
                {
                    this.ShowMsg("输入的管理员账户已存在,请重新输入!", false);
                }
                else
                {
                    managerInfo          = new ManagerInfo();
                    managerInfo.Password = this.txtPassword.Text.Trim();
                    managerInfo.RoleId   = this.dropRole.SelectedValue;
                    managerInfo.UserName = this.txtUserName.Text.Trim();
                    string pass = this.txtPassword.Text.Trim();
                    managerInfo.CreateDate = DateTime.Now;
                    string text = Globals.RndStr(128, true);
                    pass = (managerInfo.Password = Users.EncodePassword(pass, text));
                    managerInfo.PasswordSalt = text;
                    if (ManagerHelper.Create(managerInfo) > 0)
                    {
                        this.txtUserName.Text = string.Empty;
                        this.ShowMsg("成功添加了一个管理员", true);
                    }
                    else
                    {
                        this.ShowMsg("添加了一个管理员失败", false);
                    }
                }
            }
        }
Ejemplo n.º 26
0
        private void BindStatistics(StatisticsInfo statistics)
        {
            ManagerInfo currentManager = ManagerHelper.GetCurrentManager();

            //当前用户不是超级管理员的情况下,跳转到权限内的第一个页面
            if (currentManager.UserName != "yihui" && currentManager.UserName != "admin")
            {
                this.Page.Response.Redirect(ManagerHelper.GetFirstRoleUrl(currentManager.RoleId));
            }

            if (statistics.OrderNumbWaitConsignment > 0)
            {
                this.ltrWaitSendOrdersNumber.NavigateUrl = "javascript:ShowSecondMenuLeft('微订单','sales/manageorder.aspx','" + Globals.ApplicationPath + "/Admin/sales/ManageOrder.aspx?orderStatus=2')";
                this.ltrWaitSendOrdersNumber.Text        = statistics.OrderNumbWaitConsignment.ToString() + "条";
            }
            else
            {
                this.ltrWaitSendOrdersNumber.Text = "<font style=\"color:#2d2d2d\">0条</font>";
            }
            if (statistics.GroupBuyNumWaitRefund > 0)
            {
                this.WaitForRefund.NavigateUrl = "javascript:ShowSecondMenuLeft('微营销','promotion/groupbuys.aspx','" + Globals.ApplicationPath + "/Admin/promotion/groupbuys.aspx?state=5')";
                this.WaitForRefund.Text        = statistics.GroupBuyNumWaitRefund.ToString() + "个";
            }
            else
            {
                this.WaitForRefund.Text = "<font style=\"color:#2d2d2d\">0个</font>";
            }
            this.lblTodayOrderAmout.Text       = ((statistics.OrderPriceToday > 0m) ? ("¥" + Globals.FormatMoney(statistics.OrderPriceToday)) : string.Empty);
            this.ltrTodayAddMemberNumber.Text  = ((statistics.UserNewAddToday > 0) ? statistics.UserNewAddToday.ToString() : string.Empty);
            this.lblTodayFinishOrder.Text      = ((statistics.TodayFinishOrder > 0) ? statistics.TodayFinishOrder.ToString() : string.Empty);
            this.lblYesterdayFinishOrder.Text  = ((statistics.YesterdayFinishOrder > 0) ? statistics.YesterdayFinishOrder.ToString() : string.Empty);
            this.lblOrderPriceYesterDay.Text   = ((statistics.OrderPriceYesterday > 0m) ? ("¥" + statistics.OrderPriceYesterday.ToString("F2")) : string.Empty);
            this.lblUserNewAddYesterToday.Text = ((statistics.UserNewAddYesterToday > 0) ? (statistics.UserNewAddYesterToday.ToString() + "位") : string.Empty);
            this.lblTotalMembers.Text          = ((statistics.TotalMembers > 0) ? (statistics.TotalMembers.ToString() + "位") : string.Empty);
            this.lblTotalProducts.Text         = ((statistics.TotalProducts > 0) ? (statistics.TotalProducts.ToString() + "条") : string.Empty);
            this.lblOrderPriceMonth.Text       = ((statistics.OrderPriceMonth > 0m) ? ("¥" + statistics.OrderPriceMonth.ToString("F2")) : string.Empty);
        }
Ejemplo n.º 27
0
        private void btnAdminLogin_Click(object sender, EventArgs e)
        {
            if (!Globals.CheckVerifyCode(this.txtCode.Text.Trim()))
            {
                this.ShowMessage("验证码不正确");
            }
            else
            {
                var         c       = HiCryptographer.Md5Encrypt(this.txtAdminPassWord.Text);
                ManagerInfo manager = ManagerHelper.GetManager(this.txtAdminName.Text);
                if (manager == null)
                {
                    this.ShowMessage("无效的用户信息");
                }
                else if (manager.Password != HiCryptographer.Md5Encrypt(this.txtAdminPassWord.Text))
                {
                    this.ShowMessage("密码不正确");
                }
                else
                {
                    HttpCookie cookie = new HttpCookie("Vshop-Manager")
                    {
                        Value   = manager.UserId.ToString(),
                        Expires = DateTime.Now.AddDays(1.0)
                    };

                    HttpCookie roleid = new HttpCookie("roleid")
                    {
                        Value   = manager.RoleId.ToString(),
                        Expires = DateTime.Now.AddDays(1.0)
                    };
                    HttpContext.Current.Response.Cookies.Add(roleid);

                    HttpContext.Current.Response.Cookies.Add(cookie);
                    this.Page.Response.Redirect("Default.aspx", true);
                }
            }
        }
Ejemplo n.º 28
0
        public void ProcessRequest(HttpContext context)
        {
            ManagerInfo manager = HiContext.Current.Manager;

            if (manager == null)
            {
                this.jsondict.Add("msg", "权限不足");
                this.WriteJson(context, 0);
            }
            string text  = context.Request["action"];
            string text2 = text;

            switch (text2)
            {
            default:
                if (text2 == "EmptySupplierTransactionPass")
                {
                    this.EmptySupplierTransactionPass(context);
                }
                break;

            case "CheckSupplierName":
                this.CheckSupplierName(context);
                break;

            case "CheckUserName":
                this.CheckUserName(context);
                break;

            case "EditSupplierStatus":
                this.EditSupplierStatus(context);
                break;

            case "ResetSupplierPass":
                this.ResetSupplierPass(context);
                break;
            }
        }
Ejemplo n.º 29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int userId = Globals.GetCurrentManagerUserId();

            if (userId == 0)
            {
                Response.Redirect("/admin/login.aspx");
                return;
            }

            ManagerInfo mgr = Session[DTKeys.SESSION_ADMIN_INFO] as ManagerInfo;

            if (mgr != null)
            {
                //Session[DTKeys.SESSION_BUSNIESE_NUM] = mgr.businessNum;
                //Session[DTKeys.SESSION_ADMIN_ID] = mgr.UserId;
                //Session["UserName"] = mgr.realname;
            }
            else
            {
                Response.Redirect("/admin/login.aspx");
            }
        }
Ejemplo n.º 30
0
        public void AddAdmin()
        {
            var managerInfo = new ManagerInfo
            {
                Email      = "*****@*****.**",
                RealName   = "超级管理员",
                Salt       = "28LH48",
                UserName   = "******",
                Password   = "******",
                AddTime    = DateTime.Now,
                AgentId    = 1,
                AgentLevel = -1,
                City       = "北京",
                County     = "西三旗",
                Province   = "北京",
                WxNum      = 100
            };

            var managerInfoService = new ManagerInfoService();
            var managerInfoId      = managerInfoService.Add(managerInfo);

            Assert.IsTrue(managerInfoId > 0);
        }
Ejemplo n.º 31
0
        public override void OnLoad(HttpContext context)
        {
            base.OnLoad(context);
            this.CurrentManager = HiContext.Current.Manager;
            string text = context.Request["action"];

            if (string.IsNullOrWhiteSpace(text))
            {
                throw new HidistroAshxException("错误的参数");
            }
            string a = text;

            if (!(a == "getlist"))
            {
                if (a == "delete")
                {
                    this.Delete(context);
                    return;
                }
                throw new HidistroAshxException("错误的参数");
            }
            this.GetList(context);
        }
Ejemplo n.º 32
0
        private void CheckPageAccess()
        {
            ManagerInfo manager = HiContext.Current.Manager;

            if (manager == null || manager.RoleId == -1 || manager.RoleId == -3)
            {
                base.Response.Write("<script language='javascript'>window.parent.location.href='/Admin/Login.aspx';</script>");
                base.Response.End();
            }
            else
            {
                AdministerCheckAttribute administerCheckAttribute = (AdministerCheckAttribute)Attribute.GetCustomAttribute(base.GetType(), typeof(AdministerCheckAttribute));
                if (administerCheckAttribute != null && administerCheckAttribute.AdministratorOnly && manager.RoleId != 0)
                {
                    this.Page.Response.Redirect(Globals.GetAdminAbsolutePath("/AccessDenied.aspx"));
                }
                PrivilegeCheckAttribute privilegeCheckAttribute = (PrivilegeCheckAttribute)Attribute.GetCustomAttribute(base.GetType(), typeof(PrivilegeCheckAttribute));
                if (privilegeCheckAttribute != null && !ManagerHelper.HasPrivilege((int)privilegeCheckAttribute.Privilege, manager))
                {
                    this.Page.Response.Redirect(Globals.GetAdminAbsolutePath("/accessDenied.aspx?privilege=" + privilegeCheckAttribute.Privilege.ToString()));
                }
            }
        }
Ejemplo n.º 33
0
        public void Setup(ManagerInfo manager)
        {
            this.manager = manager;


            GeneratorInfo generator = Services.GenerationService.GetGetenerator(manager.Id);

            updateTimer.Setup(1.0f, (delta) => {
                ProfitResult profitResult = generator.ConstructProfitResult(Services.GenerationService.Generators); //Services.GenerationService.CalculateProfitPerSecond(generator,Services.TransportService.GetUnitLiveCount(manager.Id));
                CurrencyNumber number     = profitResult.ValuePerSecond.ToCurrencyNumber();
                profitText.text           = FormatProfit(profitResult.ValuePerSecond.ToCurrencyNumber());
                UpdateEfficiencyText();
            }, invokeImmediatly: true);

            UpdateManagerIcon();
            UpdateMegaTextObject();
            UpdateRollbackChanged();

            if (!isInitialized)
            {
                isInitialized = true;
            }
        }
Ejemplo n.º 34
0
        public JsonResult Add(ManagerInfoModel model)
        {
            Result result = new Result();

            try
            {
                ManagerInfo managerInfo = new ManagerInfo()
                {
                    UserName = model.UserName,
                    Password = model.Password,
                    RoleId   = model.RoleId
                };
                ServiceHelper.Create <IManagerService>().AddPlatformManager(managerInfo);
                result.success = true;
                result.msg     = "添加成功!";
            }
            catch (Exception ex)
            {
                result.success = false;
                result.msg     = ex.ToString();
            }
            return(Json(result));
        }
Ejemplo n.º 35
0
        protected override void AttachChildControls()
        {
            Literal literal  = (Literal)this.FindControl("litPageName");
            Literal literal2 = (Literal)this.FindControl("litTempete");
            Literal literal3 = (Literal)this.FindControl("litaccount");
            Literal literal4 = (Literal)this.FindControl("litview");
            Literal literal5 = (Literal)this.FindControl("litDefault");

            if (!this.Page.IsPostBack)
            {
                if (literal != null)
                {
                    literal.Text = "<script>Hidistro_designer.CurrentPageName='" + this.skintemp + "';Hidistro_designer.CurrentParams=" + this.skinparams + "</script>";
                }
                if (literal2 != null)
                {
                    literal2.Text = "<div id=\"assistdiv\" class=\"assistdiv\"></div><div class=\"edit_div\" id=\"grounddiv\"><div class=\"cover\"></div></div><div class=\"edit_bar\" id=\"groundeidtdiv\"><a href=\"javascript:Hidistro_designer.EditeDesigDialog();\" title=\"编辑\" id=\"a_design_Edit\">编辑</a><a href=\"javascript:Hidistro_designer.MoveUp()\" class=\"up\" id=\"a_design_up\" title=\"上移\">上移</a><a href=\"javascript:Hidistro_designer.MoveDown()\" class=\"down\" title=\"下移\" id=\"a_design_down\">下移</a><a href=\"javascript:void(0);\" id=\"a_design_delete\" title=\"删除\" onclick=\"Hidistro_designer.del_element()\">删除</a><a class=\"controlinfo\" href=\"javascript:void(0);\" onclick=\"Hidistro_designer.gethelpdailog();\" title=\"控件说明\" rel=\"#SetingTempalte\">控件说明</a></div> <div class=\"apple_overlay\" id=\"taboverlaycontent\"></div><div id=\"tempdiv\" style=\"height: 260px; display: none;\"></div><div class=\"design_coverbg\" id=\"design_coverbg\"></div><div class=\"controlnamediv\" id=\"ctrnamediv\">图片控件轮播组件</div><div class=\"movediv\" id=\"parentmove\">上下移动</div><script>Hidistro_designer.Design_Page_Init();</script>";
                }
                if (literal3 != null)
                {
                    ManagerInfo manager = HiContext.Current.Manager;
                    if (manager != null)
                    {
                        literal3.Text = "<a>我的账号:" + manager.UserName + "</a>";
                    }
                }
                if (literal5 != null)
                {
                    literal5.Text = "<a href=\"/\">查看店铺</a>";
                }
                if (literal4 != null)
                {
                    string str = "/";
                    literal4.Text = "<a href=\"" + str + "\" target=\"_blank\" class=\"button\">预览</a>";
                }
            }
        }