//活动 public bool TryToFindActivity(CRMInfo info, LuisResult result) { EntityRecommendation entity; if (result.TryFindEntity("活动", out entity)) { info.activityText = entity.Entity.Replace(" ", ""); } return(!String.IsNullOrWhiteSpace(info.activityText)); }
//导引 public bool TryToGuide(CRMInfo info, LuisResult result) { EntityRecommendation entity; if (result.TryFindEntity("导引", out entity)) { info.businessFormatText = entity.Entity.Replace(" ", ""); } return(!String.IsNullOrWhiteSpace(info.floorText)); }
//积分 public bool QueryPoint(CRMInfo info) { StringBuilder sb = new StringBuilder(); sb.Append("i am in queryPoint"); info.replyString = sb.ToString(); return(!String.IsNullOrWhiteSpace(info.replyString)); }
//builtin.datetime.time public bool TryToFindBuiltinDatetimeTime(CRMInfo info, LuisResult result) { EntityRecommendation entity; if (result.TryFindEntity("builtin.datetime.time", out entity)) { info.builtinDatetimeTime = entity.Entity.Replace(" ", ""); info.builtinDatetimeTimeResolution = entity.Resolution["time"]; } return(!String.IsNullOrWhiteSpace(info.activityText)); }
//判断停车场 public bool QueryParkingLot(CRMInfo info) { StringBuilder sb = new StringBuilder(); sb.Append("地下1楼、地下2楼、地下3楼都可以停车!"); sb.Append("<a href=\"http://www.baidu.com\">找车</a>!"); sb.Append("<a href=\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx1eb4cadd57ef7a2d&redirect_uri=http%3A%2F%2Fzdgc.andoner.com%2Fweixin%2Fzdgc%2Fprizedetail%2F%3Fprize%3D14&response_type=code&scope=snsapi_base&state=1#wechat_redirect\">领取优惠券</a>!"); info.replyString = sb.ToString(); return(!String.IsNullOrWhiteSpace(info.replyString)); }
public async Task None(IDialogContext context, LuisResult result) { //获取用户会话 CRMInfo info = crmservice.GetCustomerSession(TestCustomer); //清空数据 crmservice.ClearData(info, true); string message = $"您好!正大君不清楚您想要干什么?"; await context.PostAsync(message); context.Wait(MessageReceived); }
//判断特约商铺1 public bool JudgeMemberStore1(CRMInfo info) { //判断开始 if (!String.IsNullOrWhiteSpace(info.brandText)) { JudgeBrand3(info); } else { JudgeBusinessFormat1(info); } return(!String.IsNullOrWhiteSpace(info.replyString)); }
//判断基础信息1 public bool JudgeBasicInfo1(CRMInfo info) { //判断开始 if (!String.IsNullOrWhiteSpace(info.basicInfoText)) { JudgeBasicInfo2(info); } else { info.replyString = "正大君还不知道您想查询什么基础信息哦。您可以回答:停车场、停车费、营业时间等等"; } return(!String.IsNullOrWhiteSpace(info.replyString)); }
//判断活动1 public bool JudgeActivity1(CRMInfo info) { //判断开始 if (!String.IsNullOrWhiteSpace(info.activityText)) { JudgeActivity2(info); } else { JudgeActivity3(info); } return(!String.IsNullOrWhiteSpace(info.replyString)); }
//判断单品1 private bool JudgeActivity3(CRMInfo info) { //从数据库查询 try { activityService.JudgeActivity4(info, null); return(!String.IsNullOrWhiteSpace(info.replyString)); } catch (Exception e) { info.replyString += "我在JudgeActivity3报错啦" + e.ToString(); return(!String.IsNullOrWhiteSpace(info.replyString)); } }
public CRMInfo Convert(long?id) { CRMInfo crmInfo = new CRMInfo() { ID = (long)id, ProjectName = this.ProjectName, CustomerName = this.CustomerName, City = this.City, Sex = this.Sex, Date0fBirth = this.Date0fBirth.ToString(), Age = this.Age, Phone = this.Phone, IsMarry = this.IsMarry, EducationalBackground = this.EducationalBackground, NativePlace = this.NativePlace, WorkUnit = this.WorkUnit, OnTime = this.OnTime, WorkingLife = this.WorkingLife, WorkExperience = this.WorkExperience, FamilyComposition = this.FamilyComposition, HomeAddress = this.HomeAddress, FamilyInformation = this.FamilyInformation, PersonalHobbies = this.PersonalHobbies, FoodPreferences = this.Foodpreferences, Dress = this.Dress, Hobby = this.Hobby, TakeOfficeCompany = this.TakeOfficeCompany, SectionResponsibleFor = this.SectionResponsibleFor, DirectSupervisor = this.Directsupervisor, Team = this.Team, SalaryTreatment = this.salarytreatment, PersonalReputation = this.PersonalReputation, TheCurrentJobSatisfaction = this.TheCurrentJobSatisfaction, WithRunbowContactTime = this.WithRunbowContactTime, WithRunbowContactExperience = this.WithRunbowContactExperience, WithProjectsupplierContactTime = this.WithProjectsupplierContactTime, WithOther3PLContact = this.WithOther3PLContact, CRMTYPE = this.CRMtype, CreateTime = DateTime.Now.ToString("yyyy-MM-dd"), UpdateTime = DateTime.Now.ToString("yyyy-MM-dd") //// //City = this.City }; return(crmInfo); }
public async Task SayByeBye(IDialogContext context, LuisResult result) { //获取用户会话 CRMInfo info = crmservice.GetCustomerSession(TestCustomer); //清空数据 crmservice.ClearData(info, true); string message = $"很高兴为您服务,谢谢!"; //message += BaseInfo.wordDic["1"].name + BaseInfo.synonymDic["1"].name + BaseInfo.wordDic[BaseInfo.brandDic["1"].brand].name; await context.PostAsync(message); context.Wait(MessageReceived); }
//判断停车费 public bool QueryParkingFee(CRMInfo info) { StringBuilder sb = new StringBuilder(); sb.Append("首小时20元,每小时10元,当日90元封顶,20分钟内免费!"); sb.Append("<a href=\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxe2e0204163884264&redirect_uri=http%3A%2F%2Fwx.wztc.me%2Fwztc%2F%3FparkId%3D862100016%26integral%3Dnull&response_type=code&scope=snsapi_base&state=1#wechat_redirect\">快速交纳停车费</a>!"); sb.Append("<a href=\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx1eb4cadd57ef7a2d&redirect_uri=http%3A%2F%2Fzdgc.andoner.com%2Fweixin%2Fzdgc%2Fprizedetail%2F%3Fprize%3D14&response_type=code&scope=snsapi_base&state=1#wechat_redirect\">领取优惠券</a>!"); sb.Append("\u0002"); sb.Append("您尚未维护您的车牌信息,"); sb.Append("<a href=\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx1eb4cadd57ef7a2d&redirect_uri=http%3A%2F%2Fzdgc.andoner.com%2Fweixin%2Fzdgc%2Fpersonal&response_type=code&scope=snsapi_base&state=1#wechat_redirect\">完善个人资料</a>"); sb.Append("可以享受更多快捷服务!"); info.replyString = sb.ToString(); return(!String.IsNullOrWhiteSpace(info.replyString)); }
//清空数据 public void ClearData(CRMInfo info, bool intentFlag) { //存在顾客会话 if (customerDic.ContainsKey(info.customer)) { CRMInfo tmp = new CRMInfo(); //意图标志 true 删除意图 if (!intentFlag) { tmp.intent = info.intent; } tmp.customer = info.customer; customerDic[info.customer] = tmp; } }
protected void Del_Btn(object obj, EventArgs e) { LinkButton linkButton = obj as LinkButton; RepeaterItem repeaterItem = linkButton.Parent.Parent as RepeaterItem; HtmlInputCheckBox htmlInputCheckBox = repeaterItem.FindControl("chk") as HtmlInputCheckBox; int num = Convert.ToInt32(htmlInputCheckBox.Value); CRMInfo byId = CRM.Init().GetById(num); Help.DeleteFiles(byId.FilePath); string cmdText = "delete from CRM_Contact where cid=" + num; MsSqlOperate.ExecuteNonQuery(CommandType.Text, cmdText, new SqlParameter[0]); CRM.Init().Delete(num); this.Show(); }
public IEnumerable <CRMInfo> GetCRMInfo(CRMInfo Info, int PageIndex, int PageSize, out int RowCount) { string strSQL = this.GetSqlWhere(Info); DbParam[] dbParams = { new DbParam("@where", DbType.String, strSQL, ParameterDirection.Input), new DbParam("@PageIndex", DbType.Int32, PageIndex, ParameterDirection.Input), new DbParam("@PageSize", DbType.Int32, PageSize, ParameterDirection.Input), new DbParam("@RowCount", DbType.Int32, 0, ParameterDirection.Output) }; IEnumerable <CRMInfo> crmlist = base.ExecuteDataTable("Proc_GetCRMinfo", dbParams).ConvertToEntityCollection <CRMInfo>(); RowCount = (int)dbParams[3].Value; return(crmlist); }
//获取用户会话 public CRMInfo GetCustomerSession(String customer) { CRMInfo tmp = null; if (customerDic.ContainsKey(customer)) { tmp = customerDic[customer]; } else { tmp = new CRMInfo(); tmp.customer = customer; customerDic.Add(customer, tmp); } return(tmp); }
//判断有什么1 public bool JudgeHaveSomething1(CRMInfo info) { //判断开始 if (!String.IsNullOrWhiteSpace(info.brandText)) { JudgeBrand2(info); } else if (!String.IsNullOrWhiteSpace(info.productText)) { JudgeProduct1(info); } else { JudgeBusinessFormat1(info); } return(!String.IsNullOrWhiteSpace(info.replyString)); }
//判断品牌1 public bool JudgeBrand1(CRMInfo info) { //判断开始 if (!String.IsNullOrWhiteSpace(info.brandText)) { JudgeBrand2(info); } else if (!String.IsNullOrWhiteSpace(info.basicInfoText)) { JudgeBasicInfo2(info); } else { info.replyString = "正大君还不知道您想去哪哦。您可以回答:星巴克、同道大叔等等"; } return(!String.IsNullOrWhiteSpace(info.replyString)); }
//protected HtmlHead Head1; //protected HtmlForm form1; //protected Button Button1; //protected HtmlGenericControl CRM_Name1; //protected HtmlInputText ContactAim; //protected HtmlInputText ContactPeople; //protected HtmlInputText AddTime; //protected HtmlInputText ContactCharge; //protected CheckBoxList ContactChargeType; //protected CheckBoxList ContactType; //protected DropDownList ContactState; //protected HtmlTextArea ContactDetail; //protected Button save_bt; protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(base.Request.QueryString["cid"])) { this.c = base.Request.QueryString["cid"]; } if (!base.IsPostBack && !string.IsNullOrEmpty(base.Request.QueryString["cid"]) && !string.IsNullOrEmpty(base.Request.QueryString["ctid"])) { this.Show(base.Request.QueryString["cid"], base.Request.QueryString["ctid"]); } if (!base.IsPostBack && !string.IsNullOrEmpty(base.Request.QueryString["cid"])) { CRMInfo byId = CRM.Init().GetById(Convert.ToInt32(base.Request.QueryString["cid"])); this.ViewState["ci"] = byId; this.CRM_Name1.InnerText = byId.CRM_Name; } }
//判断优惠券2 public bool QueryCoupon2(CRMInfo info) { //查询品牌 t_brand brand = searchService.getBrandByName(info.brandText); if (null != brand) { StringBuilder sb = new StringBuilder(); if ("星巴克".Equals(BaseInfo.wordDic[brand.brand].name)) { sb.Append("tmpblank"); sb.Append("\u0001星巴克中杯兑换券"); sb.Append("\u0001点击查看小南国详情"); sb.Append("\u0001").Append(baseUrl).Append("/images/1F.png"); sb.Append("\u0001https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx1eb4cadd57ef7a2d&redirect_uri=http%3A%2F%2Fzdgc.andoner.com%2Fweixin%2Fzdgc%2Fprizedetail%2F%3Fprize%3D16&response_type=code&scope=snsapi_base&state=1#wechat_redirect"); sb.Append("\u0001星巴克买一送十兑换券"); sb.Append("\u0001点击查看小南国详情"); sb.Append("\u0001").Append(baseUrl).Append("/images/1F.png"); sb.Append("\u0001https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx1eb4cadd57ef7a2d&redirect_uri=http%3A%2F%2Fzdgc.andoner.com%2Fweixin%2Fzdgc%2Fprizedetail%2F%3Fprize%3D16&response_type=code&scope=snsapi_base&state=1#wechat_redirect"); sb.Append("\u0001星巴克买一送一百兑换券"); sb.Append("\u0001点击查看小南国详情"); sb.Append("\u0001").Append(baseUrl).Append("/images/1F.png"); sb.Append("\u0001https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx1eb4cadd57ef7a2d&redirect_uri=http%3A%2F%2Fzdgc.andoner.com%2Fweixin%2Fzdgc%2Fprizedetail%2F%3Fprize%3D16&response_type=code&scope=snsapi_base&state=1#wechat_redirect"); } else { sb.Append("对不起,").Append(BaseInfo.wordDic[brand.brand].name).Append("目前没有可以兑换的优惠券哦,"); sb.Append("<a href=\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx1eb4cadd57ef7a2d&redirect_uri=http%3A%2F%2Fzdgc.andoner.com%2Fweixin%2Fzdgc%2Fexchange&response_type=code&scope=snsapi_base&state=1#wechat_redirect\">点击这里</a>查看更多优惠信息!"); } info.replyString = sb.ToString(); } else { info.replyString = "对不起,您说的品牌" + info.brandText + "正大君没查询到哦。"; } return(!String.IsNullOrWhiteSpace(info.replyString)); }
public async Task QueryPoint(IDialogContext context, LuisResult result) { //获取用户会话 CRMInfo info = crmservice.GetCustomerSession(TestCustomer); info.intent = "积分"; info.VipFlag = false; //设置通用信息 crmservice.SetCommonInfo(info, context, result); if (crmservice.QueryPoint(info)) { await context.PostAsync(info.replyString); //清空数据 crmservice.ClearData(info, true); } context.Wait(MessageReceived); }
//判断优惠券 public bool QueryCoupon(CRMInfo info) { //判断开始 if (!String.IsNullOrWhiteSpace(info.brandText)) { QueryCoupon2(info); } else { StringBuilder sb = new StringBuilder(""); sb.Append("您好!正大君查询到的热门优惠券有“星巴克买一送十”,“KTV通宵欢唱”,“电影院5场连看”,"); sb.Append("<a href=\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx1eb4cadd57ef7a2d&redirect_uri=http%3A%2F%2Fzdgc.andoner.com%2Fweixin%2Fzdgc%2Fexchange&response_type=code&scope=snsapi_base&state=1#wechat_redirect\">点击这里</a>查看更多优惠信息!"); sb.Append("或者您可以告诉我您想查询哪家店的优惠券?"); info.replyString = sb.ToString(); } return(!String.IsNullOrWhiteSpace(info.replyString)); }
//判断基础信息2 public bool JudgeBasicInfo2(CRMInfo info) { //查询基础信息 t_basic_info basic_info = searchService.getBasicInfoByName(info.basicInfoText); if (null != basic_info) { StringBuilder sb = new StringBuilder(); sb.Append(basic_info.remark); info.replyString = sb.ToString(); } else { info.replyString = "对不起,您说的基础信息" + info.basicInfoText + "正大君没查询到哦。"; } return(!String.IsNullOrWhiteSpace(info.replyString)); }
//判断品牌2 public bool JudgeBrand2(CRMInfo info) { //查询品牌 t_brand brand = searchService.getBrandByName(info.brandText); if (null != brand) { StringBuilder sb = new StringBuilder(); sb.Append(BaseInfo.wordDic[brand.brand].name); sb.Append("在"); sb.Append(BaseInfo.wordDic[brand.floor].name); sb.Append(brand.house_number).Append("(门牌号)。"); if (TRUE_1 == brand.vip_flag) { sb.Append("是特约商户,可以积分哦。"); } //加入业态判断 List <t_brand_businessformat> list = searchService.getBusinessformatByBrandAndBf(brand.code, null); foreach (t_brand_businessformat bb in list) { if ("15".Equals(bb.businessformat_word_code) || "22".Equals(bb.businessformat_word_code) || "19".Equals(bb.businessformat_word_code) || "33".Equals(bb.businessformat_word_code)) { sb.Append("(可以接入点餐,订座,排队等第三方服务)!"); break; } else if ("27".Equals(bb.businessformat_word_code) || "34".Equals(bb.businessformat_word_code)) { sb.Append("(可以接入虚拟试衣,领取优惠券等第三方服务)!"); break; } } info.replyString = sb.ToString(); } else { info.replyString = "对不起,您说的品牌" + info.brandText + "正大君没查询到哦。"; } return(!String.IsNullOrWhiteSpace(info.replyString)); }
public async Task QueryCoupon(IDialogContext context, LuisResult result) { //string message = $"您好!正大君查询到的热门优惠券有“星巴克买一送十”,“KTV通宵欢唱”,“电影院5场连看”,更多优惠券请点击XXXXX。"; //await context.PostAsync(message); //context.Wait(MessageReceived); //获取用户会话 CRMInfo info = crmservice.GetCustomerSession(TestCustomer); info.intent = "查询优惠券"; info.VipFlag = false; //设置通用信息 crmservice.SetCommonInfo(info, context, result); if (crmservice.QueryCoupon(info)) { await context.PostAsync(info.replyString); //清空数据 crmservice.ClearData(info, false); } context.Wait(MessageReceived); }
//判断购物1 public bool JudgeBuy1(CRMInfo info) { //判断开始 if (!String.IsNullOrWhiteSpace(info.brandText)) { JudgeBrand2(info); } else if (!String.IsNullOrWhiteSpace(info.productText)) { JudgeProduct1(info); } else { if (String.IsNullOrWhiteSpace(info.businessFormatText)) { //TODO 根据顾客的基本资料来设定 info.businessFormatText = "女装"; } JudgeBusinessFormat1(info); } return(!String.IsNullOrWhiteSpace(info.replyString)); }
//public CRMInfo Items(SqlDataReader sdr) //{ // Runbow.TWS.Entity.CRM.CRMInfo crminfo = new Entity.CRM.CRMInfo(); // //change to ObjectTo... // crminfo.ID = sdr["ID"] != DBNull.Value ? sdr["ID"].ObjectToInt64() : Convert.ToInt64(DBNull.Value); // crminfo.ProjectName = sdr["ProjectName"] != DBNull.Value ? sdr["ProjectName"].ToString() : DBNull.Value.ToString(); // crminfo.CustomerName = sdr["CustomerName"] != DBNull.Value ? sdr["CustomerName"].ToString() : DBNull.Value.ToString(); // crminfo.City = sdr["City"] != DBNull.Value ? sdr["City"].ToString() : DBNull.Value.ToString(); // crminfo.Sex = sdr["Sex"] != DBNull.Value ? sdr["Sex"].ToString() : DBNull.Value.ToString(); // crminfo.Date0fBirth = sdr["Date0fBirth"] != DBNull.Value ? sdr["Date0fBirth"].ToString() : DBNull.Value.ToString(); // crminfo.Age = sdr["Age"] != DBNull.Value ? sdr["Age"].ToString() : DBNull.Value.ToString(); // crminfo.Phone = sdr["Phone"] != DBNull.Value ? sdr["Phone"].ToString() : DBNull.Value.ToString(); // crminfo.IsMarry = sdr["IsMarry"] != DBNull.Value ? sdr["IsMarry"].ToString() : DBNull.Value.ToString(); // crminfo.EducationalBackground = sdr["EducationalBackground"] != DBNull.Value ? sdr["EducationalBackground"].ToString() : DBNull.Value.ToString(); // crminfo.NativePlace = sdr["NativePlace"] != DBNull.Value ? sdr["NativePlace"].ToString() : DBNull.Value.ToString(); // crminfo.WorkUnit = sdr["WorkUnit"] != DBNull.Value ? sdr["WorkUnit"].ToString() : DBNull.Value.ToString(); // crminfo.OnTime = sdr["OnTime"] != DBNull.Value ? sdr["OnTime"].ToString() : DBNull.Value.ToString(); // crminfo.WorkingLife = sdr["WorkingLife"] != DBNull.Value ? sdr["WorkingLife"].ToString() : DBNull.Value.ToString(); // crminfo.WorkExperience = sdr["WorkExperience"] != DBNull.Value ? sdr["WorkExperience"].ToString() : DBNull.Value.ToString(); // crminfo.FamilyComposition = sdr["FamilyComposition"] != DBNull.Value ? sdr["FamilyComposition"].ToString() : DBNull.Value.ToString(); // crminfo.HomeAddress = sdr["HomeAddress"] != DBNull.Value ? sdr["HomeAddress"].ToString() : DBNull.Value.ToString(); // crminfo.FamilyInformation = sdr["FamilyInformation"] != DBNull.Value ? sdr["FamilyInformation"].ToString() : DBNull.Value.ToString(); // crminfo.PersonalHobbies = sdr["PersonalHobbies"] != DBNull.Value ? sdr["PersonalHobbies"].ToString() : DBNull.Value.ToString(); // crminfo.FoodPreferences = sdr["FoodPreferences"] != DBNull.Value ? sdr["FoodPreferences"].ToString() : DBNull.Value.ToString(); // crminfo.Dress = sdr["Dress"] != DBNull.Value ? sdr["Dress"].ToString() : DBNull.Value.ToString(); // crminfo.Hobby = sdr["Hobby"] != DBNull.Value ? sdr["Hobby"].ToString() : DBNull.Value.ToString(); // crminfo.TakeOfficeCompany = sdr["TakeOfficeCompany"] != DBNull.Value ? sdr["TakeOfficeCompany"].ToString() : DBNull.Value.ToString(); // crminfo.SectionResponsibleFor = sdr["SectionResponsibleFor"] != DBNull.Value ? sdr["SectionResponsibleFor"].ToString() : DBNull.Value.ToString(); // crminfo.DirectSupervisor = sdr["DirectSupervisor"] != DBNull.Value ? sdr["DirectSupervisor"].ToString() : DBNull.Value.ToString(); // crminfo.Team = sdr["Team"] != DBNull.Value ? sdr["Team"].ToString() : DBNull.Value.ToString(); // crminfo.SalaryTreatment = sdr["SalaryTreatment"] != DBNull.Value ? sdr["SalaryTreatment"].ToString() : DBNull.Value.ToString(); // crminfo.PersonalReputation = sdr["PersonalReputation"] != DBNull.Value ? sdr["PersonalReputation"].ToString() : DBNull.Value.ToString(); // crminfo.TheCurrentJobSatisfaction = sdr["TheCurrentJobSatisfaction"] != DBNull.Value ? sdr["TheCurrentJobSatisfaction"].ToString() : DBNull.Value.ToString(); // crminfo.WithRunbowContactTime = sdr["WithRunbowContactTime"] != DBNull.Value ? sdr["WithRunbowContactTime"].ToString() : DBNull.Value.ToString(); // crminfo.WithRunbowContactExperience = sdr["WithRunbowContactExperience"] != DBNull.Value ? sdr["WithRunbowContactExperience"].ToString() : DBNull.Value.ToString(); // crminfo.WithProjectsupplierContactTime = sdr["WithProjectsupplierContactTime"] != DBNull.Value ? sdr["WithProjectsupplierContactTime"].ToString() : DBNull.Value.ToString(); // crminfo.WithOther3PLContact = sdr["WithOther3PLContact"] != DBNull.Value ? sdr["WithOther3PLContact"].ToString() : DBNull.Value.ToString(); // crminfo.CRMTYPE = sdr["CRMTYPE"] != DBNull.Value ? sdr["CRMTYPE"].ToString() : DBNull.Value.ToString(); // crminfo.CreateTime = sdr["CreateTime"] != DBNull.Value ? sdr["CreateTime"].ToString() : DBNull.Value.ToString(); // crminfo.UpdateTime = sdr["UpdateTime"] != DBNull.Value ? sdr["UpdateTime"].ToString() : DBNull.Value.ToString(); // crminfo.Str1 = sdr["Str1"] != DBNull.Value ? sdr["Str1"].ToString() : DBNull.Value.ToString(); // crminfo.Str2 = sdr["Str2"] != DBNull.Value ? sdr["Str2"].ToString() : DBNull.Value.ToString(); // crminfo.Str3 = sdr["Str3"] != DBNull.Value ? sdr["Str3"].ToString() : DBNull.Value.ToString(); // crminfo.Str4 = sdr["Str4"] != DBNull.Value ? sdr["Str4"].ToString() : DBNull.Value.ToString(); // crminfo.Str5 = sdr["Str5"] != DBNull.Value ? sdr["Str5"].ToString() : DBNull.Value.ToString(); // crminfo.Str6 = sdr["Str6"] != DBNull.Value ? sdr["Str6"].ToString() : DBNull.Value.ToString(); // crminfo.Str7 = sdr["Str7"] != DBNull.Value ? sdr["Str7"].ToString() : DBNull.Value.ToString(); // crminfo.Str8 = sdr["Str8"] != DBNull.Value ? sdr["Str8"].ToString() : DBNull.Value.ToString(); // crminfo.Str9 = sdr["Str9"] != DBNull.Value ? sdr["Str9"].ToString() : DBNull.Value.ToString(); // crminfo.Str10 = sdr["Str10"] != DBNull.Value ? sdr["Str10"].ToString() : DBNull.Value.ToString(); // crminfo.Str11 = sdr["Str11"] != DBNull.Value ? sdr["Str11"].ToString() : DBNull.Value.ToString(); // crminfo.Str12 = sdr["Str12"] != DBNull.Value ? sdr["Str12"].ToString() : DBNull.Value.ToString(); // return crminfo; //} #endregion NoUse public CRMInfo AddCrm(CRMInfo CRMInfo) { using (SqlConnection conn = new SqlConnection(BaseAccessor._dataBase.ConnectionString)) { var CrmList = new List <CrmToDb>(); CrmList.Add(new CrmToDb(CRMInfo)); SqlCommand cmd = new SqlCommand("Proc_AddCrm", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@CrmData", CrmList); cmd.Parameters[0].SqlDbType = SqlDbType.Structured; cmd.Parameters.AddWithValue("@OutCrmID", 0); cmd.Parameters[1].Direction = ParameterDirection.Output; cmd.Parameters[1].SqlDbType = SqlDbType.BigInt; conn.Open(); cmd.ExecuteNonQuery(); CRMInfo.ID = cmd.Parameters[1].Value.ObjectToInt64(); return(CRMInfo); } }
//设置基础信息信息 public void SetCommonInfo(CRMInfo info, IDialogContext context, LuisResult result) { //设置品牌 bool brandFlag = TryToFindBrand(info, result); //设置业态 bool businessFormatFlag = TryToFindBusinessFormat(info, result); //设置楼层 bool floorFlag = TryToFindFloor(info, result); //设置单品 bool productFlag = TryToFindProduct(info, result); //设置基础信息 bool BasicInfoFlag = TryToFindBasicInfo(info, result); //设置互动 bool ActivityFlag = TryToFindActivity(info, result); //设置builtin.datetime.date bool builtinDateTimeDateFlag = TryToFindBuiltinDatetimeDate(info, result); //设置builtin.datetime.time bool builtinDateTimeTimeFlag = TryToFindBuiltinDatetimeTime(info, result); //设置导引 TryToGuide(info, result); }
//导引结果返回 public bool TryGuide(CRMInfo info) { var businessFormatText = info.businessFormatText; if (businessFormatText != null) { if (businessFormatText.Contains("东方明珠")) { info.replyString = "您要去东方明珠,请走东门上天桥左转。"; } else if (businessFormatText.Contains("国金")) { info.replyString = "您要去国金,请走东门上天桥右转。"; } else if (businessFormatText.Contains("2号线")) { info.replyString = "您要去2号线,请走东门上天桥右转,到平安银行大厦坐电梯从1号口进入。"; } else if (businessFormatText.Contains("滨江大道")) { info.replyString = "您要去滨江大道,请走西门二楼平台过道。"; } else if (businessFormatText.Contains("香格里拉")) { info.replyString = "您要去香格里拉,请走1楼侧门。"; } else { info.replyString = "请告知您想去哪里?"; } } else { info.replyString = "请告知您想去哪里?"; } return(!String.IsNullOrWhiteSpace(info.replyString)); }