protected void ddl_cityid_SelectedIndexChanged(object sender, EventArgs e) { string fiter = " parentid =" + this.ddl_cityid.SelectedValue; DataTable dtdict = new bllPaging().GetDataTableInfoBySQL("select * from [dbo].[areas] where " + fiter); BindDropDownListInfo(this.ddl_areaid, dtdict, "area", "areaid", 0); }
protected void ddl_areaid_SelectedIndexChanged(object sender, EventArgs e) { string fiter = " areaid =" + this.ddl_areaid.SelectedValue; DataTable dtdict = new bllPaging().GetDataTableInfoBySQL("select * from BusinessCenter where " + fiter); BindDropDownListInfo(this.ddl_sq, dtdict, "name", "id", 0); }
private void bindProvince() { DataTable dtdict = new bllPaging().GetDataTableInfoBySQL("select * from [dbo].[provinces]"); BindDropDownListInfo(this.ddl_provinceid, dtdict, "province", "provinceid", 0); ddl_provinceid_SelectedIndexChanged(null, null); }
/// <summary> /// 重新获取会员编号(memcode) /// </summary> public void ChangeMemCode(Dictionary <string, object> dicPar) { List <string> pra = new List <string>() { "GUID", "USER_ID" }; if (!CheckActionParameters(dicPar, pra)) { return; } var unionid = dicPar["USER_ID"].ToString(); DataTable dt = new bllPaging().GetDataTableInfoBySQL("select isnull(memcode,'') as memcode,isnull(mobile,'') as mobile from WX_members_wx where openid='" + unionid + "';"); if (dt != null && dt.Rows.Count > 0) { string memcode = dt.Rows[0]["memcode"].ToString(); string mobile = dt.Rows[0]["mobile"].ToString(); if (string.IsNullOrEmpty(memcode) || string.IsNullOrEmpty(mobile)) { ToCustomerJson("1", "暂无数据"); } else { ReturnListJson(dt); } } else { ToCustomerJson("1", "暂无数据"); } }
//修改手机号 public void ModifyMobile(Dictionary <string, object> dicPar) { ///要检测的参数信息 List <string> pra = new List <string>() { "GUID", "USER_ID", "newmobile" }; //检测方法需要的参数 if (!CheckActionParameters(dicPar, pra)) { return; } string GUID = dicPar["GUID"].ToString(); string USER_ID = dicPar["USER_ID"].ToString(); string newmobile = dicPar["newmobile"].ToString(); int count = new bllPaging().ExecuteNonQueryBySQL("update wx_members_wx set mobile='' where mobile='" + newmobile + "';update wx_members_wx set mobile='" + newmobile + "' where openid='" + USER_ID + "';declare @memcode varchar(32); select top 1 @memcode=memcode from members WHERE wxaccount='" + USER_ID + "'; exec dbo.p_members_changemobile_wx @memcode,'" + newmobile + "','','用户自己';--delete from wx_cardinfo where openid='" + USER_ID + "' and left(cardcode,1)<>'E';"); if (count >= 0) { ToCustomerJson("0", "更改成功"); } else { ToCustomerJson("1", "更改失败"); } }
private void BindDDL() { int recnums, pagenums; DataTable dtdict = new bllPaging().GetDataTableInfoBySQL("select * from [dbo].[provinces]"); BindDropDownListInfo(this.ddl_provinceid, dtdict, "province", "provinceid", 2); }
private void SetPage(string discode) { TB_DishEntity disEntity = bll.GetEntitySigInfo("DisCode='" + discode + "'"); if (disEntity != null && !string.IsNullOrWhiteSpace(disEntity.DisCode)) { ddlStore.SelectedValue = disEntity.StoCode; txt_disname.Value = disEntity.DisName; txt_disothername.Value = disEntity.OtherName; txt_quickcode.Value = disEntity.QuickCode; txt_selunit.Value = disEntity.Unit; txt_price.Value = disEntity.Price.ToString("f2"); txt_costprice.Value = disEntity.CostPrice.ToString("f2"); txt_remark.Value = disEntity.Descript; TB_DishTypeEntity typeEntity = new bllTB_DishType().GetEntitySigInfo(" PKCode='" + disEntity.TypeCode + "' "); if (typeEntity != null && !string.IsNullOrWhiteSpace(typeEntity.PKCode)) { ddl_selDisheType.SelectedValue = typeEntity.PKKCode; ddl_selDisheType_SelectedIndexChanged(null, null); ddl_sel_dishetypetwo.SelectedValue = disEntity.TypeCode; } } DataTable dtImage = new bllPaging().GetPagingInfo("TR_DishImage", "id", "*", int.MaxValue, 1, "discode='" + discode + "'", "", "", out int recnums, out int pagenums); if (dtImage != null) { string imageHtml = ""; foreach (DataRow dr in dtImage.Rows) { imageHtml += "<img imgindex=\"\" width=\"200\" height=\"200\" style=\"float: left; margin - left:6px; \" src=\"/UploadFiles" + dr["ImgUrl"] + "\" onclick=\"deleteimage(this, '')\" />"; } HidImagesHtml.Value = imageHtml; } }
//开卡(电子卡) private void OpenMemCard(Dictionary <string, object> dicPar) { //要检测的参数信息 List <string> pra = new List <string>() { "GUID", "USER_ID" }; //检测方法需要的参数 if (!CheckActionParameters(dicPar, pra)) { return; } string GUID = dicPar["GUID"].ToString(); string USER_ID = dicPar["USER_ID"].ToString(); string memid = string.Empty; string memcode = string.Empty; string mescode = string.Empty; string count = new bllPaging().ExecuteScalarBySQL("select count(*) from members where wxaccount='" + USER_ID + "';"); if (Helper.StringToInt(count) > 0) { ToCustomerJson("1", "已开卡"); } else { bll.OpenMemcard("weixin", "88888888", "WXXL", USER_ID, "0", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "0", "1", "1", "1", "", ""); ToCustomerJson("0", "发卡成功"); } }
/// <summary> /// 绑定列表 /// </summary> protected override void BindGridView() { int recount; int pagenums; string order = string.Format("{0} {1}", HidSortExpression.Value, HidOrder.Value); if (HidSortExpression.Value == "") { order = " stocode asc"; } DataTable dt = bll.GetPagingListInfo("0", "0", anp_top.PageSize, anp_top.CurrentPageIndex, HidWhere.Value, order, out recount, out pagenums); if (dt != null) { dt.Columns.Add("statusname", typeof(string)); for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["statusname"] = dt.Rows[i]["status"].ToString() == "1" ? "有效" : "无效"; } gv_list.DataSource = dt; gv_list.DataBind(); anp_top.RecordCount = recount; } DataTable dtdict = new bllPaging().GetDataTableInfoBySQL("select * from [dbo].[provinces]"); BindDropDownListInfo(this.ddl_provinceid, dtdict, "province", "provinceid", 1); ddl_provinceid_SelectedIndexChanged(null, null); }
//发送消息 public void SendMsg(Dictionary <string, object> dicPar) { //要检测的参数信息 List <string> pra = new List <string>() { "GUID", "USER_ID", "type", "msgtitle", "msgcontent" }; //检测方法需要的参数 if (!CheckActionParameters(dicPar, pra)) { return; } string GUID = dicPar["GUID"].ToString(); string USER_ID = dicPar["USER_ID"].ToString(); string type = dicPar["type"].ToString(); string msgtitle = dicPar["msgtitle"].ToString(); string msgcontent = dicPar["msgcontent"].ToString(); var sql = "insert into WX_usermessage values('" + USER_ID + "','" + type + "','0','" + msgcontent + "','" + msgtitle + "',getdate(),'0');"; int count = new bllPaging().ExecuteNonQueryBySQL(sql); if (count >= 0) { ToCustomerJson("0", "操作成功"); } else { ToCustomerJson("2", "网络繁忙,请稍后再试"); } }
/// <summary> /// 将消息置为已读 /// </summary> /// <param name="dicPar"></param> public void UpdateMyMesStatus(Dictionary <string, object> dicPar) { //要检测的参数信息 List <string> pra = new List <string>() { "GUID", "USER_ID", "id" }; //检测方法需要的参数 if (!CheckActionParameters(dicPar, pra)) { return; } string GUID = dicPar["GUID"].ToString(); string USER_ID = dicPar["USER_ID"].ToString(); string id = dicPar["id"].ToString(); int count = new bllPaging().ExecuteNonQueryBySQL("update WX_usermessage set status='1' where id='" + id + "';"); if (count >= 0) { ToCustomerJson("0", "操作成功"); } else { ToCustomerJson("2", "网络繁忙,请稍后再试"); } }
/// <summary> /// 获取门店信息 /// </summary> /// <param name="dicPar"></param> public void GetStoreList(Dictionary <string, object> dicPar) { //要检测的参数信息 List <string> pra = new List <string>() { "GUID", "USER_ID", "keywords" }; //检测方法需要的参数 if (!CheckActionParameters(dicPar, pra)) { return; } string GUID = dicPar["GUID"].ToString(); string USER_ID = dicPar["USER_ID"].ToString(); string keywords = dicPar["keywords"].ToString(); if (string.IsNullOrEmpty(keywords)) { keywords = "##########"; } DataTable dt = new bllPaging().GetDataTableInfoBySQL("select cname as stoname from store where cname like '%" + keywords + "%' and stocode not in ('12','18','zhcc001','LZKJ','WXXL','PLAYH5');"); if (dt != null && dt.Rows.Count > 0) { ReturnListJson(dt); } else { ToCustomerJson("1", "暂无数据"); } }
//读取投诉信息 public void ReadComplain(Dictionary <string, object> dicPar) { //要检测的参数信息 List <string> pra = new List <string>() { "GUID", "USER_ID", "id" }; //检测方法需要的参数 if (!CheckActionParameters(dicPar, pra)) { return; } string GUID = dicPar["GUID"].ToString(); string USER_ID = dicPar["USER_ID"].ToString(); string id = dicPar["id"].ToString(); var sql = "update WX_Complaints set isread='1' where actId=" + id; int count = new bllPaging().ExecuteNonQueryBySQL(sql); if (count >= 0) { ToCustomerJson("0", "操作成功"); } else { ToCustomerJson("2", "网络繁忙,请稍后再试"); } }
protected void ddl_provinceid_SelectedIndexChanged(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(ddl_provinceid.SelectedValue)) { string fiter = " parentid =" + this.ddl_provinceid.SelectedValue; DataTable dtdict = new bllPaging().GetDataTableInfoBySQL("select * from [dbo].[provinces] where" + fiter); BindDropDownListInfo(this.ddl_cityid, dtdict, "city", "cityid", 2); ddl_cityid_SelectedIndexChanged(null, null); } }
protected void ddl_cityid_SelectedIndexChanged(object sender, EventArgs e) { if (!string.IsNullOrEmpty(ddl_cityid.SelectedValue)) { int recnums, pagenums; string fiter = " parentid =" + this.ddl_cityid.SelectedValue; DataTable dtdict = new bllPaging().GetDataTableInfoBySQL("select * from [dbo].[areas] where " + fiter); BindDropDownListInfo(this.ddl_areaid, dtdict, "area", "areaid", 2); } }
/// <summary> /// 绑定列表 /// </summary> protected override void BindGridView() { string sql = "select top 5 [mobile],[smscontent]=substring(smscontent,1,charindex('|',smscontent,1)-1),[sendtime] from SendSmsLogs " + HidWhere.Value + " order by id desc "; DataTable dt = new bllPaging().GetDataTableInfoBySQL(sql); if (dt != null) { gv_list.DataSource = dt; gv_list.DataBind(); } }
public void BindRole() { DataTable dt = new bllPaging().GetDataTableInfoBySQL("select roleid,cname from roles where status='1';"); this.ddl_rolename.DataSource = dt; this.ddl_rolename.DataTextField = "cname"; this.ddl_rolename.DataValueField = "roleid"; this.ddl_rolename.DataBind(); this.ddl_rolename.Items.Insert(0, new ListItem("全部", "")); }
private void BindDDL() { int recnums, pagenums; DataTable dtdict = new bllPaging().GetDataTableInfoBySQL("select * from [dbo].[provinces]"); BindDropDownListInfo(this.ddl_provinceid, dtdict, "province", "provinceid", 2); DataTable idType = new bllts_Dicts().GetPagingListInfoByParentCode("", "", int.MaxValue, 1, "IdType", "", out recnums, out pagenums); BindDropDownListInfo(this.ddl_idtype, idType, "dicname", "diccode", 2); }
//获取城市及所属商圈 private void GetCityAndShopCircles(Dictionary <string, object> dicPar) { //要检测的参数信息 List <string> pra = new List <string>() { "GUID", "USER_ID" }; //检测方法需要的参数 if (!CheckActionParameters(dicPar, pra)) { return; } DataSet ds = new bllPaging().GetDataSetInfoBySQL("select distinct cityid,dbo.fnGetCity(cityid) as ctiyname from store where status='1' and stocode not in ('12','18','zhcc001','LZKJ','PLAYH5','WXXL') and status='1';select sqcode,sqname,city from sqinfo where status='1' and isdelete='0';"); if (ds.Tables.Count == 2) { DataTable dtCityInfo = ds.Tables[0]; DataTable dtSqInfo = ds.Tables[1]; if (dtCityInfo != null && dtCityInfo.Rows.Count > 0) { String jsonStr = "{\"status\":\"0\",\"mes\":\"获取数据成功\",\"data\":["; foreach (DataRow dr in dtCityInfo.Rows) { string cityStr = dr["cityid"].ToString(); jsonStr += "{\"citycode\":\"" + cityStr + "\",\"cityname\":\"" + dr["ctiyname"].ToString() + "\",\"shopcityinfo\":["; DataRow[] dr_arr = dtSqInfo.Select(" city='" + cityStr + "'"); for (int i = 0; i < dr_arr.Length; i++) { jsonStr += "{\"code\":\"" + dr_arr[i]["sqcode"] + "\",\"name\":\"" + dr_arr[i]["sqname"] + "\"},"; } jsonStr = jsonStr.TrimEnd(','); jsonStr += "]},"; } jsonStr = jsonStr.TrimEnd(','); jsonStr += "]}"; ToJsonStr(jsonStr); } else { ToCustomerJson("1", "暂无数据"); } } else { ToCustomerJson("2", "网络繁忙,请稍后再试"); } }
//优惠券退回(使用)(0:退回 1:使用) private void ReturnOrUseCoupon(Dictionary <string, object> dicPar) { ///要检测的参数信息 List <string> pra = new List <string>() { "GUID", "USER_ID", "couponcodes", "type" }; //检测方法需要的参数 if (!CheckActionParameters(dicPar, pra)) { return; } string GUID = dicPar["GUID"].ToString(); string USER_ID = dicPar["USER_ID"].ToString(); string couponcodes = dicPar["couponcodes"].ToString(); string type = dicPar["type"].ToString(); int count = 0; try { string strSql = "update coupon set status='" + type + "',checkstocode='WXXL',checkucode='线上用户',checkperson='线上用户',checktime=getdate() where checkcode in (select col from dbo.fn_StringSplit('" + couponcodes.Trim(',') + "',','));if ('" + type + "'='1') begin declare @id varchar(max);set @id=''; select @id=@id+convert(varchar(20),cid)+',' from coupon where checkcode in (select col from dbo.fn_StringSplit('" + couponcodes.Trim(',') + "',',')); exec [dbo].[p_coupon_transDrawCoupon] @id; end"; //ErrorLog.WriteLogMessage("1111", strSql); count = new bllPaging().ExecuteNonQueryBySQL(strSql); } catch (Exception ex) { ErrorLog.WriteErrorMessage(ex); } if (count >= 0) { ToCustomerJson("0", "操作成功"); } else { ToCustomerJson("2", "网络繁忙,请稍后再试"); } }
//获取用户优惠券数量 private void GetCouponNumber(Dictionary <string, object> dicPar) { ///要检测的参数信息 List <string> pra = new List <string>() { "GUID", "USER_ID", "memcode" }; //检测方法需要的参数 if (!CheckActionParameters(dicPar, pra)) { return; } string GUID = dicPar["GUID"].ToString(); string USER_ID = dicPar["USER_ID"].ToString(); //string memcode = dicPar["memcode"].ToString(); string count = new bllPaging().ExecuteScalarBySQL("select count(membercoupon.cid) from membercoupon left join dbo.coupon on membercoupon.cid=coupon.cid left join N_maincoupon mc on coupon.mccode = mc.mccode left join N_sumcoupon sc on mc.sumcode=sc.sumcode where sc.ctype='0' and cardcode in(select cardcode from wx_cardinfo where openid='" + USER_ID + "' and status='1') and dbo.coupon.status ='0';"); ToCustomerJson(count, "获取数据成功"); }
/// <summary> /// 获取用户打赏信息(展示用户打赏基本信息) /// </summary> /// <param name="dicPar"></param> public void UserRewardInfo(Dictionary <string, object> dicPar) { //要检测的参数信息 List <string> pra = new List <string>() { "GUID", "USER_ID", "empcode" }; //检测方法需要的参数 if (!CheckActionParameters(dicPar, pra)) { return; } string GUID = dicPar["GUID"].ToString(); string USER_ID = dicPar["USER_ID"].ToString(); string empcode = dicPar["empcode"].ToString(); int count = 0; DataTable dtUserInfo = new bllPaging().GetDataTableInfoBySQL("select strcode,cname from employee where ecode='" + empcode + "' and status='1';"); if (dtUserInfo != null && dtUserInfo.Rows.Count > 0) { string stocode = dtUserInfo.Rows[0]["strcode"].ToString(); string cname = dtUserInfo.Rows[0]["cname"].ToString(); dt = bllr.GetWXRewardInfo(empcode, stocode); if (dt != null && dt.Rows.Count > 0) { string jsonStr1 = "{\"status\":\"0\",\"mes\":\"获取数据成功\",\"data\":["; foreach (DataRow row in dt.Rows) { if (string.IsNullOrEmpty(row["moneyset"].ToString())) { count = 1; break; } else { jsonStr1 += "{\"mcount\":\"" + row["moneys"] + "\",\"points\":\"" + row["points"] + "\",\"moneyset\":\"" + row["moneyset"] + "\",\"cname\":\"" + cname + "\"}"; } } if (count == 0) { jsonStr1 += "]}"; ToJsonStr(jsonStr1); } else { ToCustomerJson("1", "当前门店未开启打赏功能"); } } else { ToCustomerJson("1", "当前门店未开启打赏功能"); } } else { ToCustomerJson("1", "员工信息异常"); } }
/// <summary> /// 设置页面信息 /// </summary> /// <param name="id">ID</param> private void SetPage(string stoid) { bllStore bll = new bllStore(); DataTable dt = bll.GetPagingSigInfo("0", "0", " where stoid='" + stoid + "'"); if (dt != null && dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; //引用分公司表company的公司编号字段comcode的值 comcode.InnerHtml = dr["comcode"].ToString(); //引用商户表Business的商户编号字段buscode的值 //buscode.InnerHtml = dr["buscode"].ToString(); //门店编号 stocode.InnerHtml = dr["stocode"].ToString(); //门店名称 cname.InnerHtml = dr["cname"].ToString(); //门店简称 sname.InnerHtml = dr["sname"].ToString(); //门店简码 bcode.InnerHtml = dr["bcode"].ToString(); //所属行业 //indcode.InnerHtml = dr["indcode"].ToString(); //所在省 provinceid.InnerHtml = dr["provinceid"].ToString(); //所在城市 //cityid.InnerHtml = dr["cityid"].ToString(); //所在区 //areaid.InnerHtml = dr["areaid"].ToString(); //门店地址 address.InnerHtml = dr["address"].ToString(); //负责人 stoprincipal.InnerHtml = dr["stoprincipal"].ToString(); //负责人联系电话 stoprincipaltel.InnerHtml = dr["stoprincipaltel"].ToString(); //门店电话 tel.InnerHtml = dr["tel"].ToString(); //门店邮箱 stoemail.InnerHtml = dr["stoemail"].ToString(); //门店Logo logo.Src = dr["logo"].ToString(); //门店背景图 //backgroundimg.Src = dr["backgroundimg"].ToString(); //门店描述 descr.InnerHtml = dr["descr"].ToString(); //门店网址 stourl.InnerHtml = dr["stourl"].ToString(); //X坐标 stocoordx.InnerHtml = dr["stocoordx"].ToString(); //Y坐标 stocoordy.InnerHtml = dr["stocoordy"].ToString(); hidLvData.Value = dr["services"].ToString(); //最后联网时间 //netlinklasttime.InnerHtml = dr["netlinklasttime"].ToString(); calcutime.InnerHtml = DateTime.Parse(dr["calcutime"].ToString()).ToShortDateString(); buscode.InnerHtml = dr["busname"].ToString(); status.InnerHtml = dr["status"].ToString() == "1" ? "有效" : "无效"; DataTable dtgx = new bllPaging().GetDataTableInfoBySQL("select jprice,[dbo].fnGetDistsName(firtype) as stname,ptype,stopath from storegx where stocode='" + dr["stocode"].ToString() + "'"); if (dtgx != null && dtgx.Rows.Count > 0) { storetype.InnerHtml = dtgx.Rows[0]["stname"].ToString(); string paytypes = dtgx.Rows[0]["ptype"].ToString(); jprice.InnerHtml = dtgx.Rows[0]["jprice"].ToString(); hidstopath.Value = dtgx.Rows[0]["stopath"].ToString(); if (paytypes == "0") { paytype.InnerHtml = "先支付"; } else { paytype.InnerHtml = "后支付"; } } } }