/// <summary>
 /// 构造
 /// </summary>
 /// <param name="id"></param>
 /// <param name="type"></param>
 /// <param name="name"></param>
 /// <param name="memo"></param>
 public CreateOrEditCustomerTypeCommand(Guid?id, CustomerTypeEnum type, string name, string memo)
 {
     Id   = id;
     Type = type;
     Name = name;
     Memo = memo;
 }
Ejemplo n.º 2
0
        public List <ModuleEntity> GetList(CustomerTypeEnum customerType)
        {
            List <ModuleEntity> moduleList;

            switch (customerType)
            {
            case CustomerTypeEnum.System:
                moduleList = _service.IQueryable(x => x.F_IsPublic != true || x.F_IsExpand == true).OrderBy(t => t.F_SortCode).ToList();
                break;

            case CustomerTypeEnum.Platform:
                moduleList = _service.IQueryable(x => x.F_IsExpand == true).OrderBy(t => t.F_SortCode).ToList();
                break;

            case CustomerTypeEnum.Organization:
                moduleList = _service.IQueryable(x => x.F_IsPublic == true).OrderBy(t => t.F_SortCode).ToList();
                break;

            case CustomerTypeEnum.User:
                moduleList = null;
                break;

            default:
                moduleList = _service.IQueryable().OrderBy(t => t.F_SortCode).ToList();
                break;
            }
            return(moduleList);
        }
Ejemplo n.º 3
0
    /// <summary>
    /// 获取团队顾客数据
    /// </summary>
    /// <param name="teamId"></param>
    /// <returns></returns>
    public UserCustomerBean GetCustomerData(CustomerTypeEnum customerType, string teamId)
    {
        List <UserCustomerBean> listData = null;

        switch (customerType)
        {
        case CustomerTypeEnum.Friend:
            listData = listForFriendCustomerData;
            break;

        case CustomerTypeEnum.Team:
            listData = listForTeamCustomerData;
            break;
        }
        if (listData == null)
        {
            return(null);
        }
        foreach (UserCustomerBean itemData in listData)
        {
            if (teamId.Equals(itemData.id))
            {
                return(itemData);
            }
        }
        return(null);
    }
Ejemplo n.º 4
0
 /// <summary>
 /// 构造新增分类
 /// </summary>
 /// <param name="type"></param>
 /// <param name="name"></param>
 /// <param name="memo"></param>
 public CustomerType(CustomerTypeEnum type, string name, string memo)
 {
     Id   = ComFunc.NewCombGuid();
     Type = type;
     Name = name;
     Memo = memo;
 }
Ejemplo n.º 5
0
        public ActionResult GetPermissionTree(string roleId, CustomerTypeEnum customerType)
        {
            var moduledata = customerType != CustomerTypeEnum.Both
                ? moduleApp.GetList(customerType)
                : OperatorProvider.Provider.GetCurrent().IsSystem
                    ? moduleApp.GetList(CustomerTypeEnum.System)
                    : OperatorProvider.Provider.GetCurrent().IsPlatform
                        ? moduleApp.GetList(CustomerTypeEnum.Platform)
                        : moduleApp.GetList(CustomerTypeEnum.Organization);
            var buttondata    = moduleButtonApp.GetList();
            var authorizedata = new List <RoleAuthorizeEntity>();

            if (!string.IsNullOrEmpty(roleId))
            {
                authorizedata = roleAuthorizeApp.GetList(roleId);
            }
            var defaultauthorizedata = new List <RoleAuthorizeEntity>();

            if (!string.IsNullOrEmpty(OperatorProvider.Provider.GetCurrent().CompanyId))
            {
                var role = roleApp.GetDefaultCompanyRole(OperatorProvider.Provider.GetCurrent().CompanyId);
                if (role != null)
                {
                    defaultauthorizedata = roleAuthorizeApp.GetList(role.F_Id);
                }
            }
            var treeList = (from item in moduledata
                            where defaultauthorizedata.Count(t => t.F_ItemId == item.F_Id) > 0 || OperatorProvider.Provider.GetCurrent().IsSystem || customerType != CustomerTypeEnum.Both
                            select new TreeViewModel
            {
                id = item.F_Id,
                text = item.F_FullName,
                value = item.F_EnCode,
                parentId = item.F_ParentId,
                isexpand = true,
                complete = true,
                showcheck = true,
                checkstate = authorizedata.Count(t => t.F_ItemId == item.F_Id),
                hasChildren = true,
                img = item.F_Icon == "" ? "" : item.F_Icon
            }).ToList();

            treeList.AddRange(from item in buttondata
                              where defaultauthorizedata.Count(t => t.F_ItemId == item.F_Id) > 0 || OperatorProvider.Provider.GetCurrent().IsSystem || customerType != CustomerTypeEnum.Both
                              select new TreeViewModel
            {
                id          = item.F_Id,
                text        = item.F_FullName,
                value       = item.F_EnCode,
                parentId    = item.F_ParentId == "0" ? item.F_ModuleId : item.F_ParentId,
                isexpand    = true,
                complete    = true,
                showcheck   = true,
                checkstate  = authorizedata.Count(t => t.F_ItemId == item.F_Id),
                hasChildren = buttondata.Count(t => t.F_ParentId == item.F_Id) != 0,
                img         = item.F_Icon == "" ? "" : item.F_Icon
            });
            return(Content(treeList.TreeViewJson()));
        }
Ejemplo n.º 6
0
        public Customer(CustomerTypeEnum type, string name, string email, Address address)
        {
            this.Type  = type;
            this.Name  = name.ValidateFor().NullOrEmpty();
            this.Email = email.ValidateFor().NullOrEmpty();

            UpdateAddress(address);
        }
Ejemplo n.º 7
0
 public Customers(string forNavn, string efternavn, string inputPhone, string inputEmail, CustomerTypeEnum inputCType)
 {
     FirstName    = forNavn;
     LastName     = efternavn;
     Phone        = inputPhone;
     Email        = inputEmail;
     CustomerType = inputCType;
 }
Ejemplo n.º 8
0
 public OrderSpecifcationIndex GetSpecificationWithCustomerType(CustomerTypeEnum customerType)
 {
     if (this.Specification.ContainsKey(customerType))
     {
         return(this.Specification[customerType]);
     }
     return(null);
 }
 /// <summary>
 /// 转换成枚举
 /// </summary>
 public static int CustomerTypeToValue(CustomerTypeEnum enumOption)
 {
     try{
         return((int)enumOption);
     }catch (Exception ex) {
         throw new ArgumentException("enumOption", ex);
     }
 }
Ejemplo n.º 10
0
    /// <summary>
    ///  计算是否想要吃饭
    /// </summary>
    /// <returns></returns>
    private bool IsWantEat(CustomerTypeEnum customerType)
    {
        GameDataBean gameData = GameDataHandler.Instance.manager.GetGameData();
        //想要吃饭概率
        float eatProbability = UnityEngine.Random.Range(0f, 1f);
        float rateWant       = gameData.GetInnAttributesData().CalculationCustomerWantRate(customerType);

        //设定是否吃饭
        if (eatProbability <= rateWant)
        {
            return(true);
        }
        return(false);
    }
Ejemplo n.º 11
0
    /// <summary>
    /// 根据类型返回顾客数量
    /// </summary>
    /// <param name="customerType"></param>
    /// <returns></returns>
    public long GetNumberForCustomerFoodCompleteByType(CustomerTypeEnum customerType)
    {
        switch (customerType)
        {
        case CustomerTypeEnum.Normal:
            return(numberForNormalCustomerComplete);

        case CustomerTypeEnum.Team:
            return(numberForTeamCustomerComplete);

        case CustomerTypeEnum.Friend:
            return(numberForFriendsCustomerComplete);
        }
        return(0);
    }
Ejemplo n.º 12
0
    /// <summary>
    /// 增加顾客数量
    /// </summary>
    /// <param name="customerType"></param>
    /// <param name="number"></param>
    public void AddCutomerForFoodNumber(CustomerTypeEnum customerType, int number)
    {
        switch (customerType)
        {
        case CustomerTypeEnum.Normal:
            numberForNormalCustomer += number;
            break;

        case CustomerTypeEnum.Team:
            numberForTeamCustomer += number;
            break;

        case CustomerTypeEnum.Friend:
            numberForFriendsCustomer += number;
            break;
        }
    }
Ejemplo n.º 13
0
    /// <summary>
    /// 计算顾客想要吃饭的概率
    /// </summary>
    /// <returns></returns>
    public float CalculationCustomerWantRate(CustomerTypeEnum customerType)
    {
        float rate = 0;

        //美观所占比重
        GetAesthetics(out float maxAesthetics, out float aesthetics);
        float rateAesthetics = aesthetics / maxAesthetics;

        if (rateAesthetics > 1)
        {
            rateAesthetics = 1;
        }
        //点赞率所占比重
        GetPraise(out int maxPraise, out int praise);
        float ratePraise = (float)praise / maxPraise;

        if (ratePraise > 1)
        {
            ratePraise = 1;
        }
        //菜品丰富度所占比重
        GetRichness(out int maxRichness, out int richness);
        float rateRichness = richness / maxRichness;

        if (rateRichness > 1)
        {
            rateRichness = 1;
        }

        if (customerType == CustomerTypeEnum.Normal)
        {
            rate = 0.36f * rateRichness + 0.3f * ratePraise + 0.3f * rateAesthetics + 0.04f;
        }
        else if (customerType == CustomerTypeEnum.Team)
        {
            rate = 0.36f * rateRichness + 0.3f * ratePraise + 0.3f * rateAesthetics + 0.04f;
        }
        else
        {
            rate = 0.36f * rateRichness + 0.3f * ratePraise + 0.3f * rateAesthetics + 0.04f;
        }
        rate = rate / 2f;
        return(rate);
    }
Ejemplo n.º 14
0
    /// <summary>
    /// 记录顾客
    /// </summary>
    public void AddNumberForCustomerFood(CustomerTypeEnum customerType, string id, int number)
    {
        List <UserCustomerBean> listData = null;

        switch (customerType)
        {
        case CustomerTypeEnum.Normal:
            numberForNormalCustomer += number;
            break;

        case CustomerTypeEnum.Team:
            numberForTeamCustomer += number;
            listData = listForTeamCustomerData;
            break;

        case CustomerTypeEnum.Friend:
            numberForFriendsCustomer += number;
            listData = listForFriendCustomerData;
            break;
        }
        if (listData == null)
        {
            return;
        }
        bool hasData = false;

        foreach (UserCustomerBean itemCustomerData in listData)
        {
            if (itemCustomerData.id.Equals(id))
            {
                itemCustomerData.AddNumber(number);
                hasData = true;
                break;
            }
        }
        if (!hasData)
        {
            UserCustomerBean userCustomerData = new UserCustomerBean();
            userCustomerData.id = id;
            userCustomerData.AddNumber(number);
            listData.Add(userCustomerData);
        }
    }
Ejemplo n.º 15
0
    public void AddMenuForCustomer(CustomerTypeEnum customerType, string id, long menuId)
    {
        switch (customerType)
        {
        case CustomerTypeEnum.Normal:
            break;

        case CustomerTypeEnum.Team:
            foreach (UserCustomerBean itemCustomerData in listForTeamCustomerData)
            {
                if (itemCustomerData.id.Equals(id))
                {
                    itemCustomerData.AddMenu(menuId);
                    break;
                }
            }
            break;

        case CustomerTypeEnum.Friend:
            break;
        }
    }
Ejemplo n.º 16
0
 public override void Awake()
 {
     base.Awake();
     customerType = CustomerTypeEnum.Normal;
 }
Ejemplo n.º 17
0
 public bool CheckType(CustomerTypeEnum type)
 {
     return(Type.HasFlag(type));
 }
Ejemplo n.º 18
0
 public void RemoveType(CustomerTypeEnum type)
 {
     Type &= ~type;
 }
Ejemplo n.º 19
0
 public void AddType(CustomerTypeEnum type)
 {
     Type |= type;
 }
Ejemplo n.º 20
0
 internal CustomerType(CustomerTypeEnum type)
 {
     Value = type;
 }
Ejemplo n.º 21
0
        public static string TryToStr(this CustomerTypeEnum ct)
        {
            string str = string.Empty;

            switch (ct)
            {
            case CustomerTypeEnum.BigCustomer:
                str = "集团大客户";
                break;

            case CustomerTypeEnum.Cooperation:
                str = "业务合作商";
                break;

            case CustomerTypeEnum.Dealer:
                str = "代理经销商";
                break;

            case CustomerTypeEnum.Ordinary:
                str = "普通客户";
                break;

            case CustomerTypeEnum.Other:
                str = "其他客户";
                break;

            case CustomerTypeEnum.Same:
                str = "怀疑同行";
                break;

            case CustomerTypeEnum.ArmedPolice:
                str = "武警部队";
                break;

            case CustomerTypeEnum.Colleges:
                str = "高校";
                break;

            case CustomerTypeEnum.Commission:
                str = "教委";
                break;

            case CustomerTypeEnum.Hospital:
                str = "医院";
                break;

            case CustomerTypeEnum.JDS:
                str = "戒毒所";
                break;

            case CustomerTypeEnum.Judicial:
                str = "公检法";
                break;

            case CustomerTypeEnum.MiddleSchool:
                str = "中学";
                break;

            case CustomerTypeEnum.PrimarySchool:
                str = "小学";
                break;

            case CustomerTypeEnum.Prison:
                str = "监狱";
                break;

            case CustomerTypeEnum.Special:
                str = "特教";
                break;

            case CustomerTypeEnum.VocationalSchools:
                str = "中职";
                break;
            }
            return(str);
        }
Ejemplo n.º 22
0
 // Required only for the ADO.NET approach.
 public Customer(Guid id, CustomerTypeEnum type, string name, string email, Address address)
     : this(type, name, email, address)
 {
     this.Id = id;
 }
Ejemplo n.º 23
0
 public OrderForCustomer(CustomerTypeEnum customerType, NpcAICustomerCpt customer)
 {
     this.customer     = customer;
     this.customerType = customerType;
 }
Ejemplo n.º 24
0
 public CustomerType GetCustomerType(CustomerTypeEnum type)
 {
     return(GetCustomerTypes().Find(t => t.CustomerTypeEnum == type));
 }
Ejemplo n.º 25
0
        public static CustomerType FromString(string type)
        {
            CustomerTypeEnum customerType = (CustomerTypeEnum)Enum.Parse(typeof(CustomerTypeEnum), type, true);

            return(new CustomerType(customerType));
        }
 public KomodoGreeting(string firstName, string lastName, CustomerTypeEnum customerType)
 {
     FirstName    = firstName;
     LastName     = lastName;
     CustomerType = customerType;
 }