Ejemplo n.º 1
0
        /// <summary>
        /// 将要发送的消息 写入到数据库 等待定时任务获取数据发送信息
        /// </summary>
        /// <param name="categoryItem"></param>
        public void GenerateMessageInfo(CategoryItem categoryItem)
        {
            var templateList = DependencyResolver.Resolver<ITemplateService>().GetTemplateByCategory(categoryItem);

            if (templateList.Count == 0)
            {
                _log.InfoFormat("{0} 无要发送的信息,模板信息为空,模板分类{1}", DateTime.Now.ToShortDateString(),
                                categoryItem.Name + categoryItem.Id);
                return;
            }

            if (categoryItem.OtherInfo == "Holiday")
            {
                SendHolidayMsgInfo(templateList);
            }
            else if (categoryItem.OtherInfo == "Birthday")
            {
                BirthDayMessageGenerate(templateList);
            }
        }
Ejemplo n.º 2
0
        public void CustomerRating()
        {
            //客户信用
            Category category = new Category();
            category.Name = "客户信用";
            category.Description = "客户管理-客户信用";
            category.Deleted = false;
            category.Value = "";
            category.Code = "CreditRating";

            ICategoryService categoryService = DependencyResolver.Resolver<ICategoryService>();
            categoryService.Save(category);

            string[] items = new string[] { "A", "A+", "A-", "B", "B+", "B-" };
            for (int i = 0; i < items.Length; i++)
            {
                CategoryItem categoryItem = new CategoryItem();
                categoryItem.Category = category;
                categoryItem.Name = items[i];
                categoryItem.OrderIndex = (short)i;
                categoryItem.Description = items[i];
                _categoryItemService.Save(categoryItem);
            }
        }
Ejemplo n.º 3
0
        public void CategoryItemTest()
        {
            string[] childNames = new string[] { "一般意向", "重点意向", "不确定客户" };
            Category category = _categoryService.FindByCode("CustomerType");

            var parent = _categoryItemService.FindByCategoryTypeAndItemName("CustomerType", "潜在客户");
            for (int i = 0; i < childNames.Length; i++)
            {
                CategoryItem categoryItem = new CategoryItem();
                categoryItem.Category = category;
                categoryItem.Name = childNames[i];
                categoryItem.OrderIndex = (short)i;
                categoryItem.Description = childNames[i];
                categoryItem.ParentItem = parent;
                _categoryItemService.Save(categoryItem);
            }
        }
Ejemplo n.º 4
0
        public void Believe()
        {
            Category category = new Category();
            category.Name = "信仰";
            category.Description = "客户管理-信仰";
            category.Deleted = false;
            category.Value = "";
            category.Code = "Believe";

            ICategoryService categoryService = DependencyResolver.Resolver<ICategoryService>();
            categoryService.Save(category);

            string[] items = new string[]
                                 {
                                     "佛教",
                                     "基督教",
                                     "未知",
                                     "无神论者",
                                     "道教"
                                 };
            for (int i = 0; i < items.Length; i++)
            {
                CategoryItem categoryItem = new CategoryItem();
                categoryItem.Category = category;
                categoryItem.Name = items[i];
                categoryItem.OrderIndex = (short)i;
                categoryItem.Description = items[i];
                _categoryItemService.Save(categoryItem);
            }
        }
Ejemplo n.º 5
0
        private void AddChildCategoryItem(string s, string customerarea, string[] strings, Category category)
        {
            CategoryItem parent = this._categoryItemService.FindByCategoryTypeAndItemName(customerarea, s);

            for (int index = 0; index < strings.Length; index++)
            {
                string s1 = strings[index];
                CategoryItem child = new CategoryItem();
                child.Name = s1;
                child.Description = s1;
                child.OrderIndex = (short)index;
                child.ParentItem = parent;
                child.Category = category;

                this._categoryItemService.Save(child);
            }
        }
Ejemplo n.º 6
0
 private void AddCategory(Category category, string[] items)
 {
     _categoryService.Save(category);
     for (int i = 0; i < items.Length; i++)
     {
         CategoryItem categoryItem = new CategoryItem();
         categoryItem.Category = category;
         categoryItem.Name = items[i];
         categoryItem.OrderIndex = (short)i;
         categoryItem.Description = items[i];
         _categoryItemService.Save(categoryItem);
     }
 }
Ejemplo n.º 7
0
        public void RelationLevel()
        {
            Category category = new Category();
            category.Name = "客户关系";
            category.Description = "客户管理-客户关系";
            category.Deleted = false;
            category.Value = "";
            category.Code = "Customer_RelationLevel";

            ICategoryService categoryService = DependencyResolver.Resolver<ICategoryService>();
            categoryService.Save(category);

            string[] items = new string[]
                                 {
                                     "紧密",
                                     "好",
                                     "一般",
                                     "排斥",
                                     "反感"
                                 };
            for (int i = 0; i < items.Length; i++)
            {
                CategoryItem categoryItem = new CategoryItem();
                categoryItem.Category = category;
                categoryItem.Name = items[i];
                categoryItem.OrderIndex = (short)i;
                categoryItem.Description = items[i];
                _categoryItemService.Save(categoryItem);
            }
        }
Ejemplo n.º 8
0
        public void NationalitySate()
        {
            //客户信用
            Category category = new Category();
            category.Name = "民族";
            category.Description = "民族";
            category.Deleted = false;
            category.Value = "民族";
            category.Code = "NationalitySate";

            ICategoryService categoryService = DependencyResolver.Resolver<ICategoryService>();
            categoryService.Save(category);

            string[] items = new string[]
                                 {
                                     "汉族",
                                     "回族",
                                     "蒙古族",
                                     "满族",
                                     "朝鲜族",
                                     "赫哲族",
                                     "达斡尔族",
                                     "鄂温克族",
                                     "鄂伦春族",
                                     "东乡族",
                                     "土族",
                                     "撒拉族",
                                     "保安族",
                                     "裕固族",
                                     "维吾尔族",
                                     "哈萨克族",
                                     "柯尔克孜族",
                                     "锡伯族",
                                     "塔吉克族",
                                     "乌孜别克族",
                                     "俄罗斯族",
                                     "塔塔尔族",
                                     "藏族",
                                     "门巴族",
                                     "珞巴族",
                                     "羌族",
                                     "彝族",
                                     "白族",
                                     "哈尼族",
                                     "傣族",
                                     "傈僳族",
                                     "佤族",
                                     "拉祜族",
                                     "纳西族",
                                     "景颇族",
                                     "布朗族",
                                     "阿昌族",
                                     "普米族",
                                     "怒族",
                                     "德昂族",
                                     "独龙族",
                                     "基诺族",
                                     "苗族",
                                     "布依族",
                                     "侗族",
                                     "水族",
                                     "仡佬族",
                                     "壮族",
                                     "瑶族",
                                     "仫佬族",
                                     "毛南族",
                                     "京族",
                                     "土家族",
                                     "黎族",
                                     "畲族",
                                     "高山族"
                                 };
            for (int i = 0; i < items.Length; i++)
            {
                CategoryItem categoryItem = new CategoryItem();
                categoryItem.Category = category;
                categoryItem.Name = items[i];
                categoryItem.OrderIndex = (short)i;
                categoryItem.Description = items[i];
                _categoryItemService.Save(categoryItem);
            }
        }
Ejemplo n.º 9
0
        private void FaceToData(ref CategoryItem customer)
        {
            if (this.Id == 0) // 新增
            {
                if (this.Selected != null && this.Selected.Target != _Category)
                {
                    customer.ParentItem = this.CategoryItemService.FindById(this.ParentId);
                    if (customer.ParentItem != null)
                    {
                        customer.Category = customer.ParentItem.Category;
                    }
                }
                else
                {
                    customer.Category = this.Service.FindById(CategoryId);
                }
            }

            customer.Name = this.NameID.Text;
            customer.Description = this.DescriptionID.Text;
            customer.OrderIndex = short.Parse(this.OrderIndexID.Text);
            customer.OtherInfo = this.OtherInfoID.Text;
        }
Ejemplo n.º 10
0
        private void DataToFace(CategoryItem value)
        {
            if (value == null)
            {
                // 清空数据
                Category category = this.Service.FindById(this.CategoryId);

                this.CategoryID.Text = string.Empty;
                this.ParentItemID.Text = string.Empty;

                if (category != null)
                {
                    this.CategoryID.Text = category.Name;
                    this.ParentItemID.Text = string.Empty;
                }
                CategoryItem parent = this.CategoryItemService.FindById(this.ParentId);
                if (parent != null)
                {
                    this.CategoryID.Text = parent.Category.Name;
                    this.ParentItemID.Text = parent.Name;
                }
                this.NameID.Text = string.Empty;
                this.DescriptionID.Text = string.Empty;
                this.OrderIndexID.Text = "0";
                return;
            }

            this.NameID.Text = value.Name;
            this.DescriptionID.Text = value.Description;
            this.OrderIndexID.Text = value.OrderIndex.ToString();
            this.CategoryID.Text = value.Category == null ? string.Empty : value.Category.Name;
            this.ParentItemID.Text = value.ParentItem == null ? string.Empty : value.ParentItem.Name;
            OtherInfoID.Text = value.OtherInfo;
        }