/v1.0/YxShop/YXShop.TemplateAction/Lable/LabelParse_SendGroupBuyInfo.cs
C# | 211 lines | 199 code | 8 blank | 4 comment | 46 complexity | b2073baf86860d753976741a5892bbb9 MD5 | raw file
Possible License(s): LGPL-3.0, Apache-2.0, LGPL-2.1
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Data;
-
- namespace YXShop.TemplateAction
- {
- public partial class LabelParse
- {
- /// <summary>
- /// FS:LabelType=Other??????
- /// </summary>
- /// <returns></returns>
- public string SendGroupBuyInfo()
- {
- string reStr = string.Empty;
- string mystyle = this.Label_Inserted;
- string str_ShowType = this.GetParamValue("YX:ShowType");
- string str_ShowMode = this.GetParamValue("YX:ShowMode");
- string str_CompositorType = this.GetParamValue("YX:CompositorType");
- string str_CompositorField = this.GetParamValue("YX:CompositorField");
- string str_ShowRows = this.GetParamValue("YX:ShowRows");
- string str_ShowColumns = this.GetParamValue("YX:ShowColumns");
- string str_WhetherOmit=this.GetParamValue("YX:WhetherOmit");
- string str_NameCharacter = this.GetParamValue("YX:NameCharacter");
- string str_WhetherPagination = this.GetParamValue("YX:WhetherPagination");
- string str_TempletLayout = this.GetParamValue("YX:TempletLayout");
- string str_BewriteCharacter = this.GetParamValue("YX:BewriteCharacter");
- string cond = string.Empty;
- StringBuilder shtml = new StringBuilder();
- YXShop.Common.SysParameter sp = new YXShop.Common.SysParameter();
- int ShowRows = 1;//???
- if (!string.IsNullOrEmpty(str_ShowRows))
- {
- if (ChangeHope.Common.ValidateHelper.IsNumber(str_ShowRows))
- {
- ShowRows = Convert.ToInt32(str_ShowRows);//???
- }
- }
-
- int ShoeColumns = 1;//???
- if (!string.IsNullOrEmpty(str_ShowColumns))
- {
- if (ChangeHope.Common.ValidateHelper.IsNumber(str_ShowColumns))
- {
- ShoeColumns = Convert.ToInt32(str_ShowColumns);
- }
- }
- int pagesize=ShowRows*ShoeColumns;
- int NameCharacter = 20;//?????????
- if (!string.IsNullOrEmpty(str_NameCharacter))
- {
- if (ChangeHope.Common.ValidateHelper.IsNumber(str_NameCharacter))
- {
- NameCharacter = Convert.ToInt32(str_NameCharacter);//?????????
- }
- }
-
- int BewriteCharacter = 40;//?????????
- if (!string.IsNullOrEmpty(str_BewriteCharacter))
- {
- if (ChangeHope.Common.ValidateHelper.IsNumber(str_BewriteCharacter))
- {
- BewriteCharacter = Convert.ToInt32(str_BewriteCharacter);//?????????
- }
- }
-
- if (ChangeHope.Common.ValidateHelper.IsNumber(str_ShowMode))
- {
- if (str_ShowMode == "1")
- {
- int productid = ChangeHope.WebPage.PageRequest.GetQueryInt("q_productid");
- if (productid > 0)
- {
- cond += " and productid=" + productid + "";
- }
- }
- }
-
- if (!string.IsNullOrEmpty(str_ShowType))
- {
- if (str_ShowType == "1")
- {
- cond += " and state<>0";
- }
- }
-
- string OrderField=string.Empty;
- if(!string.IsNullOrEmpty(str_CompositorType))
- {
- if(str_CompositorField=="desc")
- {
- OrderField+=" [order by] id desc";
- }
- else
- {
- OrderField+=" [order by] id asc";
- }
- }
- string WhetherOmit = "";
- if (str_WhetherOmit == "true")
- {
- WhetherOmit = "...";
- }
- if (!string.IsNullOrEmpty(mystyle))
- {
- YXShop.BLL.Product.Product_SendGroupBuyInfo bll = new YXShop.BLL.Product.Product_SendGroupBuyInfo();
- YXShop.BLL.Product.GroupBuy_OnlineSignUpInfo osubll = new YXShop.BLL.Product.GroupBuy_OnlineSignUpInfo();
- ChangeHope.DataBase.DataByPage dataPage = bll.GetList(OrderField, pagesize, cond);
- if (dataPage.DataReader != null)
- {
- while (dataPage.DataReader.Read())
- {
- int SignUpNumber = 0;
- DataTable dt=osubll.GetActivityList(dataPage.DataReader["id"].ToString());
- if (dt.Rows.Count > 0)
- {
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- SignUpNumber += Convert.ToInt32(dt.Rows[i]["signupcount"].ToString());
- }
- }
- string strContent = mystyle;
- if (strContent.IndexOf("[#ActivityNO]") > -1)
- {
- strContent = strContent.Replace("[#ActivityNO]", "No."+dataPage.DataReader["id"].ToString());
- }
- if (strContent.IndexOf("[#Title]") > -1)
- {
- strContent = strContent.Replace("[#Title]", ChangeHope.Common.StringHelper.SubStringAndAppend(dataPage.DataReader["title"].ToString(), NameCharacter, WhetherOmit));
- }
- if (strContent.IndexOf("[#Synopsis]") > -1)
- {
- strContent = strContent.Replace("[#Synopsis]", ChangeHope.Common.StringHelper.SubStringAndAppend(dataPage.DataReader["synopsis"].ToString(), BewriteCharacter, WhetherOmit));
- }
- if (strContent.IndexOf("[#Images]") > -1)
- {
- string ImagesUrl = string.Empty;
- if (dataPage.DataReader["images"].ToString() != string.Empty && dataPage.DataReader["images"].ToString() != "")
- {
- ImagesUrl = dataPage.DataReader["images"].ToString();
- }
- else
- {
- ImagesUrl = "images/NaughtImages.gif";
- }
- strContent = strContent.Replace("[#Images]", sp.DummyPaht + ImagesUrl);
-
- }
-
- if (strContent.IndexOf("[#Starte]") > -1)
- {
- string strStarte = string.Empty;
- if (dataPage.DataReader["state"].ToString() == "1")
- {
- strStarte = "????";
- }
- strContent = strContent.Replace("[#Starte]", strStarte);
- }
- if (strContent.IndexOf("[#SignUpNumber]") > -1)
- {
- strContent = strContent.Replace("[#SignUpNumber]", SignUpNumber.ToString());
- }
- if (strContent.IndexOf("[#GroupBuyQQ]") > -1)
- {
- strContent = strContent.Replace("[#GroupBuyQQ]", dataPage.DataReader["activityqq"].ToString());
- }
- if (strContent.IndexOf("[#ActivityAddress]") > -1)
- {
- strContent = strContent.Replace("[#ActivityAddress]", dataPage.DataReader["address"].ToString());
- }
- if (strContent.IndexOf("[#SignUpUrl]") > -1)
- {
- string LinkName=string.Empty;
- string AddressURL = Common.UrlStr("product_onlinesignup_form", "q_activityid=" + dataPage.DataReader["id"].ToString() + ";q_productid=" + dataPage.DataReader["productid"].ToString() + "", "product/");
- if(Convert.ToDateTime(dataPage.DataReader["activityendtime"].ToString())<System.DateTime.Now)
- {
- LinkName="<span color='#ccc'>?????</span>";
- AddressURL="#";
- }
- else
- {
- LinkName = "????";
- }
- strContent = strContent.Replace("[#SignUpUrl]", AddressURL);
- }
- if (strContent.IndexOf("[#ActivityStarteTime]") > -1)
- {
- strContent = strContent.Replace("[#ActivityStarteTime]", dataPage.DataReader["activitystarttime"].ToString());
- }
- if (strContent.IndexOf("[#ActivityEndTime]") > -1)
- {
- strContent = strContent.Replace("[#ActivityEndTime]", dataPage.DataReader["activityendtime"].ToString());
- }
- if (strContent.IndexOf("[#AcitvityInfoURL]") > -1)
- {
- strContent = strContent.Replace("[#AcitvityInfoURL]", Common.UrlStr("acivityinfocontent", "q_activityid=" + dataPage.DataReader["id"].ToString() + "", "product/"));
- }
- shtml.Append(strContent);
- }
- }
- if (str_WhetherPagination == "true")
- {
- shtml.Append(dataPage.ReceptionToolBar);
- }
- }
- return shtml.ToString();
- }
- }
- }