private void RptBind(string _strWhere, string _orderby) { Model.wx_userweixin weixin = GetWeiXinCode(); _strWhere = "sId=" + sid + " " + _strWhere; this.page = MXRequest.GetQueryInt("page", 1); txtKeywords.Text = this.keywords; DataSet ds = uBll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); //计算级别 if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { BLL.wx_ucard_udegree degreeBll = new BLL.wx_ucard_udegree(); IList <Model.wx_ucard_udegree> degreelist = degreeBll.GetModelList("sid=" + sid); DataRow dr; int count = ds.Tables[0].Rows.Count; for (int i = 0; i < count; i++) { dr = ds.Tables[0].Rows[i]; int score = MyCommFun.Obj2Int(dr["ttScore"]); dr["jibie"] = ComputeJiBie(score, degreelist); ds.AcceptChanges(); } } this.rptList.DataSource = ds; this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("user_list.aspx?id=" + sid, "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
protected void rptList_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataRowView drv = (DataRowView)e.Item.DataItem; Literal ltr = e.Item.FindControl("litShow") as Literal; Literal litStatus = e.Item.FindControl("litStatus") as Literal; string km = drv["km"].ToString(); string carnum = drv["carnum"].ToString(); int yid = MyCommFun.Obj2Int(drv["id"]); string orderStatus = drv["ddstatus"].ToString(); if (type == 1)//保养 { ltr.Text = "<dd class=\"tbox\"><div><label>车牌:</label></div>" + "<div><label>" + carnum + "</label></div></dd>" + "<dd class=\"tbox\"><div><label>公里:</label></div><div><label>" + km + "</label></div></dd>"; } if (orderStatus == "待回复") { litStatus.Text = "<em class=\"no\">等待客服回电</em>"; } else if (orderStatus == "拒绝") { litStatus.Text = "<em class=\"red\">您的请求被拒绝</em>"; } else if (orderStatus == "确认") { litStatus.Text = "<em class=\"green\">客服已回复</em>"; } } }
private bool DoEdit(int _id) { bool result = false; #region Model 赋值 //全局唯一键 ModelInfo.ID = _id; //产品名称 ModelInfo.pName = this.txt_pName.Text.Trim(); //排序序号 ModelInfo.pSortNum = MyCommFun.Obj2Int(this.txtSortid.Text.ToString()); //备注 ModelInfo.sRemark = this.txt_Remark.Text.Trim(); #endregion if (bll.Update(ModelInfo)) { AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改会员:" + ModelInfo.pName); //记录日志 result = true; } return(result); }
/// <summary> /// 从内存中取得所有下级类别列表(自身迭代) /// </summary> private void GetChilds(DataTable oldData, DataTable newData, int parent_id) { DataRow[] dr = oldData.Select("parentId=" + parent_id); for (int i = 0; i < dr.Length; i++) { //添加一行数据 DataRow row = newData.NewRow(); row["id"] = int.Parse(dr[i]["id"].ToString()); row["tName"] = dr[i]["tName"].ToString(); row["parentId"] = int.Parse(dr[i]["parentId"].ToString()); row["tCode"] = dr[i]["tCode"].ToString(); row["class_layer"] = int.Parse(dr[i]["class_layer"].ToString()); row["sort_id"] = int.Parse(dr[i]["sort_id"].ToString()); row["tUrl"] = dr[i]["tUrl"].ToString(); row["icoPic"] = dr[i]["icoPic"].ToString(); row["remark"] = dr[i]["remark"].ToString(); row["wid"] = dr[i]["wid"].ToString(); row["store_id"] = MyCommFun.Obj2Int(dr[i]["store_id"]); row["storeName"] = dr[i]["storeName"].ToString(); row["tel"] = dr[i]["tel"].ToString(); row["daohangurl"] = dr[i]["daohangurl"].ToString(); row["showDefault"] = dr[i]["showDefault"] == null ? "0" : dr[i]["showDefault"]; newData.Rows.Add(row); //调用自身迭代 this.GetChilds(oldData, newData, int.Parse(dr[i]["id"].ToString())); } }
private bool DoEdit(int _id) { bool result = false; #region Model 赋值 //全局唯一键 ModelInfo.ID = _id; //产品编号 ModelInfo.sProductNum = MyCommFun.ObjToStr(productID); //产品规格 ModelInfo.sName = this.txt_sName.Text.Trim(); //排序序号 ModelInfo.sSortNum = MyCommFun.Obj2Int(this.txtSortid.Text.ToString()); //计量单位 ModelInfo.sUnit = this.txt_sUnit.Text; //重量 ModelInfo.sWeight = MyCommFun.Obj2Decimal(this.txt_sWeight.Text, 0); //体积 ModelInfo.sVolume = MyCommFun.Obj2Decimal(this.txt_sVolume.Text, 0); //价格 ModelInfo.sPrice = MyCommFun.Obj2Decimal(this.txt_sPrice.Text, 0); //备注 //ModelInfo.sRemark = this.txt_Remark.Text.Trim(); #endregion if (bll.Update(ModelInfo)) { AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改产品规格:" + ModelInfo.sName); //记录日志 result = true; } return(result); }
/// <summary> /// 通过存储过程获得用户的优惠券id /// </summary> /// <param name="sid">店铺主键id</param> /// <param name="uid">用户主键id</param> /// <param name="degreeNum">用户级别</param> /// <param name="ttcMoney">用户总的消费金额</param> /// <returns>返回优惠券id主键字符串,使用英文逗号(,)隔开 </returns> public string getUserTicketStr(int sid, int uid, int degreeNum, decimal ttcMoney) { string ticketidStr = ""; int ret = 0; SqlParameter[] parameters = { new SqlParameter("@sid", SqlDbType.Int, 4), new SqlParameter("@uid", SqlDbType.Int, 4), new SqlParameter("@degreeNum", SqlDbType.Int, 4), new SqlParameter("@ttcMoney", SqlDbType.Decimal), new SqlParameter("@ticketidStr", SqlDbType.VarChar, 100) }; parameters[0].Value = sid; parameters[1].Value = uid; parameters[2].Value = degreeNum; parameters[3].Value = ttcMoney; parameters[4].Value = ""; parameters[4].Direction = ParameterDirection.Output; SqlDataReader sr = DbHelperSQL.RunProcedure("p_ticket", parameters); sr.Close(); ret = MyCommFun.Obj2Int(parameters[2].Value); ticketidStr = MyCommFun.ObjToStr(parameters[4].Value); return(ticketidStr); }
/// <summary> /// 查询该月的消费信息 /// </summary> /// <param name="user"></param> /// <param name="month">如果为0,则表示当月的数据,</param> private void bindMonthXFinfo(Model.wx_ucard_users user, int month) { int year = DateTime.Now.Year; int todayMonth = DateTime.Now.Month; if (month == 0) { month = todayMonth; } IList <Model.wx_ucard_users_consumeinfo> clist = cBll.GetModelList("sId=" + sid + " and uid=" + user.id + " and moduleType!='签到' and year(addTime)=" + year + " and month(addTime)=" + month + " order by addTime desc"); StringBuilder xfSb = new StringBuilder(""); decimal ttMoney = 0; int ttScore = 0; if (clist != null && clist.Count > 0) { Model.wx_ucard_users_consumeinfo c = new Model.wx_ucard_users_consumeinfo(); for (int i = 0; i < clist.Count; i++) { c = clist[i]; xfSb.Append("<tr><td>" + c.addTime.Value.ToString("yyyy-MM-dd") + "</td> <td>" + MyCommFun.Obj2Decimal(c.consumeMoney, 0) + "</td> <td>" + MyCommFun.Obj2Int(c.score) + "</td> </tr>"); ttMoney += MyCommFun.Obj2Decimal(c.consumeMoney, 0); ttScore += MyCommFun.Obj2Int(c.score); } BindDaysDetailInfo(clist); } litXFStr.Text = xfSb.ToString(); litttMoney.Text = ttMoney.ToString(); litttScore.Text = ttScore.ToString(); }
private void RptBind(string _strWhere, string _orderby) { Model.wx_userweixin weixin = GetWeiXinCode(); this.page = MXRequest.GetQueryInt("page", 1); txtKeywords.Text = this.keywords; BLL.orders bll = new BLL.orders(); DataSet ds = bll.GetList(weixin.id, this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);; if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { DataRow dr; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { dr = ds.Tables[0].Rows[i]; dr["statusName"] = GetOrderStatus(MyCommFun.Obj2Int(dr["id"]), MyCommFun.Obj2Int(dr["status"]), MyCommFun.Obj2Int(dr["payment_status"]), MyCommFun.Obj2Int(dr["express_status"])); } } this.rptList.DataSource = ds; this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("order_confirm.aspx", "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private void ShowInfo(int _id) { BLL.wx_wq_pinpai ppBll = new BLL.wx_wq_pinpai(); BLL.wx_wq_chexi cxBll = new BLL.wx_wq_chexi(); Model.wx_wq_yyOrder model = bll.GetModel(_id); if (type == 1)//保养 { this.pelShow.Visible = true; this.lblCarnum.Text = model.carnum; this.lblKm.Text = model.km.ToString(); } else //试驾 { this.pelShow.Visible = false; } string pinpai = ppBll.GetModel(MyCommFun.Obj2Int(model.pid)).name; string chexi = cxBll.GetModel(MyCommFun.Obj2Int(model.xid)).Name; this.lblObj.Text = pinpai + "/" + chexi; this.lblremark.Text = model.remark; this.lblTelephone.Text = model.telephone.ToString(); this.lblYYPerson.Text = model.Name; this.lblYytime.Text = MyCommFun.Obj2DateTime(model.yydate).ToString("yyyy-MM-dd") + "/" + model.yytime; this.lblXdtime.Text = MyCommFun.Obj2DateTime(model.createdate).ToString("yyyy年MM月dd日 hh:mm:ss点"); this.txtfSummary.InnerText = model.kfremark; this.ddlStatus.SelectedValue = model.ddstatus; }
private void RptBind(string _strWhere, int aid) { _strWhere = "baseid=" + aid; DataSet ds = gbll.GetList(_strWhere); int ttCount = 0; if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { ttCount = MyCommFun.Obj2Int(ds.Tables[0].Compute("sum(tpTimes)", "TRUE")); DataRow dr; int count = ds.Tables[0].Rows.Count; for (int i = 0; i < count; i++) { dr = ds.Tables[0].Rows[i]; //totalnum+= Convert.ToInt32(ds.Tables[0].Rows[i]["tpTimes"]);//总数 //百分比totalnum // baifenbi = Convert.ToInt32(ds.Tables[0].Rows[i]["tpTimes"]) / totalnum; if (dr["tpTimes"] == null || dr["tpTimes"].ToString().Trim() == "") { dr["tpTimes"] = 0; } dr["bili"] = computeBL(ttCount, MyCommFun.Obj2Int(dr["tpTimes"])); } ds.AcceptChanges(); } this.rptList.DataSource = ds; this.rptList.DataBind(); }
/// <summary> /// 取幻灯片信息 /// </summary> /// <param name="wid"></param> /// <param name="topNum">取前几条数据,若为-1,则取全部的数据</param> public IList <Model.article> GetHDPByWid(int wid, int topNum) { IList <Model.article> hdpList = new List <Model.article>(); StringBuilder strSql = new StringBuilder(); strSql.Append("select "); if (topNum >= 0) { strSql.Append(" top " + topNum + " "); } strSql.Append("id,title,link_url,img_url,content,sort_id from dt_article where channel_id=3 and category_id=1 "); strSql.Append(" and wId=@wId order by sort_id asc"); SqlParameter[] parameters = { new SqlParameter("@wId", SqlDbType.Int, 4) }; parameters[0].Value = wid; SqlDataReader sr = DbHelperSQL.ExecuteReader(strSql.ToString(), parameters); Model.article hdp = new Model.article(); while (sr.Read()) { hdp = new Model.article(); hdp.id = MyCommFun.Obj2Int(sr["id"]); hdp.title = MyCommFun.ObjToStr(sr["title"]); hdp.link_url = MyCommFun.ObjToStr(sr["link_url"]); hdp.img_url = MyCommFun.ObjToStr(sr["img_url"]); hdp.content = MyCommFun.ObjToStr(sr["content"]); hdp.sort_id = MyCommFun.Obj2Int(sr["sort_id"]); hdpList.Add(hdp); } sr.Close(); return(hdpList); }
/// <summary> /// 获得特价 /// </summary> /// <returns></returns> public DataTable getSpecialOffer() { Tag tag = this.Document.CurrentRenderingTag; var attribute = tag.Attributes["rows"]; int rows = -1;//若为-1,则不做限制条件 if (attribute != null && MyCommFun.isNumber(attribute.Value.GetValue())) { rows = MyCommFun.Obj2Int(attribute.Value.GetValue()); } DAL.wx_shop_product artDal = new DAL.wx_shop_product(); productlist = artDal.GetList(wid, rows, "specialOffer=" + 1); DataTable dt = productlist.Tables[0]; if (productlist != null && productlist.Tables.Count > 0 && productlist.Tables[0].Rows.Count > 0) { DataRow dr; for (int i = 0; i < productlist.Tables[0].Rows.Count; i++) { dr = productlist.Tables[0].Rows[i]; if (dr["link_url"] != null && dr["link_url"].ToString().Trim().Length > 0) { dr["link_url"] = MyCommFun.urlAddOpenid(dr["link_url"].ToString().Trim(), openid); } else { dr["link_url"] = MyCommFun.urlAddOpenid("detail.aspx?wid=" + wid + "&pid=" + dr["id"].ToString(), openid); } productlist.AcceptChanges(); } } return(dt); }
/// <summary> /// 获得该分类信息,使用wid仅仅作为限制条件 /// </summary> /// <param name="wid"></param> /// <param name="id"></param> /// <returns></returns> public Model.wx_shop_category GetCategoryByWid(int wid, int id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1"); strSql.Append(" id,title,code,parent_id,class_list,class_layer,sort_id,link_url,img_url,class_content,remark,seo_title,seo_keywords,seo_description,wid,ico_url "); strSql.Append(" from wx_shop_category where id=@id and wid=@wid"); SqlParameter[] parameters = { new SqlParameter("@id", SqlDbType.Int, 4), new SqlParameter("@wid", SqlDbType.Int, 4) }; parameters[0].Value = id; parameters[1].Value = wid; SqlDataReader sr = DbHelperSQL.ExecuteReader(strSql.ToString(), parameters); Model.wx_shop_category category = new Model.wx_shop_category(); while (sr.Read()) { category = new Model.wx_shop_category(); category.id = MyCommFun.Obj2Int(sr["id"]); category.title = MyCommFun.ObjToStr(sr["title"]); category.parent_id = MyCommFun.Obj2Int(sr["parent_id"]); category.class_layer = MyCommFun.Obj2Int(sr["class_layer"]); category.link_url = MyCommFun.ObjToStr(sr["link_url"]); category.img_url = MyCommFun.ObjToStr(sr["img_url"]); category.class_content = MyCommFun.ObjToStr(sr["class_content"]); category.ico_url = MyCommFun.ObjToStr(sr["ico_url"]); category.seo_title = MyCommFun.ObjToStr(sr["seo_title"]); category.seo_keywords = MyCommFun.ObjToStr(sr["seo_keywords"]); category.seo_description = MyCommFun.ObjToStr(sr["seo_description"]); } sr.Close(); return(category); }
/// <summary> /// 取中奖的项目 /// </summary> /// <param name="itemlist">所有的奖品信息</param> /// <param name="haszjlist">已经中奖的列表</param> /// <returns></returns> private Model.wx_sttAwardItem getZJItem(IList <Model.wx_sttAwardItem> itemlist, IList <Model.wx_sttAwardUser> haszjlist) { IList <Model.wx_sttAwardItem> zjItemlist = new List <Model.wx_sttAwardItem>();//剩余奖品列表 Model.wx_sttAwardItem tmpItem = new Model.wx_sttAwardItem(); Model.wx_sttAwardItem stmpItem = new Model.wx_sttAwardItem(); IList <Model.wx_sttAwardUser> thiszjRs; for (int i = 0; i < itemlist.Count; i++) { tmpItem = itemlist[i]; thiszjRs = (from user in haszjlist where user.jpName == tmpItem.jpName select user).ToArray <Model.wx_sttAwardUser>(); int tmpSYNum = 0; if (thiszjRs != null) { tmpSYNum = MyCommFun.Obj2Int(tmpItem.jpRealNum) - thiszjRs.Count; } if (tmpSYNum <= 0) { continue; } for (int j = 0; j < tmpSYNum; j++) { stmpItem = new Model.wx_sttAwardItem(); stmpItem.jpName = tmpItem.jpName; stmpItem.jxName = tmpItem.jxName; zjItemlist.Add(stmpItem); } } Random rd = new Random((int)DateTime.Now.Ticks); int jpIndex = rd.Next(0, zjItemlist.Count);//从0到zjItemlist.Count里随机出一个值 return(zjItemlist[jpIndex]); }
/// <summary> /// 取幻灯片信息 /// </summary> /// <param name="wid"></param> /// <param name="topNum">取前几条数据,若为-1,则取全部的数据</param> public IList <Model.wx_shop_indexbanner> GetHDPByWid(int wid, int topNum) { IList <Model.wx_shop_indexbanner> hdpList = new List <Model.wx_shop_indexbanner>(); StringBuilder strSql = new StringBuilder(); strSql.Append("select "); if (topNum >= 0) { strSql.Append(" top " + topNum + " "); } strSql.Append(" * from wx_shop_indexbanner "); strSql.Append(" where wid=@wid order by sort_id asc,id asc"); SqlParameter[] parameters = { new SqlParameter("@wid", SqlDbType.Int, 4) }; parameters[0].Value = wid; SqlDataReader sr = DbHelperSQL.ExecuteReader(strSql.ToString(), parameters); Model.wx_shop_indexbanner hdp = new Model.wx_shop_indexbanner(); while (sr.Read()) { hdp = new Model.wx_shop_indexbanner(); hdp.id = MyCommFun.Obj2Int(sr["id"]); hdp.bannerName = MyCommFun.ObjToStr(sr["bannerName"]); hdp.bannerPicUrl = MyCommFun.ObjToStr(sr["bannerPicUrl"]); hdp.bannerLinkUrl = MyCommFun.ObjToStr(sr["bannerLinkUrl"]); hdp.remark = MyCommFun.ObjToStr(sr["remark"]); hdp.sort_id = MyCommFun.Obj2Int(sr["sort_id"]); hdpList.Add(hdp); } sr.Close(); return(hdpList); }
private void ShowInfo(int id) { hidid.Value = id.ToString(); Model.wx_ucard_users user = uBll.GetModel(id); txtrealName.Text = user.realName; lblcardNo.Text = user.cardNo; lblopenid.Text = user.openid; //等级 BLL.wx_ucard_udegree degreeBll = new wx_ucard_udegree(); IList <Model.wx_ucard_udegree> degreelist = degreeBll.GetModelList("sid=" + sid); int degreeNum = 0; string jibie = ""; jibie = BLL.wx_ucard_fun.userDegree(id, MyCommFun.Obj2Int(user.ttScore), jibie, out degreeNum); lblDegree.Text = jibie; rblSex.SelectedValue = user.sex == null ? "3" : user.sex.Value.ToString(); txtwxName.Text = user.wxName; txtage.Text = user.age == null?"0":user.age.ToString(); txtttScore.Text = MyCommFun.ObjToStr(user.ttScore); txtqdScore.Text = MyCommFun.ObjToStr(user.qdScore); txtconsumeScore.Text = MyCommFun.ObjToStr(user.consumeScore); txtconsumeMoney.Text = MyCommFun.ObjToStr(user.consumeMoney); txtregTime.Text = MyCommFun.Obj2DateTime(user.regTime).ToString("yyyy-MM-dd HH:mm:ss"); txtendDate.Text = MyCommFun.Obj2DateTime(user.endDate).ToString("yyyy-MM-dd HH:mm:ss"); txtmobile.Text = MyCommFun.ObjToStr(user.mobile); txtaddr.Text = MyCommFun.ObjToStr(user.addr); }
/// <summary> /// 获得某个分类下的文章 /// </summary> /// <returns></returns> public DataSet getArticleByCategory() { Tag tag = this.Document.CurrentRenderingTag; var attribute = tag.Attributes["rows"]; var categoryid = tag.Attributes["categoryid"]; // int category_id = MyCommFun.Obj2Int(categoryid.Text); int category_id = MyCommFun.Obj2Int(categoryid.Value.GetValue()); int rows = -1;//若为-1,则不做限制条件 if (attribute != null && MyCommFun.isNumber(attribute.Value.GetValue())) { rows = MyCommFun.Obj2Int(attribute.Value.GetValue()); } DataSet ds = tDal.GetPc_Article(category_id, "", rows, " sort_id asc "); if (ds != null && ds.Tables.Count > 0) { DataRow dr; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { dr = ds.Tables[0].Rows[i]; if (dr["link_url"] == null || dr["link_url"].ToString().Trim() == "") { //如果link_url为空,则直接调用本系统的信息 dr["link_url"] = "javascript:;"; } } } return(ds); }
protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e) { int id = MyCommFun.Obj2Int(e.CommandArgument); switch (e.CommandName) { case "View": Response.Redirect(string.Format("hotel_room_info.aspx?action={0}&hotelid={1}&roomid={2}", MXEnums.ActionEnum.View.ToString(), hotelid, id)); break; case "Edit": Response.Redirect(string.Format("hotel_room_info.aspx?action={0}&hotelid={1}&roomid={2}", MXEnums.ActionEnum.Edit.ToString(), hotelid, id)); break; case "Audit": Response.Redirect(string.Format("hotel_room_info.aspx?action={0}&hotelid={1}&roomid={2}", MXEnums.ActionEnum.Audit.ToString(), hotelid, id)); break; case "Publish": manageBll.ManageRoom(id, Model.RoomStatus.Publish, GetAdminInfo().id, "发布", ""); AddAdminLog("Publish", string.Format("酒店商品【id={0}】发布。", id)); JscriptMsg("发布成功!", Utils.CombUrlTxt("hotel_room.aspx", "action={0}&hotelid={1}&keywords={2}", action, hotelid.ToString(), this.keywords), "Success"); break; case "SoldOut": manageBll.ManageRoom(id, Model.RoomStatus.SoldOut, GetAdminInfo().id, "下架", ""); AddAdminLog("SoldOut", string.Format("酒店商品【id={0}】下架。", id)); JscriptMsg("下架成功!", Utils.CombUrlTxt("hotel_room.aspx", "action={0}&hotelid={1}&keywords={2}", action, hotelid.ToString(), this.keywords), "Success"); break; } }
protected void Page_Load(object sender, EventArgs e) { wid = MyCommFun.RequestInt("wid"); fid = MyCommFun.RequestInt("fid"); id = MyCommFun.RequestInt("id"); int pid = MyCommFun.RequestInt("pid"); openid = MyCommFun.QueryString("openid"); if (!IsPostBack) { BLL.wx_fc_panorama pBll = new BLL.wx_fc_panorama(); Model.wx_fc_panorama pModel = null; if (pid != 0)//当页面从户型页面过来 { id = getPid(pid); pModel = pBll.GetModel(MyCommFun.Obj2Int(id)); } else//当页面从全景图页面过来 { pModel = pBll.GetModel(MyCommFun.Obj2Int(id)); } title = pModel.jdname; this.Title = title; } }
/// <summary> /// 获得单页文章列表:优点:(1)使用function标签与foreach结合,可以从模版页面控制记录数量;(2)不需要实现注册到模版里 /// </summary> /// <returns></returns> public IList <Model.article> getDanyeList() { Tag tag = this.Document.CurrentRenderingTag; var attribute = tag.Attributes["rows"]; IList <Model.article> artlist = new List <Model.article>(); int rows = -1;//若为-1,则不做限制条件 if (attribute != null && MyCommFun.isNumber(attribute.Value.GetValue())) { rows = MyCommFun.Obj2Int(attribute.Value.GetValue()); } artlist = tDal.GetDanYeByWid(wid, rows); if (artlist != null && artlist.Count > 0) { Model.article cat = new Model.article(); for (int i = 0; i < artlist.Count; i++) { cat = artlist[i]; if (cat.link_url == null || cat.link_url.Trim() == "") { //如果link_url为空,则直接调用本系统的信息 cat.link_url = MyCommFun.urlAddOpenid("content.aspx?wid=" + wid + "&aid=" + cat.id.ToString(), openid); //"http://localhost:820/content.aspx?wid=5&aid=112"; } else { cat.link_url = MyCommFun.urlAddOpenid(cat.link_url, openid); } } } return(artlist); }
private bool DoAdd() { #region Model 赋值 //产品编号 ModelInfo.sProductNum = MyCommFun.ObjToStr(productID); //产品规格 ModelInfo.sName = this.txt_sName.Text.Trim(); //排序序号 ModelInfo.sSortNum = MyCommFun.Obj2Int(this.txtSortid.Text.ToString()); //计量单位 ModelInfo.sUnit = this.txt_sUnit.Text; //重量 ModelInfo.sWeight = MyCommFun.Obj2Decimal(this.txt_sWeight.Text, 0); //体积 ModelInfo.sVolume = MyCommFun.Obj2Decimal(this.txt_sVolume.Text, 0); //价格 ModelInfo.sPrice = MyCommFun.Obj2Decimal(this.txt_sPrice.Text, 0); //备注 //ModelInfo.sRemark = this.txt_Remark.Text.Trim(); #endregion if (bll.Insert(ModelInfo) > 0) { AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加产品规格:" + ModelInfo.sName); //记录日志 return(true); } return(false); }
/// <summary> /// 获得幻灯片列表二:优点:(1)使用function标签与foreach结合,可以从模版页面控制记录数量;(2)不需要实现注册到模版里 /// </summary> /// <returns></returns> public IList <Model.wx_shop_indexbanner> getHdp() { Tag tag = this.Document.CurrentRenderingTag; var attribute = tag.Attributes["rows"]; IList <Model.wx_shop_indexbanner> artlist = new List <Model.wx_shop_indexbanner>(); int rows = -1;//若为-1,则不做限制条件 if (attribute != null && MyCommFun.isNumber(attribute.Value.GetValue())) { rows = MyCommFun.Obj2Int(attribute.Value.GetValue()); } MxWeiXinPF.DAL.wx_shop_indexbanner sibDal = new DAL.wx_shop_indexbanner(); artlist = sibDal.GetHDPByWid(wid, rows); if (artlist != null && artlist.Count > 0) { Model.wx_shop_indexbanner cat = new Model.wx_shop_indexbanner(); for (int i = 0; i < artlist.Count; i++) { cat = artlist[i]; if (cat.bannerLinkUrl == null || cat.bannerLinkUrl.Trim() == "") { //如果link_url为空,则直接调用本系统的信息 cat.bannerLinkUrl = "javascript:;"; } else { cat.bannerLinkUrl = MyCommFun.urlAddOpenid(cat.bannerLinkUrl, openid); } } } return(artlist); }
private bool DoEdit(int _id) { bool result = false; #region Model 赋值 //全局唯一键 ModelInfo.ID = _id; //存放仓库 ModelInfo.WareHouse = ddl_WareHouse.SelectedValue; //客户姓名 ModelInfo.CustomerName = txt_CustomerName.Text.Trim(); //移动电话 ModelInfo.Mobile = txt_Mobile.Text.Trim(); //固定电话 ModelInfo.Tel = txt_Tel.Text.Trim(); //代发银行 ModelInfo.BankName = ddl_BankName.SelectedValue; //银行账号 ModelInfo.BankAccount = txt_BankAccount.Text.Trim(); //户名 ModelInfo.AccountName = txt_AccountName.Text.Trim(); //产品名称ID ModelInfo.ProjectId = MyCommFun.Obj2Int(ddl_ProductName.SelectedValue); //产品名称 ModelInfo.ProductName = ddl_ProductName.SelectedItem.Text; //产品规格ID ModelInfo.ProductStandardId = MyCommFun.Obj2Int(ddl_ProductStandard.SelectedValue); //产品规格名称 ModelInfo.ProductStandard = ddl_ProductStandard.SelectedItem.Text; //单位 ModelInfo.Unit = txt_Unit.Text.Trim(); //毛重 ModelInfo.GrossWeight = MyCommFun.Obj2Decimal(txt_GrossWeight.Text, 0); //皮重 ModelInfo.Tare = MyCommFun.Obj2Decimal(txt_Tare.Text, 0); //净重 ModelInfo.NetWeight = MyCommFun.Obj2Decimal(txt_NetWeight.Value, 0); //价格 ModelInfo.Price = MyCommFun.Obj2Decimal(txt_Price.Text, 0); //金额 ModelInfo.Amount = MyCommFun.Obj2Decimal(txt_Amount.Value, 0); //备注 ModelInfo.Remark = this.txt_Remark.Text.Trim(); //修改人 ModelInfo.ModifyPerson = manager_model.real_name; //修改时间 ModelInfo.ModifyTime = DateTime.Now; #endregion if (bll.Update(ModelInfo)) { AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改收料单:" + ModelInfo.BNum); //记录日志 result = true; } return(result); }
private bool DoAdd() { #region Model 赋值 //收料编号 ModelInfo.BNum = Item.BLL.Common.GetMinSerial.GetMinBH("T_Bill", "BNum", DateTime.Now.ToString("yyMMdd"), 4); //存放仓库 ModelInfo.WareHouse = ddl_WareHouse.SelectedValue; //客户姓名 ModelInfo.CustomerName = txt_CustomerName.Text.Trim(); //移动电话 ModelInfo.Mobile = txt_Mobile.Text.Trim(); //固定电话 ModelInfo.Tel = txt_Tel.Text.Trim(); //代发银行 ModelInfo.BankName = ddl_BankName.SelectedValue; //银行账号 ModelInfo.BankAccount = txt_BankAccount.Text.Trim(); //户名 ModelInfo.AccountName = txt_AccountName.Text.Trim(); //产品名称ID ModelInfo.ProjectId = MyCommFun.Obj2Int(ddl_ProductName.SelectedValue); //产品名称 ModelInfo.ProductName = ddl_ProductName.SelectedItem.Text; //产品规格ID ModelInfo.ProductStandardId = MyCommFun.Obj2Int(ddl_ProductStandard.SelectedValue); //产品规格名称 ModelInfo.ProductStandard = ddl_ProductStandard.SelectedItem.Text; //单位 ModelInfo.Unit = txt_Unit.Text.Trim(); //毛重 ModelInfo.GrossWeight = MyCommFun.Obj2Decimal(txt_GrossWeight.Text, 0); //皮重 ModelInfo.Tare = MyCommFun.Obj2Decimal(txt_Tare.Text, 0); //净重 ModelInfo.NetWeight = MyCommFun.Obj2Decimal(txt_NetWeight.Value, 0); //价格 ModelInfo.Price = MyCommFun.Obj2Decimal(txt_Price.Text, 0); //金额 ModelInfo.Amount = MyCommFun.Obj2Decimal(txt_Amount.Value, 0); //备注 ModelInfo.Remark = this.txt_Remark.Text.Trim(); //添加人 ModelInfo.AddPerson = manager_model.real_name; //添加时间 ModelInfo.AddTime = DateTime.Now; #endregion result = bll.Insert(ModelInfo); if (result > 0) { AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加收料单:" + ModelInfo.BNum); //记录日志 return(true); } return(false); }
//保存 protected void btnSubmit_Click(object sender, EventArgs e) { BLL.wx_payment_wxpay wxpayBll = new wx_payment_wxpay(); int id = MyCommFun.Obj2Int(hidId.Value, 0); Model.wx_payment_wxpay wxpayModel = new Model.wx_payment_wxpay(); Model.wx_userweixin weixin = GetWeiXinCode(); if (id == 0) { //新增 wxpayModel.wid = weixin.id; wxpayModel.createDate = DateTime.Now; } else { //修改 wxpayModel = wxpayBll.GetModel(id); } wxpayModel.mch_id = txtmch_id.Text.Trim(); wxpayModel.paykey = txtpaykey.Text.Trim(); wxpayModel.certInfoPath = txtcertInfoPath.Text.Trim(); wxpayModel.cerInfoPwd = txtcerInfoPwd.Text.Trim(); bool ret = false; if (id == 0) { wxpayModel.createDate = DateTime.Now; int retNum = wxpayBll.Add(wxpayModel); if (retNum > 0) { ret = true; } } else { ret = wxpayBll.Update(wxpayModel); } //OpenOAuth开启 BLL.wx_property_info propertyBll = new wx_property_info(); string pValue = radOpenOAuth.SelectedItem.Value; propertyBll.AddProperty(weixin.id, MXEnums.WXPropertyKeyName.OpenOauth.ToString(), pValue); if (ret) { JscriptMsg("修改信息成功!", "baseSetting.aspx", "Success"); } else { JscriptMsg("修改信息成功!", "", "Error"); return; } }
//保存 protected void btnSubmit_Click(object sender, EventArgs e) { Model.wx_userweixin weixin = GetWeiXinCode(); int id = MyCommFun.Str2Int(hidid.Value); #region //先判断 string strErr = ""; if (this.txtarea.Text.Trim().Length == 0) { strErr += "区域不能为空!"; } if (strErr != "") { JscriptMsg(strErr, "back", "Error"); return; } #endregion Model.wx_ucard_store_fendian fendian = new Model.wx_ucard_store_fendian(); if (id > 0) { fendian = fdBll.GetModel(id); } fendian.area = txtarea.Text.Trim(); fendian.addr = txtaddr.Text.Trim(); fendian.xPoint = MyCommFun.Str2Decimal(txtLatXPoint.Text); fendian.yPoint = MyCommFun.Str2Decimal(txtLngYPoint.Text); fendian.sort_id = MyCommFun.Obj2Int(txtSortId.Text.Trim()); fendian.tel = txttel.Text.Trim(); fendian.sId = sid; if (id <= 0) { ChkAdminLevel("ucard_fd", MXEnums.ActionEnum.Add.ToString()); //检查权限 //新增 fendian.createDate = DateTime.Now; //1新增主表 id = fdBll.Add(fendian); AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加会员卡分店,主键为" + id); //记录日志 JscriptMsg("添加会员卡分店成功!", "store_fendian.aspx?id=" + sid, "Success"); } else { ChkAdminLevel("ucard_fd", MXEnums.ActionEnum.Edit.ToString()); //检查权限 //修改 //1修改主表 fdBll.Update(fendian); AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改会员卡分店,主键为" + id); //记录日志 JscriptMsg("修改会员卡分店成功!", "store_fendian.aspx?id=" + sid, "Success"); } }
//保存 protected void btnSubmit_Click(object sender, EventArgs e) { decimal accb = MyCommFun.Obj2Decimal(txtaccountBalance.Text.Trim(), -1); if (accb == -1) { JscriptMsg("余额输入有错误!", "", "Error"); return; } BLL.wx_xjhongbao_base wxpayBll = new wx_xjhongbao_base(); int id = MyCommFun.Obj2Int(hidId.Value, 0); Model.wx_xjhongbao_base baseModel = new Model.wx_xjhongbao_base(); if (id == 0) { //新增 Model.wx_userweixin weixin = GetWeiXinCode(); baseModel.wid = weixin.id; baseModel.createDate = DateTime.Now; baseModel.totalLQMoney = 0; } else { //修改 baseModel = wxpayBll.GetModel(id); } baseModel.accountBalance = (int)(accb * 100); baseModel.remark = txtremark.Value.Trim(); bool ret = false; if (id == 0) { int retNum = wxpayBll.Add(baseModel); if (retNum > 0) { ret = true; } } else { ret = wxpayBll.Update(baseModel); } if (ret) { JscriptMsg("修改信息成功!", "basesetting.aspx", "Success"); } else { JscriptMsg("保存过程中发生错误!", "", "Error"); return; } }
private void bindData() { BLL.wx_ucard_cardinfo cardBll = new BLL.wx_ucard_cardinfo(); Model.wx_ucard_cardinfo cardinfo = cardBll.GetModelBySid(sid); if (cardinfo != null) { imgTopPic.ImageUrl = cardinfo.noticePic; } BLL.wx_ucard_users userBll = new BLL.wx_ucard_users(); Model.wx_ucard_users user = userBll.GetStoreUserInfo(openid, sid); if (user == null) { return; } int degreeNum = 0; BLL.wx_ucard_fun.userDegree(sid, MyCommFun.Obj2Int(user.ttScore), "", out degreeNum); BLL.wx_ucard_notice nBll = new BLL.wx_ucard_notice(); IList <Model.wx_ucard_notice> nlist = nBll.GetModelList(" sid=" + sid + " and ( userDegree ='0' or userDegree like '%," + degreeNum + ",%' ) order by createDate desc"); StringBuilder noticeStr = new StringBuilder(); if (nlist != null && nlist.Count > 0) { Model.wx_ucard_notice notice = new Model.wx_ucard_notice(); for (int i = 0; i < nlist.Count; i++) { notice = nlist[i]; if (i == 0) { //第一条数据 noticeStr.Append("<div id=\"test0-header\" class=\"accordion_headings header_highlight \">"); noticeStr.Append(" <div class=\"tab new \">"); noticeStr.Append(" <span class=\"title\">" + notice.nName + "<p>" + notice.createDate.Value.ToString("yyyy年MM月dd日") + "</p>"); noticeStr.Append(" </span></div>"); noticeStr.Append(" <div id=\"test0-content\" style=\"display: block; overflow: hidden; opacity: 1;\"> "); noticeStr.Append("<div class=\"accordion_child\"><p class=\"xiangqing\">"); noticeStr.Append(notice.nContent); noticeStr.Append(" </p></div></div></div>"); } else { noticeStr.Append("<div id=\"test" + i + "-header\" class=\"accordion_headings \">"); noticeStr.Append("<div class=\"tab \">"); noticeStr.Append("<span class=\"title\">" + notice.nName + "<p>" + notice.createDate.Value.ToString("yyyy年MM月dd日") + "</p></span>"); noticeStr.Append("</div>"); noticeStr.Append(" <div id=\"test" + i + "-content\" style=\"display: none; overflow: hidden;\">"); noticeStr.Append("<div class=\"accordion_child\">"); noticeStr.Append("<p class=\"xiangqing\">" + notice.nContent + "</p>"); noticeStr.Append("</div> </div> </div>"); } } } litNoticeList.Text = noticeStr.ToString(); }
//保存 protected void btnSubmit_Click(object sender, EventArgs e) { Model.wx_userweixin weixin = GetWeiXinCode(); int id = MyCommFun.Str2Int(hidid.Value); #region //先判断 string strErr = ""; if (this.txtadverName.Text.Trim().Length == 0) { strErr += "广告位名称不能为空!"; } if (this.txtImgUrl.Text.Trim().Length == 0) { strErr += "广告图片不能为空!"; } if (strErr != "") { JscriptMsg(strErr, "back", "Error"); return; } #endregion Model.wx_ucard_adver adver = new Model.wx_ucard_adver(); if (id > 0) { adver = avderBll.GetModel(id); } adver.adverName = txtadverName.Text.Trim(); adver.picUrl = txtImgUrl.Text.Trim(); adver.linkUrl = txtlinkUrl.Text.Trim(); adver.sort_id = MyCommFun.Obj2Int(txtSortId.Text.Trim()); if (id <= 0) { //新增 adver.wid = weixin.id; adver.createDate = DateTime.Now; //1新增主表 id = avderBll.Add(adver); AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加会员卡商城头部广告位,主键为" + id); //记录日志 JscriptMsg("添加会员卡商城头部广告位成功!", "business_adver_list.aspx", "Success"); } else { //修改 //1修改主表 avderBll.Update(adver); AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改会员卡商家,主键为" + id); //记录日志 JscriptMsg("修改会员卡商城头部广告位成功!", "business_adver_list.aspx", "Success"); } }
private void RptBind(string _strWhere, string _orderby) { Model.wx_userweixin weixin = GetWeiXinCode(); //判断是否已经设置了微留言基本信息 BLL.wx_sjb_bisai sbll = new BLL.wx_sjb_bisai(); BLL.wx_sjb_qiudui qdBll = new BLL.wx_sjb_qiudui(); string qdName = ""; _strWhere = "rcId=" + richengid + " " + _strWhere; this.page = MXRequest.GetQueryInt("page", 1); txtKeywords.Text = this.keywords; DataSet ds = gbll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); // DataSet ds = gbll.GetList( _strWhere); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { DataRow dr; DateTime begin = new DateTime(); DateTime end = new DateTime(); int count = ds.Tables[0].Rows.Count; for (int i = 0; i < count; i++) { dr = ds.Tables[0].Rows[i]; dr["qd1Name"] = qdBll.GetQuiDuiName(MyCommFun.Obj2Int(dr["qd1Id"])); dr["qd2Name"] = qdBll.GetQuiDuiName(MyCommFun.Obj2Int(dr["qd2Id"])); begin = MyCommFun.Obj2DateTime(dr["beginDate"]); end = MyCommFun.Obj2DateTime(dr["endDate"]); if (begin > DateTime.Now) { dr["status_s"] = "<span class=\"act_before\">未开始</span>"; } else if (end <= DateTime.Now) { dr["status_s"] = "<span class=\"act_end\">已结束</span>"; } else { dr["status_s"] = "<span class=\"act_in\">进行中</span>"; } } ds.AcceptChanges(); } this.rptList.DataSource = ds; this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("bisai_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }