Example #1
0
		public void Save()
		{
			var serviceWse = ServiceManager.GetService<CommentService>();

			var commentDto = new DataConverter<Comment>().Convert<CommentDTO>(this);
			try
			{
				bool isNew = !commentDto.ID.HasValue || commentDto.ID.Value <= 0;
				if (isNew)
				{
					serviceWse.Create(commentDto);
				}
				else
				{
					serviceWse.Update(commentDto);
				}

				var actionProcessor = new ActionProcessor();
				actionProcessor.ProcessAction(isNew ? ActionTypeEnum.Add : ActionTypeEnum.Update, this);
			}
			catch (Exception e)
			{
				log.Debug("Error catched", e);

				if (e.Message.Contains("should not be empty"))
				{
					ActionProcessor.LastAction = ("The description of comment should not be empty");
					ActionProcessor.IsError = true;
				}
				else
				{
					throw;
				}
			}
		}
 public TaskOrchestrationClient(string connectionString, string orchestrationTopicName)
 {
     this.orchestrationTopicName = orchestrationTopicName;
     this.connectionString = connectionString;
     this.messagingFactory = MessagingFactory.CreateFromConnectionString(this.connectionString);
     this.oxQueueClient = this.messagingFactory.CreateQueueClient(this.orchestrationTopicName);
     this.defaultConverter = new JsonDataConverter();
 }
Example #3
0
 protected ByteBuffer(byte[] buf, int start, int len)
 {
     this.buffer = buf;
     this.offset = 0;
     this.limit = start + len;
     this.index = start;
     this.mark = start;
     this.capacity = buf.Length;
     this.c = DataConverter.BigEndian;
 }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["menu"] != null)
            {
                string menu = Request.QueryString["menu"];
                if (menu == "delete")
                {
                    int          id      = DataConverter.CLng(Request.QueryString["id"]);
                    int          fid     = DataConverter.CLng(Request.QueryString["fid"]);
                    int          ModelID = DataConverter.CLng(Request.QueryString["ModelID"]);
                    M_ModelField finfos  = fll.GetModelByID(ModelID.ToString(), id);

                    string[] s0 = finfos.Content.Split(new char[] { ',' })[0].Split(new char[] { '=' });
                    string   s1 = finfos.Content.Split(new char[] { ',' })[1];
                    string   s2 = finfos.Content.Split(new char[] { ',' })[2];
                    string   d1 = s0[0].ToString();
                    string   d2 = s0[1].ToString();

                    string sld = "";

                    if (d2.IndexOf("||") > -1)
                    {
                        string[] sarr = d2.Split(new string[] { "||" }, StringSplitOptions.None);
                        for (int ii = 0; ii < sarr.Length; ii++)
                        {
                            if (ii + 1 != fid)
                            {
                                sld = sld + sarr[ii];
                                if (ii < sarr.Length - 1)
                                {
                                    sld = sld + "||";
                                }
                            }
                        }

                        if (BaseClass.Right(sld, 2) == "||")
                        {
                            sld = BaseClass.Left(sld, 0, sld.Length - 2);
                        }


                        sld = d1 + "=" + sld + "," + s1 + "," + s2;
                    }
                    else
                    {
                        if (fid == 1)
                        {
                            sld = d1 + "=" + "," + s1 + "," + s2;
                        }
                    }
                    finfos.Content = sld;
                    fll.Update(finfos);
                    Response.Redirect("OptionManage.aspx?id=" + id + "&ModelID=" + ModelID.ToString() + "");
                }
            }

            int i = 0;
            IList <M_Classon> listuser = new List <M_Classon>();
            int idd      = DataConverter.CLng(Request.QueryString["ID"]);
            int ModelIDs = DataConverter.CLng(Request.QueryString["ModelID"]);


            M_ModelField modelinfo = fll.GetModelByID(ModelIDs.ToString(), idd);
            string       contents  = modelinfo.Content;

            string[] strArray2 = contents.Split(new char[] { ',' })[0].Split(new char[] { '=' });

            if (strArray2 != null && strArray2.Length > 1)
            {
                string optioncontent = "";

                if (strArray2[1] != null)
                {
                    optioncontent = strArray2[1].ToString();
                }

                if (optioncontent.IndexOf("||") > -1)
                {
                    string[] contentarr = optioncontent.Split(new string[] { "||" }, StringSplitOptions.None);
                    if (contentarr != null)
                    {
                        foreach (string contentitem in contentarr)
                        {
                            i = i + 1;
                            if (contentitem.IndexOf('$') > -1)
                            {
                                string[]   items  = contentitem.Split(new string[] { "$" }, StringSplitOptions.None);
                                int        userid = DataConverter.CLng(items[1].ToString());
                                M_UserInfo infos  = ull.GetLogin();
                                if (infos.UserID == userid)
                                {
                                    string itemcontent = items[0].ToString();
                                    if (itemcontent.IndexOf('|') > -1)
                                    {
                                        string[]  arr       = itemcontent.Split(new string[] { "|" }, StringSplitOptions.None);
                                        M_Classon classlist = new M_Classon();
                                        classlist.id         = i;
                                        classlist.classname  = arr[0].ToString();
                                        classlist.classvalue = arr[1].ToString();
                                        listuser.Add(classlist);
                                    }
                                }
                            }
                            else
                            {
                                if (contentitem.IndexOf('|') > -1)
                                {
                                    string[]  arr        = contentitem.Split(new string[] { "|" }, StringSplitOptions.None);
                                    M_Classon conarrlist = new M_Classon();
                                    conarrlist.id         = i;
                                    conarrlist.classname  = arr[0].ToString();
                                    conarrlist.classvalue = arr[1].ToString();
                                    listuser.Add(conarrlist);
                                }
                                else
                                {
                                    M_Classon conarrlistd = new M_Classon();
                                    conarrlistd.id         = i;
                                    conarrlistd.classname  = contentitem;
                                    conarrlistd.classvalue = contentitem;
                                    listuser.Add(conarrlistd);
                                }
                            }
                        }
                    }
                }
                else
                {
                    M_Classon conarrlistd = new M_Classon();
                    conarrlistd.classname  = optioncontent;
                    conarrlistd.classvalue = optioncontent;
                    listuser.Add(conarrlistd);
                }
            }
            Repeater1.DataSource = listuser;
            Repeater1.DataBind();
        }
Example #5
0
 public void Order(ByteOrder order)
 {
     this.order = order;
     if (order == ByteOrder.BIG_ENDIAN) {
         c = DataConverter.BigEndian;
     } else {
         c = DataConverter.LittleEndian;
     }
 }
 /// <summary>
 /// 得到所有行数
 /// </summary>
 /// <returns></returns>
 public virtual int GetCount()
 {
     return(DataConverter.CLng(GetScalar("count(*)"), 0));
 }
 /// <summary>
 /// 得到所有行数
 /// </summary>
 /// <param name="strWhere">参数化查询条件(例如: and Name = @Name )</param>
 /// <param name="dict">参数的名/值集合</param>
 /// <returns></returns>
 public virtual int GetCount(string strWhere, Dictionary <string, object> dict = null)
 {
     return(DataConverter.CLng(GetScalar("count(*)", strWhere, dict), 0));
 }
Example #8
0
        //提交
        protected void Submit_B_Click(object sender, EventArgs e)
        {
            M_Pub pubMod  = new M_Pub();
            bool  addtrue = true;

            #region 验证模块
            if (Mid < 1)
            {
                DataTable tempinfo = pubBll.SelByName(PubName.Text);
                if (tempinfo.Rows.Count > 0)
                {
                    addtrue = false;
                    function.WriteErrMsg("已存在此互动模块!请更换模块名称再试!!");
                }
                DataTable PubInputLoadStrtable = pubBll.SelBy("", "PubInputLoadStr.Text", Mid.ToString());
                if (PubInputLoadStrtable.Rows.Count > 0)
                {
                    addtrue = false;
                    function.WriteErrMsg("已经存在此提交标签!");
                }
                DataTable PubLoadstrtable = pubBll.SelBy(PubLoadstr.Text, "", Mid.ToString());
                if (PubLoadstrtable.Rows.Count > 0)
                {
                    addtrue = false;
                    function.WriteErrMsg("已经存在此互动标签!");
                }
            }
            #endregion
            if (addtrue)
            {
                if (Mid > 0)
                {
                    pubMod = pubBll.SelReturnModel(Mid);
                    if (Menu.Equals("copy"))
                    {
                        pubMod.Pubid = 0;
                    }
                }
                pubMod.PubAddnum     = 0;
                pubMod.PubCreateTime = DateTime.Now;
                pubMod.PubBindPub    = 0;
                pubMod.PubClass      = DataConverter.CLng(this.PubClass.SelectedValue);
                pubMod.PubCode       = PubCode.Checked ? 1 : 0;
                //界面处理显示结束时间,如果是最大则不显示
                if (!string.IsNullOrEmpty(this.PubEndTime.Text))
                {
                    pubMod.PubEndTime = DataConverter.CDate(this.PubEndTime.Text.Replace("/", "-"));
                }
                else
                {
                    pubMod.PubEndTime = DateTime.MaxValue;
                }
                pubMod.PubInputLoadStr = PubInputLoadStr.Text;
                pubMod.PubType         = DataConverter.CLng(this.PubType.SelectedValue);
                pubMod.PubNodeID       = "";
                pubMod.PubTemplateID   = "";
                pubMod.PubIsDel        = 0;
                pubMod.PubIsTrue       = PubIsTrue.Checked ? 1 : 0;
                pubMod.PubLoadstr      = PubLoadstr.Text;
                pubMod.PubLogin        = PubLogin.Checked ? 1 : 0;
                pubMod.PubLoginUrl     = PubLoginUrl.Text;
                pubMod.PubTableName    = "ZL_Pub_" + PubTableName.Text;
                pubMod.PubName         = PubName.Text;
                pubMod.PubOpenComment  = PubOpenComment.Checked ? 1 : 0;
                pubMod.PubShowType     = DataConverter.CLng(this.PubShowType.SelectedValue);
                //pubMod.PubTimeSlot = CookieNum_Rad.SelectedValue.Equals("0") ? 0 : DataConverter.CLng(CookieNum_T.Text);
                pubMod.Pubkeep     = DataConverter.CLng(this.Pubkeep.Text);
                pubMod.PubInputTM  = "";
                pubMod.PubTemplate = "";
                pubMod.Puberrmsg   = Puberrmsg.Text;
                pubMod.PubFlag     = pubflag.Checked ? 1 : 0;
                string perm = "";
                if (CheckBox1.Checked)
                {
                    perm += "Look";
                }
                if (CheckBox2.Checked)
                {
                    perm += ",Edit";
                }
                if (CheckBox3.Checked)
                {
                    perm += ",Del";
                }
                if (CheckBox4.Checked)
                {
                    perm += ",Sen";
                }
                pubMod.PubPermissions = perm;
                pubMod.PubGourl       = PubGourl.Text;
                pubMod.Public         = RaPublic.Checked ? 1 : 0;
                //设置限制用户提交数量
                if (this.PubOneOrMore.SelectedValue == "2")
                {
                    pubMod.PubOneOrMore = DataConverter.CLng(this.PubOneOrMorenum.Text);
                }
                else
                {
                    pubMod.PubOneOrMore = DataConverter.CLng(this.PubOneOrMore.SelectedValue);
                }
                //设置限制IP提交数量
                if (this.PubIPOneOrMore.SelectedValue == "2")
                {
                    pubMod.PubIPOneOrMore = DataConverter.CLng(this.PubIPOneOrMorenum.Text);
                }
                else
                {
                    pubMod.PubIPOneOrMore = DataConverter.CLng(this.PubIPOneOrMore.SelectedValue);
                }
                pubMod.Interval = DataConverter.CLng(Interval_T.Text);
                string strPath       = "";
                string strPathname   = "";
                string PubInputTMurl = "";
                string Tempinputstr  = @"";
                //模型ID
                if (pubMod.Pubid == 0)
                {
                    pubMod.PubModelID = pubBll.CreateModelInfo(pubMod);//建立数据表与模型Field,Model
                    int Pubinsertid = pubBll.GetInsert(pubMod);

                    #region 创建互动模板
                    string  PubTemplateurl = "";
                    string  Tmpstr         = "";
                    M_Label lab            = new M_Label();
                    B_Label blab           = new B_Label();
                    lab.LabelAddUser = badmin.GetAdminLogin().AdminId;
                    string getstr = "";
                    switch (pubMod.PubClass)
                    {
                    //0-内容 1-商城 2-黄页 3-店铺 4-会员
                    case 0:
                        getstr = "ID";
                        break;

                    case 1:
                        getstr = "ID";
                        break;

                    case 2:
                        getstr = "Pageid";
                        break;

                    case 3:
                        getstr = "id";
                        break;

                    case 4:
                        getstr = "Userid";
                        break;

                    case 5:
                        getstr = "Nodeid";
                        break;

                    case 6:
                        getstr = "";
                        break;

                    default:
                        getstr = "ID";
                        break;
                    }
                    string pubcontdid = "-1";
                    if (pubMod.PubClass != 6)
                    {
                        pubcontdid = "{$GetRequest(" + getstr + ")$}";
                    }
                    //创建标签
                    switch (pubMod.PubType)
                    {
                    case 0:    //评论
                               //创建源标签
                        lab.LableName   = pubMod.PubName + "调用标签";
                        lab.LabelCate   = "互动标签";
                        lab.LableType   = 4;
                        lab.LabelTable  = "" + pubMod.PubTableName + " left join ZL_Pub on " + pubMod.PubTableName + ".Pubupid=ZL_Pub.Pubid";
                        lab.LabelField  = "" + pubMod.PubTableName + ".*,ZL_Pub.*";
                        lab.LabelWhere  = "" + pubMod.PubTableName + ".Pubupid=" + Pubinsertid.ToString() + " And " + pubMod.PubTableName + ".PubContentid=" + pubcontdid + " And " + pubMod.PubTableName + ".Pubstart=1";
                        lab.Param       = "";
                        lab.LabelOrder  = "" + pubMod.PubTableName + ".ID DESC";
                        lab.LabelCount  = "10";
                        lab.Content     = "{Repeate}\n用户名:{Field=\"PubUserName\"/}<br />\n评论说明:{Field=\"PubContent\"/}<br />\n用户IP:{Field=\"PubIP\"/}<br />\n评论时间:{Field=\"PubAddTime\"/}<br />{/Repeate}<br />\n{ZL.Page/}";
                        lab.Desc        = pubMod.PubTableName + "分页标签";
                        lab.LabelNodeID = 0;
                        blab.AddLabelXML(lab);
                        Tmpstr      = "{ZL.Label id=\"" + pubMod.PubName + "调用标签\"/}\n{Pub." + PubInputLoadStr.Text + "/}";
                        strPath     = "默认评论" + pubMod.PubName + "模板.html";
                        strPathname = "默认评论" + pubMod.PubName + "模板.html";
                        strPath     = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath;
                        strPath     = strPath.Replace("/", @"\");
                        FileSystemObject.WriteFile(strPath, Tmpstr);
                        break;

                    case 1:    //投票
                               //创建标签
                        lab.LableName   = pubMod.PubName + "调用标签";
                        lab.LabelCate   = "互动标签";
                        lab.LableType   = 4;
                        lab.LabelTable  = "" + pubMod.PubTableName + " left join ZL_Pub on " + pubMod.PubTableName + ".Pubupid=ZL_Pub.Pubid";
                        lab.LabelField  = "" + pubMod.PubTableName + ".*,ZL_Pub.*";
                        lab.LabelWhere  = "" + pubMod.PubTableName + ".Pubupid=" + Pubinsertid.ToString() + " And " + pubMod.PubTableName + ".PubContentid=" + pubcontdid + " And " + pubMod.PubTableName + ".Pubstart=1";
                        lab.Param       = "";
                        lab.LabelOrder  = "" + pubMod.PubTableName + ".ID DESC";
                        lab.LabelCount  = "10";
                        lab.Content     = "{Repeate}\n用户名:{Field=\"PubUserName\"/}<br />\n投票说明:{Field=\"PubContent\"/}<br />\n用户IP:{Field=\"PubIP\"/}<br />\n投票时间:{Field=\"PubAddTime\"/}<br />{/Repeate}<br />\n{ZL.Page/}";
                        lab.Desc        = pubMod.PubTableName + "分页标签";
                        lab.LabelNodeID = 0;
                        blab.AddLabelXML(lab);
                        Tmpstr      = "{ZL.Label id=\"" + pubMod.PubName + "调用标签\"/}\n{Pub." + PubInputLoadStr.Text + "/}";
                        strPath     = "默认投票" + pubMod.PubName + "模板.html";
                        strPathname = "默认投票" + pubMod.PubName + "模板.html";
                        strPath     = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath;
                        break;

                    case 2:    //活动
                        lab.LableName   = pubMod.PubName + "调用标签";
                        lab.LabelCate   = "互动标签";
                        lab.LableType   = 4;
                        lab.LabelTable  = "" + pubMod.PubTableName + " left join ZL_Pub on " + pubMod.PubTableName + ".Pubupid=ZL_Pub.Pubid";
                        lab.LabelField  = "" + pubMod.PubTableName + ".*,ZL_Pub.*";
                        lab.LabelWhere  = "" + pubMod.PubTableName + ".Pubupid=" + Pubinsertid.ToString() + " And " + pubMod.PubTableName + ".PubContentid=" + pubcontdid + " And " + pubMod.PubTableName + ".Pubstart=1";
                        lab.Param       = "";
                        lab.LabelOrder  = "" + pubMod.PubTableName + ".ID DESC";
                        lab.LabelCount  = "10";
                        lab.Content     = "<a href=PubAction.aspx?menu=hd&act=add&Pubid=" + Pubinsertid.ToString() + ">发起活动</a>\n{Repeate}\n用户名:{Field=\"PubUserName\"/}<br />\n活动内容:{Field=\"PubContent\"/}<br />\n用户IP:{Field=\"PubIP\"/}<br />\n提交时间:{Field=\"PubAddTime\"/}\n{/Repeate}<br />\n{ZL.Page/}";
                        lab.Desc        = pubMod.PubTableName + "分页标签";
                        lab.LabelNodeID = 0;
                        blab.AddLabelXML(lab);
                        Tmpstr      = "{ZL.Label id=\"" + pubMod.PubName + "调用标签\"/}\n{Pub." + PubInputLoadStr.Text + "/}";
                        strPath     = "默认活动" + pubMod.PubName + "模板.html";
                        strPathname = "默认活动" + pubMod.PubName + "模板.html";
                        strPath     = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath;
                        break;

                    case 3:    //留言
                        lab.LableName   = pubMod.PubName + "调用标签";
                        lab.LabelCate   = "互动标签";
                        lab.LableType   = 4;
                        lab.LabelTable  = "" + pubMod.PubTableName + " left join ZL_Pub on " + pubMod.PubTableName + ".Pubupid=ZL_Pub.Pubid";
                        lab.LabelField  = "" + pubMod.PubTableName + ".*,ZL_Pub.*";
                        lab.LabelWhere  = "" + pubMod.PubTableName + ".Pubupid=" + Pubinsertid.ToString() + " And " + pubMod.PubTableName + ".PubContentid=" + pubcontdid + " And " + pubMod.PubTableName + ".Pubstart=1";
                        lab.Param       = "";
                        lab.LabelOrder  = "" + pubMod.PubTableName + ".ID DESC";
                        lab.LabelCount  = "10";
                        lab.Content     = "{Repeate}\n用户名:{Field=\"PubUserName\"/}<br />\n留言内容:{Field=\"PubContent\"/}<br />\n用户IP:{Field=\"PubIP\"/}<br />\n提交时间:{Field=\"PubAddTime\"/}\n{/Repeate}<br />\n{ZL.Page/}";
                        lab.Desc        = pubMod.PubTableName + "分页标签";
                        lab.LabelNodeID = 0;
                        blab.AddLabelXML(lab);
                        Tmpstr      = "{ZL.Label id=\"" + pubMod.PubName + "调用标签\"/}\n{Pub." + PubInputLoadStr.Text + "/}";
                        strPath     = "默认留言" + pubMod.PubName + "模板.html";
                        strPathname = "默认留言" + pubMod.PubName + "模板.html";
                        strPath     = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath;
                        break;

                    case 4:    //问券
                        lab.LableName   = pubMod.PubName + "调用标签";
                        lab.LabelCate   = "互动标签";
                        lab.LableType   = 4;
                        lab.LabelTable  = "" + pubMod.PubTableName + " left join ZL_Pub on " + pubMod.PubTableName + ".Pubupid=ZL_Pub.Pubid";
                        lab.LabelField  = "" + pubMod.PubTableName + ".*,ZL_Pub.*";
                        lab.LabelWhere  = "" + pubMod.PubTableName + ".Pubupid=" + Pubinsertid.ToString() + " And " + pubMod.PubTableName + ".PubContentid=" + pubcontdid + " And " + pubMod.PubTableName + ".Pubstart=1";
                        lab.Param       = "";
                        lab.LabelOrder  = "" + pubMod.PubTableName + ".ID DESC";
                        lab.LabelCount  = "10";
                        lab.Content     = "{Repeate}\n用户名:{Field=\"PubUserName\"/}<br />\n问券内容:{Field=\"PubContent\"/}<br />\n用户IP:{Field=\"PubIP\"/}<br />\n提交时间:{Field=\"PubAddTime\"/}\n{/Repeate}<br />\n{ZL.Page/}<br />";
                        lab.Desc        = pubMod.PubTableName + "分页标签";
                        lab.LabelNodeID = 0;
                        blab.AddLabelXML(lab);
                        Tmpstr      = "{ZL.Label id=\"" + pubMod.PubName + "调用标签\"/}\n{Pub." + PubInputLoadStr.Text + "/}";
                        strPath     = "默认问券" + pubMod.PubName + "模板.html";
                        strPathname = "默认问券" + pubMod.PubName + "模板.html";
                        strPath     = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath;
                        break;

                    case 5:    //统计
                        lab.LableName   = pubMod.PubName + "调用标签";
                        lab.LabelCate   = "互动标签";
                        lab.LableType   = 2;
                        lab.LabelTable  = pubMod.PubTableName + " left join ZL_Pub on " + pubMod.PubTableName + ".Pubupid=ZL_Pub.Pubid";
                        lab.LabelField  = pubMod.PubTableName + ".*,ZL_Pub.*";
                        lab.LabelWhere  = pubMod.PubTableName + ".Pubupid=" + Pubinsertid.ToString() + " And " + pubMod.PubTableName + ".PubContentid=" + pubcontdid + " and Parentid=0  And " + pubMod.PubTableName + ".Pubstart=1";
                        lab.Param       = "";
                        lab.LabelOrder  = pubMod.PubTableName + ".ID DESC";
                        lab.LabelCount  = "10";
                        lab.Content     = "点击数:{Field=\"Pubnum\"/}";
                        lab.Desc        = pubMod.PubTableName + "动态标签";
                        lab.LabelNodeID = 0;
                        blab.AddLabelXML(lab);
                        Tmpstr      = "{ZL.Label id=\"" + pubMod.PubName + "调用标签\"/}\n{Pub." + PubInputLoadStr.Text + "/}";
                        strPath     = "默认统计" + pubMod.PubName + "模板.html";
                        strPathname = "默认统计" + pubMod.PubName + "模板.html";
                        strPath     = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath;
                        break;

                    case 6:    //竞标
                               //创建标签
                        lab.LableName   = pubMod.PubName + "调用标签";
                        lab.LabelCate   = "互动标签";
                        lab.LableType   = 4;
                        lab.LabelTable  = "" + pubMod.PubTableName + " left join ZL_Pub on " + pubMod.PubTableName + ".Pubupid=ZL_Pub.Pubid";
                        lab.LabelField  = "" + pubMod.PubTableName + ".*,ZL_Pub.*";
                        lab.LabelWhere  = "" + pubMod.PubTableName + ".Pubupid=" + Pubinsertid.ToString() + " And " + pubMod.PubTableName + ".PubContentid=" + pubcontdid + " And " + pubMod.PubTableName + ".Pubstart=1";
                        lab.Param       = "";
                        lab.LabelOrder  = "" + pubMod.PubTableName + ".ID DESC";
                        lab.LabelCount  = "10";
                        lab.Content     = "{Repeate}\n用户名:{Field=\"PubUserName\"/}<br />\n竞标说明:{Field=\"PubContent\"/}<br />\n用户IP:{Field=\"PubIP\"/}<br />\n竞标时间:{Field=\"PubAddTime\"/}<br />{/Repeate}<br />\n{ZL.Page/}";
                        lab.Desc        = pubMod.PubTableName + "分页标签";
                        lab.LabelNodeID = 0;
                        blab.AddLabelXML(lab);
                        Tmpstr      = "{ZL.Label id=\"" + pubMod.PubName + "调用标签\"/}\n{Pub." + PubInputLoadStr.Text + "/}";
                        strPath     = "默认竞标" + pubMod.PubName + "模板.html";
                        strPathname = "默认竞标" + pubMod.PubName + "模板.html";
                        strPath     = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath;
                        break;

                    case 7:
                        lab.LableName  = pubMod.PubName + "调用标签";
                        lab.LabelCate  = "互动标签";
                        lab.LableType  = 1;
                        lab.LabelTable = "";
                        lab.LabelField = "";
                        lab.LabelWhere = "";
                        lab.Param      = "";
                        lab.LabelOrder = "";
                        lab.LabelCount = "10";
                        if (string.IsNullOrEmpty(starOPT.Text.Trim()))
                        {
                            function.WriteErrMsg("选项不能为空!!");
                        }
                        string[] starOP = starOPT.Text.Trim().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

                        lab.Content     = GetContent(starOP, Pubinsertid);
                        lab.Desc        = pubMod.PubTableName + "分页标签";
                        lab.LabelNodeID = 0;
                        blab.AddLabelXML(lab);
                        Tmpstr      = "{ZL.Label id=\"" + pubMod.PubName + "调用标签\"/}\n{Pub." + PubInputLoadStr.Text + "/}";
                        strPath     = "评星" + pubMod.PubName + "模板.html";
                        strPathname = "评星" + pubMod.PubName + "模板.html";
                        strPath     = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath;
                        break;

                    case 8:
                        break;

                    default:
                        function.WriteErrMsg("类型错误,该类型不存在!!!");
                        break;
                    }
                    strPath = strPath.Replace("/", @"\");
                    if (!string.IsNullOrEmpty(strPath))
                    {
                        FileSystemObject.WriteFile(strPath, Tmpstr);
                    }
                    PubTemplateurl = "/互动模板/" + strPathname;
                    #endregion
                    #region 创建互动提交模板
                    switch (pubMod.PubType)
                    {
                    case 0:    //评论
                        Tempinputstr = @"<form name=""form{PubID/}"" method=""post"" action=""/PubAction.aspx"">
<input type=""hidden"" name=""PubID"" id=""PubID"" value=""{PubID/}"" />
<input type=""hidden"" name=""PubContentid"" id=""PubContentid"" value=""{PubContentid/}"" />
<input type=""hidden"" name=""PubInputer"" id=""PubInputer"" value=""{PubInputer/}"" />
<div class=""form-group"">
<label for=""PubTitle"">评论标题:</label>
<input type=""text"" class=""form-control"" id=""PubTitle"" name=""PubTitle"" />{PubCode/}
</div>
<div class=""form-group"">
<label for=""PubContent"">评论内容:</label>
<textarea class=""form-control"" name=""PubContent"" cols=""50"" rows=""10"" id=""PubContent""></textarea>
</div>
<div class=""form-group text-center"">
<button type=""submit"" class=""btn btn-default"">提交</button>
<button type=""reset"" class=""btn btn-default"">重置</button>
</div>
</form>";
                        Tempinputstr = Tempinputstr.Replace(@"{PubID/}", Pubinsertid.ToString());
                        strPath      = "默认评论" + pubMod.PubName + "提交模板.html";
                        strPathname  = "默认评论" + pubMod.PubName + "提交模板.html";
                        strPath      = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath;
                        break;

                    case 1:    //投票
                        Tempinputstr = @"<form name=""form{PubID/}"" method=""post"" action=""/PubAction.aspx"">
<input type=""hidden"" name=""PubID"" id=""PubID"" value=""{PubID/}"" />
<input type=""hidden"" name=""PubContentid"" id=""PubContentid"" value=""{PubContentid/}"" />
<input type=""hidden"" name=""PubInputer"" id=""PubInputer"" value=""{PubInputer/}"" />
<div class=""form-group"">
<label for=""PubTitle"">投票标题:</label>
<input type=""text"" class=""form-control"" id=""PubTitle"" name=""PubTitle"" />
{PubCode/}
</div>
<div class=""form-group"">
<label for=""PubContent"">投票内容:</label>
<textarea class=""form-control"" name=""PubContent"" cols=""50"" rows=""10"" id=""PubContent""></textarea>
</div>
<div class=""form-group text-center"">
<button type=""submit"" class=""btn btn-default"">提交</button>
<button type=""reset"" class=""btn btn-default"">重置</button>
</div>
</form>";
                        Tempinputstr = Tempinputstr.Replace(@"{PubID/}", Pubinsertid.ToString());
                        strPath      = "默认投票" + pubMod.PubName + "提交模板.html";
                        strPathname  = "默认投票" + pubMod.PubName + "提交模板.html";
                        strPath      = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath;
                        break;

                    case 2:    //活动
                        Tempinputstr = @"<form name=""form{PubID/}"" method=""post"" action=""/PubAction.aspx"">
<input type=""hidden"" name=""PubID"" id=""PubID"" value=""{PubID/}"" />
<input type=""hidden"" name=""PubContentid"" id=""PubContentid"" value=""{PubContentid/}"" />
<input type=""hidden"" name=""PubInputer"" id=""PubInputer"" value=""{PubInputer/}"" />
<div class=""form-group"">
<label for=""PubTitle"">活动标题:</label>
<input type=""text"" class=""form-control"" id=""PubTitle"" name=""PubTitle"" />
{PubCode/}
</div>
<div class=""form-group"">
<label for=""PubContent"">活动内容:</label>
<textarea class=""form-control"" name=""PubContent"" cols=""50"" rows=""10"" id=""PubContent""></textarea>
</div>
<div class=""form-group text-center"">
<button type=""submit"" class=""btn btn-default"">提交</button>
<button type=""reset"" class=""btn btn-default"">重置</button>
</div>
</form>";
                        Tempinputstr = Tempinputstr.Replace(@"{PubID/}", Pubinsertid.ToString());
                        strPath      = "默认活动" + pubMod.PubName + "提交模板.html";
                        strPathname  = "默认活动" + pubMod.PubName + "提交模板.html";
                        strPath      = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath;
                        break;

                    case 3:    //留言
                        Tempinputstr = @"<form name=""form{PubID/}"" method=""post"" action=""/PubAction.aspx"">
<input type=""hidden"" name=""PubID"" id=""PubID"" value=""{PubID/}"" />
<input type=""hidden"" name=""PubContentid"" id=""PubContentid"" value=""{PubContentid/}"" />
<input type=""hidden"" name=""PubInputer"" id=""PubInputer"" value=""{PubInputer/}"" />
<div class=""form-group"">
<label for=""PubTitle"">留言标题:</label>
<input type=""text"" class=""form-control"" id=""PubTitle"" name=""PubTitle"" />
{PubCode/}
</div>
<div class=""form-group"">
<label for=""PubContent"">留言内容:</label>
<textarea class=""form-control"" name=""PubContent"" cols=""50"" rows=""10"" id=""PubContent""></textarea>
</div>
<div class=""form-group text-center"">
<button type=""submit"" class=""btn btn-default"">提交</button>
<button type=""reset"" class=""btn btn-default"">重置</button>
</div>
</form>";
                        Tempinputstr = Tempinputstr.Replace(@"{PubID/}", Pubinsertid.ToString());
                        strPath      = "默认留言" + pubMod.PubName + "提交模板.html";
                        strPathname  = "默认留言" + pubMod.PubName + "提交模板.html";
                        strPath      = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath;
                        break;

                    case 4:    //问券
                        Tempinputstr = @"<form name=""form{PubID/}"" method=""post"" action=""/PubAction.aspx"">
<input type=""hidden"" name=""PubID"" id=""PubID"" value=""{PubID/}"" />
<input type=""hidden"" name=""PubContentid"" id=""PubContentid"" value=""{PubContentid/}"" />
<input type=""hidden"" name=""PubInputer"" id=""PubInputer"" value=""{PubInputer/}"" />
<div class=""form-group"">
<label for=""PubTitle"">问券标题:</label>
<input type=""text"" class=""form-control"" id=""PubTitle"" name=""PubTitle"" />
{PubCode/}
</div>
<div class=""form-group"">
<label for=""PubContent"">问券内容:</label>
<textarea class=""form-control"" name=""PubContent"" cols=""50"" rows=""10"" id=""PubContent""></textarea>
</div>
<div class=""form-group text-center"">
<button type=""submit"" class=""btn btn-default"">提交</button>
<button type=""reset"" class=""btn btn-default"">重置</button>
</div>
</form>";
                        Tempinputstr = Tempinputstr.Replace(@"{PubID/}", Pubinsertid.ToString());
                        strPath      = "默认问券" + pubMod.PubName + "提交模板.html";
                        strPathname  = "默认问券" + pubMod.PubName + "提交模板.html";
                        strPath      = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath;
                        break;

                    case 5:    //统计
                        Tempinputstr = @"<a href=/PubAction.aspx?pubid=" + Pubinsertid + "&PubContentid={PubContentid/}>通过链接提交</a>";
                        strPath      = "默认统计" + pubMod.PubName + "提交模板.html";
                        strPathname  = "默认统计" + pubMod.PubName + "提交模板.html";
                        strPath      = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath;
                        break;

                    case 6:    //竞标
                        Tempinputstr = @"<form name=""form{PubID/}"" method=""post"" action=""/PubAction.aspx"">
<input type=""hidden"" name=""PubID"" id=""PubID"" value=""{PubID/}"" />
<input type=""hidden"" name=""PubContentid"" id=""PubContentid"" value=""{PubContentid/}"" />
<input type=""hidden"" name=""PubInputer"" id=""PubInputer"" value=""{PubInputer/}"" />
<div class=""form-group"">
<label for=""PubTitle"">竞标标题:</label>
<input type=""text"" class=""form-control"" id=""PubTitle"" name=""PubTitle"" />
{PubCode/}
</div>
<div class=""form-group"">
<label for=""PubContent"">竞标内容:</label>
<textarea class=""form-control"" name=""PubContent"" cols=""50"" rows=""10"" id=""PubContent""></textarea>
</div>
<div class=""form-group text-center"">
<button type=""submit"" class=""btn btn-default"">提交</button>
<button type=""reset"" class=""btn btn-default"">重置</button>
</div>
</form>";
                        Tempinputstr = Tempinputstr.Replace(@"{PubID/}", Pubinsertid.ToString());

                        strPath     = "默认竞标" + pubMod.PubName + "提交模板.html";
                        strPathname = "默认竞标" + pubMod.PubName + "提交模板.html";
                        strPath     = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath;
                        break;

                    case 7:    //评星
                        if (string.IsNullOrEmpty(starOPT.Text.Trim()))
                        {
                            function.WriteErrMsg("选项不能为空!!");
                        }
                        string[] starOP = starOPT.Text.Trim().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

                        Tempinputstr = GetContent(starOP, Pubinsertid);
                        //存值方式Content中
                        //name:value,name:value然后用先获取contentID下的记录,然后再统计用lamda统计得分
                        strPath     = "评星" + pubMod.PubName + "提交模板.html";
                        strPathname = "评星" + pubMod.PubName + "提交模板.html";
                        strPath     = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath;
                        break;

                    default:
                        break;
                    }
                    if (pubflag.Checked)//开启cookie验证
                    {
                        Tempinputstr += @"    if (!localStorage[""cookflag""]) { localStorage[""cookflag""] = GetRanPass(12); } if (!getCookie(""cookflag"")) { setCookie(""cookflag"", localStorage[""cookflag""]); }";
                    }
                    strPath = strPath.Replace("/", @"\");
                    FileSystemObject.WriteFile(strPath, Tempinputstr);
                    PubInputTMurl = "/互动模板/" + strPathname;
                    #endregion
                    pubMod             = pubBll.GetSelect(Pubinsertid);
                    pubMod.PubInputTM  = PubInputTMurl;//提交窗口模板
                    pubMod.PubTemplate = PubTemplateurl;
                    pubMod.Public      = RaPublic.Checked ? 1 : 0;
                    pubBll.GetUpdate(pubMod);
                    function.WriteSuccessMsg("添加成功", pubMod.PubType == 8 ? "FormMangae.aspx" : "pubmanage.aspx");
                }
                else
                {
                    pubMod.PubTableName = ModelList_DP.SelectedValue;
                    pubMod.PubInputTM   = PubInputTM_hid.Value;
                    pubMod.PubTemplate  = PubTemplate_hid.Value;
                    pubMod.Pubinfo      = Pubinfo.Text;
                    pubBll.GetUpdate(pubMod);
                    function.WriteSuccessMsg("更新成功", pubMod.PubType == 8 ? "FormMangae.aspx" : "pubmanage.aspx");
                }
            }
        }
 public int GetCurrentOnlineCount()
 {
     return(DataConverter.CLng(DBHelper.ExecuteScalarSql("SELECT COUNT(*) FROM PE_StatOnline WHERE LastTime > DATEADD(ss,-(SELECT TOP 1 ISNULL(onlineTime, 0) FROM PE_StatInfoList), GETDATE())")));
 }
Example #10
0
        protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            if (this.Page.IsValid)
            {
                int         ModelID = DataConverter.CLng(this.HdnModel.Value);
                M_ModelInfo model   = bmodel.GetModelById(ModelID);
                int         ID      = DataConverter.CLng(this.HdnID.Value);

                DataTable table = new DataTable();
                table.Columns.Add(new DataColumn("FieldName", typeof(string)));
                table.Columns.Add(new DataColumn("FieldType", typeof(string)));
                table.Columns.Add(new DataColumn("FieldValue", typeof(string)));

                DataRow rowa = table.NewRow();
                rowa[0] = "PubTitle";
                rowa[1] = "TextType";
                rowa[2] = TextBox1.Text;
                table.Rows.Add(rowa);

                DataRow rowa1 = table.NewRow();
                rowa1[0] = "PubContent";
                rowa1[1] = "MultipleTextType";
                rowa1[2] = tx_PubContent.Text;
                table.Rows.Add(rowa1);

                DataTable dt = this.bfield.GetModelFieldListall(ModelID);
                foreach (DataRow dr in dt.Rows)
                {
                    if (DataConverter.CBool(dr["IsNotNull"].ToString()))
                    {
                        if (string.IsNullOrEmpty(this.Page.Request.Form["txt_" + dr["FieldName"].ToString()]))
                        {
                            function.WriteErrMsg(dr["FieldAlias"].ToString() + "不能为空!");
                        }
                    }
                    if (dr["FieldType"].ToString() == "FileType")
                    {
                        string[] Sett      = dr["Content"].ToString().Split(new char[] { ',' });
                        bool     chksize   = DataConverter.CBool(Sett[0].Split(new char[] { '=' })[1]);
                        string   sizefield = Sett[1].Split(new char[] { '=' })[1];
                        if (chksize && sizefield != "")
                        {
                            DataRow row2 = table.NewRow();
                            row2[0] = sizefield;
                            row2[1] = "FileSize";
                            row2[2] = this.Page.Request.Form["txt_" + sizefield];
                            table.Rows.Add(row2);
                        }
                    }
                    if (dr["FieldType"].ToString() == "MultiPicType")
                    {
                        string[] Sett      = dr["Content"].ToString().Split(new char[] { ',' });
                        bool     chksize   = DataConverter.CBool(Sett[0].Split(new char[] { '=' })[1]);
                        string   sizefield = Sett[1].Split(new char[] { '=' })[1];
                        if (chksize && sizefield != "")
                        {
                            if (string.IsNullOrEmpty(this.Page.Request.Form["txt_" + sizefield]))
                            {
                                function.WriteErrMsg(dr["FieldAlias"].ToString() + "的缩略图不能为空!");
                            }
                            DataRow row1 = table.NewRow();
                            row1[0] = sizefield;
                            row1[1] = "ThumbField";
                            row1[2] = this.Page.Request.Form["txt_" + sizefield];
                            table.Rows.Add(row1);
                        }
                    }
                    DataRow row = table.NewRow();
                    row[0] = dr["FieldName"].ToString();
                    string ftype = dr["FieldType"].ToString();
                    if (ftype == "NumType")
                    {
                        string[] fd   = dr["Content"].ToString().Split(new char[] { ',' });
                        string[] fdty = fd[1].Split(new char[] { '=' });

                        int numstyle = DataConverter.CLng(fdty[1]);
                        if (numstyle == 1)
                        {
                            ftype = "int";
                        }
                        if (numstyle == 2)
                        {
                            ftype = "float";
                        }
                        if (numstyle == 3)
                        {
                            ftype = "money";
                        }
                    }
                    row[1] = ftype;
                    string fvalue = this.Page.Request.Form["txt_" + dr["FieldName"].ToString()];

                    row[2] = fvalue;
                    table.Rows.Add(row);
                }
                if (ID > 0)
                {
                    try
                    {
                        if (buser.UpdateModelInfo(table, model.TableName, ID))
                        {
                            if (!string.IsNullOrEmpty(this.HdnType.Value))
                            {
                                if (this.HdnType.Value == "pubs")
                                {
                                    Response.Redirect("Pubsinfo.aspx?ModeID=" + this.HdnModel.Value + "&type=0");
                                }
                                else
                                {
                                    Response.Redirect("ViewSmallPub.aspx?ModelID=" + this.HdnModel.Value + "&ID=" + this.HdnType.Value + "&type=0");
                                }
                            }
                            else
                            {
                                Response.Redirect("ViewPub.aspx?id=" + this.HdnModel.Value + "&type=0");
                            }
                        }
                    }
                    catch
                    {
                        if (!string.IsNullOrEmpty(this.HdnType.Value))
                        {
                            if (this.HdnType.Value == "pubs")
                            {
                                Response.Redirect("Pubsinfo.aspx?Pubid=" + this.HdnPubid.Value + "&type=0");
                            }
                            else
                            {
                                Response.Redirect("ViewSmallPub.aspx?Pubid=" + this.HdnPubid.Value + "&ID=" + this.HdnType.Value + "&type=0");
                            }
                        }
                        else
                        {
                            Response.Redirect("ViewPub.aspx?Pubid=" + this.HdnPubid.Value + "&type=0");
                        }
                    }
                }
            }
        }
Example #11
0
 public ODataQuerier(Database <T> database, XElement schema, DataConverter <T> conv)
     : this(database.UnderlyingDatabase, schema, conv)
 {
 }
Example #12
0
        private void GetShow(M_ModelField field)
        {
            this.Name.Text                  = field.FieldName;
            this.Name.Enabled               = false;
            this.Alias.Text                 = field.FieldAlias;
            this.Description.Text           = field.Description;
            this.Tips.Text                  = field.FieldTips;
            this.IsNotNull.SelectedValue    = field.IsNotNull.ToString();
            this.IsSearchForm.SelectedValue = field.IsSearchForm.ToString();
            string type    = field.FieldType;
            string content = field.Content;

            this.Type.SelectedValue = type;
            this.Type.Enabled       = false;
            this.hdfOrder.Value     = field.OrderID.ToString();
            switch (type)
            {
            //单行文本
            case "TextType":
                this.TitleSize.Text             = this.bll.GetFieldContent(content, 0, 1);
                this.IsPassword.SelectedValue   = this.bll.GetFieldContent(content, 1, 1);
                this.TextType_DefaultValue.Text = this.bll.GetFieldContent(content, 2, 1);
                break;

            //多行文本(不支持Html)
            case "MultipleTextType":
                this.MultipleTextType_Width.Text          = this.bll.GetFieldContent(content, 0, 1);
                this.MultipleTextType_Height.Text         = this.bll.GetFieldContent(content, 1, 1);
                this.DivMultipleTextType.Style["display"] = "";
                this.DivTextType.Style["display"]         = "none";
                break;

            //多行文本(支持Html)
            case "MultipleHtmlType":
                this.MultipleHtmlType_Width.Text          = this.bll.GetFieldContent(content, 0, 1);
                this.MultipleHtmlType_Height.Text         = this.bll.GetFieldContent(content, 1, 1);
                this.IsEditor.SelectedValue               = this.bll.GetFieldContent(content, 2, 1);
                this.DivMultipleHtmlType.Style["display"] = "";
                this.DivTextType.Style["display"]         = "none";
                break;

            //单选项
            case "OptionType":
                this.RadioType_Content.Text           = this.bll.GetFieldContent(content, 0, 1).Replace("|", "\r\n");
                this.RadioType_Type.SelectedValue     = this.bll.GetFieldContent(content, 0, 0);
                this.RadioType_Property.SelectedValue = this.bll.GetFieldContent(content, 1, 1).ToString();
                this.RadioType_Default.Text           = this.bll.GetFieldContent(content, 2, 1).ToString();
                this.DivOptionType.Style["display"]   = "";
                this.DivTextType.Style["display"]     = "none";
                break;

            //多选项
            case "ListBoxType":
                this.ListBoxType_Content.Text        = this.bll.GetFieldContent(content, 0, 1).Replace("|", "\r\n");
                this.ListBoxType_Type.SelectedValue  = this.bll.GetFieldContent(content, 0, 0);
                this.DivListBoxType.Style["display"] = "";
                this.DivTextType.Style["display"]    = "none";
                break;

            //数字
            case "NumType":
                this.NumberType_TitleSize.Text      = this.bll.GetFieldContent(content, 0, 1);
                this.NumberType_Style.SelectedValue = this.bll.GetFieldContent(content, 1, 1);
                this.NumberType_Style.Enabled       = false;
                this.NumberType_DefaultValue.Text   = this.bll.GetFieldContent(content, 2, 1);
                this.DivNumType.Style["display"]    = "";
                this.DivTextType.Style["display"]   = "none";
                break;

            //日期时间
            case "DateType":
                this.DivDateType.Style["display"] = "";
                this.DivTextType.Style["display"] = "none";
                break;

            //图片
            case "PicType":
                this.RBLPicWaterMark.SelectedValue = this.bll.GetFieldContent(content, 0, 1);
                this.TxtSPicSize.Text             = this.bll.GetFieldContent(content, 1, 1);
                this.TxtPicExt.Text               = this.bll.GetFieldContent(content, 2, 1);
                this.DivPicType.Style["display"]  = "";
                this.DivTextType.Style["display"] = "none";
                break;

            //多图片
            case "MultiPicType":
                if (DataConverter.CBool(this.bll.GetFieldContent(content, 0, 1)))
                {
                    this.ChkThumb.Checked = true;
                    this.TxtThumb.Text    = this.bll.GetFieldContent(content, 1, 1);
                }
                else
                {
                    this.ChkThumb.Checked = false;
                    this.TxtThumb.Text    = "";
                }
                this.ChkThumb.Enabled                 = false;
                this.TxtThumb.Enabled                 = false;
                this.RBLWaterMark.SelectedValue       = this.bll.GetFieldContent(content, 2, 1);
                this.TxtPicSize.Text                  = this.bll.GetFieldContent(content, 3, 1);
                this.TextImageType.Text               = this.bll.GetFieldContent(content, 4, 1);
                this.DivMultiPicType.Style["display"] = "";
                this.DivTextType.Style["display"]     = "none";
                break;

            //文件
            case "FileType":
                if (DataConverter.CBool(this.bll.GetFieldContent(content, 0, 1)))
                {
                    this.ChkFileSize.Checked   = true;
                    this.TxtFileSizeField.Text = this.bll.GetFieldContent(content, 1, 1);
                }
                else
                {
                    this.ChkFileSize.Checked   = false;
                    this.TxtFileSizeField.Text = "";
                }
                this.ChkFileSize.Enabled          = false;
                this.TxtFileSizeField.Enabled     = false;
                this.TxtMaxFileSize.Text          = this.bll.GetFieldContent(content, 2, 1);
                this.TxtUploadFileType.Text       = this.bll.GetFieldContent(content, 3, 1);
                this.DivFileType.Style["display"] = "";
                this.DivTextType.Style["display"] = "none";
                break;

            //运行平台
            case "OperatingType":
                this.TxtOperatingOption.Text           = this.bll.GetFieldContent(content, 1, 1).Replace("|", "\r\n");
                this.OperatingType_TitleSize.Text      = this.bll.GetFieldContent(content, 0, 1);
                this.OperatingType_DefaultValue.Text   = this.bll.GetFieldContent(content, 2, 1);
                this.DivOperatingType.Style["display"] = "";
                this.DivTextType.Style["display"]      = "none";
                break;

            //超链接
            case "SuperLinkType":
                this.SuperLinkType_TitleSize.Text      = this.bll.GetFieldContent(content, 0, 1);
                this.SuperLinkType_DefaultValue.Text   = this.bll.GetFieldContent(content, 1, 1);
                this.DivSuperLinkType.Style["display"] = "";
                this.DivTextType.Style["display"]      = "none";
                break;
            }
        }
Example #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            B_Admin badmin = new B_Admin();

            if (!this.Page.IsPostBack)
            {
                string Pubid = string.IsNullOrEmpty(Request.QueryString["Pubid"].ToString()) ? "0" : Request.QueryString["Pubid"].ToString();
                pubMod = bpub.SelReturnModel(DataConverter.CLng(Pubid));
                string prowinfo = B_Role.GetPowerInfoByIDs(badmin.GetAdminLogin().RoleList);
                if (!badmin.GetAdminLogin().RoleList.Contains(",1,") && !prowinfo.Contains("," + pubMod.PubTableName + ","))
                {
                    function.WriteErrMsg("无权限管理该互动信息!!");
                }
                int ModelID = DataConverter.CLng(bpub.GetSelect(DataConverter.CLng(Pubid)).PubModelID.ToString());
                this.HdnPubid.Value = Pubid.ToString();
                this.HdnType.Value  = string.IsNullOrEmpty(Request.QueryString["small"]) ? null : Request.QueryString["small"].ToString();
                if (DataConverter.CLng(Pubid) <= 0)
                {
                    function.WriteErrMsg("缺少用户模型ID参数!");
                }
                M_ModelInfo model = bmodel.GetModelById(ModelID);
                this.HdnModel.Value = ModelID.ToString();
                int ID = string.IsNullOrEmpty(Request.QueryString["ID"]) ? 0 : DataConverter.CLng(Request.QueryString["ID"]);
                this.HdnID.Value = ID.ToString();
                DataTable UserData = new DataTable();
                UserData = buser.GetUserModeInfo(model.TableName, ID, 12);
                DataRow dr;
                if (UserData == null)
                {
                    dr = null;
                }
                else
                {
                    if (UserData.Rows.Count == 0)
                    {
                        dr = null;
                    }
                    else
                    {
                        dr = UserData.Rows[0];
                    }
                }
                if (dr == null)
                {
                    this.LblModelName.Text = "添加" + model.ModelName;
                }
                else
                {
                    this.LblModelName.Text  = "修改" + model.ModelName;
                    this.TextBox1.Text      = dr["PubTitle"].ToString();
                    this.tx_PubContent.Text = dr["PubContent"].ToString();

                    this.HdnID.Value = dr["ID"].ToString();
                }
                string Html = bfield.InputallHtml(ModelID, 0, new ModelConfig()
                {
                    ValueDR = dr
                });
                ModelHtml.Text = Html;
                Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>工作台</a></li><li><a href='pubmanage.aspx'>互动管理</a></li><li>修改信息</li>");
            }
        }
Example #14
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            this.GetIsOk();
            int    ModelID       = DataConverter.CLng(this.HdfModelID.Value);
            int    FieldID       = DataConverter.CLng(this.HdfFieldID.Value);
            string text          = this.Name.Text;
            string str2          = this.Alias.Text;
            string str3          = this.Description.Text;
            bool   flag          = DataConverter.CBool(this.IsNotNull.SelectedValue);
            bool   flag2         = DataConverter.CBool(this.IsSearchForm.SelectedValue);
            string selectedValue = this.Type.SelectedValue;
            string str7          = "";

            switch (selectedValue)
            {
            //单行文本
            case "TextType":
                str7 = "TitleSize=" + this.TitleSize.Text + ",IsPassword="******",DefaultValue=" + this.TextType_DefaultValue.Text + "";
                break;

            //多行文本(不支持Html)
            case "MultipleTextType":
                str7 = "Width=" + this.MultipleTextType_Width.Text + ",Height=" + this.MultipleTextType_Height.Text + "";
                break;

            //多行文本(支持Html)
            case "MultipleHtmlType":
                str7 = "Width=" + this.MultipleHtmlType_Width.Text + ",Height=" + this.MultipleHtmlType_Height.Text + ",IsEditor=" + this.IsEditor.SelectedValue + "";
                break;

            //单选项
            case "OptionType":
                str7 = "" + this.RadioType_Type.SelectedValue + "=" + this.RadioType_Content.Text.Trim().Replace(" ", "").Replace("\r\n", "|") + ",Property=" + this.RadioType_Property.Text + ",Default=" + this.RadioType_Default.Text + "";
                break;

            //多选项
            case "ListBoxType":
                str7 = "" + this.ListBoxType_Type.SelectedValue + "=" + this.ListBoxType_Content.Text.Trim().Replace(" ", "").Replace("\r\n", "|") + "";
                break;

            //数字
            case "NumType":
                str7 = "TitleSize=" + this.NumberType_TitleSize.Text + ",NumberType=" + this.NumberType_Style.SelectedValue + ",DefaultValue=" + this.NumberType_DefaultValue.Text + "";
                break;

            //日期时间
            case "DateType":
                str7 = "";
                break;

            //图片
            case "PicType":
                str7 = "Warter=" + this.RBLPicWaterMark.SelectedValue + ",MaxPicSize=" + this.TxtSPicSize.Text + ",PicFileExt=" + this.TxtPicExt.Text;
                break;

            //多图片
            case "MultiPicType":
                str7 = "ChkThumb=" + (this.ChkThumb.Checked ? "1" : "0") + ",ThumbField=" + this.TxtThumb.Text + ",Warter=" + this.RBLPicWaterMark.SelectedValue + ",MaxPicSize=" + this.TxtSPicSize.Text + ",PicFileExt=" + this.TextImageType.Text;
                break;

            //文件
            case "FileType":
                str7 = "ChkFileSize=" + (this.ChkFileSize.Checked ? "1" : "0") + ",FileSizeField=" + this.TxtFileSizeField.Text + ",MaxFileSize=" + this.TxtMaxFileSize.Text + ",UploadFileExt=" + this.TxtUploadFileType.Text;

                break;

            //运行平台
            case "OperatingType":
                str7 = "TitleSize=" + this.OperatingType_TitleSize.Text + ",OperatingList=" + this.TxtOperatingOption.Text.Trim().Replace(" ", "").Replace("\r\n", "|") + ",DefaultValue=" + this.OperatingType_DefaultValue.Text;
                break;

            //超链接
            case "SuperLinkType":
                str7 = "TitleSize=" + this.SuperLinkType_TitleSize.Text + ",DefaultValue=" + this.SuperLinkType_DefaultValue.Text;
                break;

            default:
                str7 = "";
                break;
            }
            M_ModelField modelfield = new M_ModelField();

            modelfield.ModelID      = ModelID;
            modelfield.FieldID      = FieldID;
            modelfield.FieldName    = text;
            modelfield.FieldAlias   = str2;
            modelfield.Description  = str3;
            modelfield.FieldTips    = this.Tips.Text.Trim();
            modelfield.FieldType    = selectedValue;
            modelfield.Content      = str7;
            modelfield.IsNotNull    = flag;
            modelfield.IsSearchForm = flag2;
            //modelfield.OrderID = DataConverter.CLng(this.hdfOrder.Value);

            this.bll.Update(modelfield);
            //this.bll.ModelFieldHtml(ModelID);
            Response.Redirect("UserModelField.aspx?ModelID=" + ModelID.ToString());
        }
 public void Init()
 {
     converter = new DataConverter(Base64Converter.Instance);
 }
Example #16
0
        /// <summary>
        /// 添加对象
        /// </summary>
        public void AddObject1()
        {
            int    count    = 0;
            string parentid = "";

            if (treeList1.FocusedNode == null)
            {
                return;
            }

            if (treeList1.FocusedNode != null)
            {
                parentid = treeList1.FocusedNode["UID"].ToString();
            }

            object objs = Services.BaseService.GetObject("SelectPowerEachTotalBySortID", parentid);

            if (objs != null)
            {
                count = (int)objs;
            }


            FormTypeTitle frm = new FormTypeTitle();

            frm.Text = "增加项目";

            if (frm.ShowDialog() == DialogResult.OK)
            {
                PowerEachTotal obj = new PowerEachTotal();
                obj.SortID       = count + 1;
                obj.ParentID     = parentid;
                obj.PowerLineUID = lineuid;
                obj.StuffName    = frm.TypeTitle;

                try
                {
                    Services.BaseService.Create <PowerEachTotal>(obj);
                    dataTable.Rows.Add(DataConverter.ObjectToRow(obj, dataTable.NewRow()));
                    //psp_Type.ID = (int)Common.Services.BaseService.Create("InsertPowerTypes", psp_Type);
                    //dataTable.Rows.Add(Itop.Common.DataConverter.ObjectToRow(psp_Type, dataTable.NewRow()));
                }
                catch (Exception ex)
                {
                    MsgBox.Show("增加项目出错:" + ex.Message);
                }
            }


            //////PowerEachTotal obj = new PowerEachTotal();
            //////obj.SortID = count + 1;
            //////obj.ParentID = parentid;
            //////obj.PowerLineUID = lineuid;
            //////using (FrmPowerEachTotalDialog dlg = new FrmPowerEachTotalDialog())
            //////{
            //////    dlg.IsCreate = true;    //设置新建标志
            //////    dlg.Object = obj;
            //////    if (dlg.ShowDialog() != DialogResult.OK)
            //////    {
            //////        return;
            //////    }
            //////}
            //////dataTable.Rows.Add(DataConverter.ObjectToRow(obj, dataTable.NewRow()));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            B_Admin badmin = new B_Admin();

            if (!IsPostBack)
            {
                B_ARoleAuth.CheckEx(ZLEnum.Auth.model, "NodeEdit");
                this.DropDownList1.DataSource     = pll.SelectNode(5);
                this.DropDownList1.DataTextField  = "PubName";
                this.DropDownList1.DataValueField = "Pubid";
                this.DropDownList1.DataBind();
                this.DropDownList1.Items.Insert(0, new ListItem("选择绑定", "0"));
                if (NodeID < 1)
                {
                    if (ParentID == 0)
                    {
                        this.LblNodeName.Text = "根节点";
                    }
                    else
                    {
                        M_Node parentMod = this.bll.GetNodeXML(ParentID);
                        this.LblNodeName.Text = parentMod.NodeName;
                    }
                    function.Script(this, "BindPY();");
                }
                else
                {
                    M_Node nodeMod = this.bll.GetNodeXML(NodeID);
                    if (nodeMod.IsNull)
                    {
                        function.WriteErrMsg("指定要编辑的节点不存在");
                    }
                    if (nodeMod.ParentID == 0)
                    {
                        this.LblNodeName.Text = "根节点";
                    }
                    else
                    {
                        M_Node parentMod = this.bll.GetNodeXML(nodeMod.ParentID);
                        this.LblNodeName.Text = parentMod.NodeName;
                    }
                    //this.HdnNodeID.Value = mNodeID;
                    //this.HdnDepth.Value = node.Depth.ToString();
                    //this.HdnParentId.Value = node.ParentID.ToString();
                    //this.HdnOrderID.Value = node.OrderID.ToString();
                    this.TxtNodeName.Text          = nodeMod.NodeName;
                    this.TxtNodeDir.Text           = nodeMod.NodeDir;
                    this.TxtNodePicUrl.Text        = nodeMod.NodePic;
                    this.TxtTips.Text              = nodeMod.Tips;
                    this.RBLPosition.SelectedValue = nodeMod.HtmlPosition.ToString();
                    this.TxtMetaKeywords.Text      = nodeMod.Meta_Keywords;
                    this.TxtMetaDescription.Text   = nodeMod.Meta_Description;
                    this.RBLOpenType.SelectedValue = DataConverter.CLng(nodeMod.OpenNew).ToString();
                    //this.TxtSinglepageTemplate_hid.Value = nodeMod.IndexTemplate;
                    //-----模板
                    TxtTemplate_hid.Value            = nodeMod.ListTemplateFile;
                    IndexTemplate_hid.Value          = nodeMod.IndexTemplate;
                    LastinfoTemplate_hid.Value       = nodeMod.LastinfoTemplate;
                    ProposeTemplate_hid.Value        = nodeMod.ProposeTemplate;
                    HotinfoTemplate_hid.Value        = nodeMod.HotinfoTemplate;
                    this.RBLListEx.SelectedValue     = nodeMod.ListPageHtmlEx.ToString();
                    LastinfoPageEx_Rad.SelectedValue = nodeMod.LastinfoPageEx.ToString();
                    HotinfoPageEx.SelectedValue      = nodeMod.HotinfoPageEx.ToString();
                    ProposePageEx.SelectedValue      = nodeMod.ProposePageEx.ToString();
                    LastinfoPageEx_Rad.SelectedValue = nodeMod.LastinfoPageEx.ToString();

                    this.SafeGuard.SelectedValue       = nodeMod.SafeGuard.ToString();
                    this.RBLItemOpenType.SelectedValue = nodeMod.ItemOpenType.ToString();;
                    this.RBLOpenType.SelectedValue     = nodeMod.OpenTypeTrue.ToString();
                    this.RBLItemOpenType.SelectedValue = nodeMod.ItemOpenTypeTrue.ToString();
                    M_Pub pubMod = pll.GetSelectNode(NodeID.ToString());
                    if (pubMod.Pubid > 0)
                    {
                        this.DropDownList1.SelectedValue = pubMod.Pubid.ToString();
                    }
                }
                Call.SetBreadCrumb(Master, "<li>工作台</li><li><a href='" + customPath2 + "Config/SiteInfo.aspx'>系统设置</a></li><li>" + (ViewMode.Equals("design") ? "<a href='DesignNodeManage.aspx'>动力节点</a>" : "<a href='NodeManage.aspx'>节点管理</a>") + "</li><li class=\"active\">修改单页节点</li>");
            }
        }
Example #18
0
        /// <summary>
        /// 获取广告的最大ID
        /// </summary>
        /// <returns></returns>
        public static int MaxID()
        {
            string sql = "select max(ADID) from ZL_Advertisement";

            return(DataConverter.CLng(SqlHelper.ExecuteScalar(CommandType.Text, sql, null)) + 1);
        }
 /// <summary>
 /// Initializes this instance of EndianAwareBinaryReader with the given input stream,
 /// the given text encoding, and the Endianness of the given DataConverter
 /// </summary>
 /// <param name="output">The stream to read input From</param>
 /// <param name="encoding">The encoding to read text with</param>
 /// <param name="DataConverter">The DataConverter with the Endianness to use</param>
 public EndianAwareBinaryReader(System.IO.Stream output, System.Text.Encoding encoding, DataConverter DataConverter)
     : base(output, encoding)
 {
     this._DataConverter = DataConverter;
     this._ExplicitEncoding = this._AssumedEffectiveEncoding = encoding;
 }
Example #20
0
 /// <summary> Gets the data as it appears in file </summary>
 public string GetRawText()
 => DataConverter.SuccFromDataStructure(TopLevelLines);
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsAdminManage)
     {
         this.LitSaveRemotePic.Visible = false;
         this.ChkSaveRemotePic.Visible = false;
     }
     if (base.EnableNull)
     {
         this.ValrContent.Visible = true;
     }
     this.EditorContent.Width  = new Unit(DataConverter.CLng(base.Settings[0]));
     this.EditorContent.Height = new Unit(DataConverter.CLng(base.Settings[1]));
     if (base.Settings.Count > 9)
     {
         if (!string.IsNullOrEmpty(base.Settings[6]))
         {
             this.EditorContent.ImageUploadAllowedExtensions = base.Settings[6];
         }
         if (!string.IsNullOrEmpty(base.Settings[7]))
         {
             this.EditorContent.FlashUploadAllowedExtensions = base.Settings[7];
         }
         if (!string.IsNullOrEmpty(base.Settings[8]))
         {
             this.EditorContent.LinkUploadAllowedExtensions = base.Settings[8];
         }
         if (!string.IsNullOrEmpty(base.Settings[9]))
         {
             this.EditorContent.IsWatermark = base.Settings[9];
         }
         if (!string.IsNullOrEmpty(base.Settings[10]))
         {
             this.EditorContent.IsThumb = base.Settings[10];
         }
     }
     else if (base.Settings.Count != 6)
     {
         this.EditorContent.ImageUploadAllowedExtensions = base.Settings[2];
         this.EditorContent.FlashUploadAllowedExtensions = base.Settings[3];
         this.EditorContent.LinkUploadAllowedExtensions  = base.Settings[4];
         this.EditorContent.IsWatermark = base.Settings[5];
         this.EditorContent.IsThumb     = base.Settings[6];
     }
     if (base.Settings.Count != 6)
     {
         this.EditorContent.ModelId   = BaseUserControl.RequestInt32("ModelID").ToString();
         this.EditorContent.FieldName = base.FieldName;
     }
     this.EditorContent.ImgPreview = "true";
     if (this.IsUpload)
     {
         this.EditorContent.IsUpload = "true";
     }
     if ((!base.IsPostBack && !string.IsNullOrEmpty(this.m_DefaultPicUrl)) && !this.Page.ClientScript.IsStartupScriptRegistered(base.GetType(), "initDefaultPicUrl"))
     {
         StringBuilder builder = new StringBuilder();
         builder.Append("<script language=\"JavaScript\">\n");
         builder.Append("<!--\n");
         builder.Append("setTimeout(\"try{setpic('" + this.DefaultPicurl + "')}catch(e){}\",1000);\n");
         builder.Append("//-->\n");
         builder.Append("</script>\n");
         this.Page.ClientScript.RegisterStartupScript(base.GetType(), "initDefaultPicUrl", builder.ToString());
     }
 }
 public ClickupCommentFormat()
 {
     dataConverterHelper = new DataConverter();
 }
Example #23
0
        public int Add(M_PageReg m_PageReg)
        {
            string strSQL = "INSERT INTO [" + strTableName + "](" + BLLCommon.GetFields(m_PageReg) + ")VALUES(" + BLLCommon.GetParas(m_PageReg) + ")";

            return(DataConverter.CLng(SqlHelper.ExecuteScalar(CommandType.Text, strSQL, m_PageReg.GetParameters())));
        }
Example #24
0
 public ImageDealLib.WaterType GetWaterType(string pos)
 {
     return((ImageDealLib.WaterType)Enum.ToObject(typeof(ImageDealLib.WaterType), DataConverter.CLng(pos)));
 }
 /// <summary>
 /// 得到所有行数(异步方式)
 /// </summary>
 /// <param name="strWhere">参数化查询条件(例如: and Name = @Name )</param>
 /// <param name="dict">参数的名/值集合</param>
 /// <returns></returns>
 public virtual async Task <int> GetCountAsync(string strWhere, Dictionary <string, object> dict = null)
 {
     return(DataConverter.CLng(await GetScalarAsync("count(*)", strWhere, dict), 0));
 }
Example #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            B_User.CheckIsLogged();
            if (function.isAjax())
            {
                string action = Request.Form["action"], vpath = Request.Form["vpath"], result = "", warning = "";//动作,需要加水印的图片路径
                if (vpath.Contains("?"))
                {
                    vpath = vpath.Substring(0, vpath.IndexOf("?"));
                }
                switch (action)
                {
                case "crop":    //根据提交的图片路径与宽度等参数,完成剪切
                {
                    int x1     = int.Parse(Request["x1"]);
                    int y1     = int.Parse(Request["y1"]);
                    int width  = int.Parse(Request["width"]);
                    int height = int.Parse(Request["height"]);
                    savePath += (function.GetRandomString(4) + Path.GetFileName(vpath));
                    result    = ImageDealLib.imgcrop(vpath, savePath, x1, y1, width, height, ImageDealLib.FileCache.Save, out warning);
                }
                break;

                case "rotate":
                {
                    int    angle = DataConverter.CLng(Request.Form["angle"]);
                    Bitmap bmp   = imgHelper.Rotate(vpath, angle);
                    savePath += function.GetRandomString(6) + Path.GetExtension(vpath);
                    result    = imgHelper.SaveImg(savePath, bmp);
                    bmp.Dispose();
                }
                break;

                case "zoom":    //缩放
                {
                    int width  = int.Parse(Request.Form["width"]);
                    int height = int.Parse(Request.Form["height"]);
                    savePath += (function.GetRandomString(4) + Path.GetFileName(vpath));
                    Bitmap bmp = imgHelper.ZoomImg(vpath, height, width);
                    result = imgHelper.SaveImg(savePath, bmp);
                }
                break;

                case "fontwater":    //文字水印
                {
                    System.Drawing.Image fontimg = AddFontWater(savePath + function.GetRandomString(6) + ".jpg");
                    savePath += "fontw_" + Path.GetFileName(vpath);
                    result    = ImageDealLib.makewatermark(vpath, fontimg, GetWaterType(Request.Form["pos"]), savePath, ImageDealLib.ImageType.JPEG, ImageDealLib.FileCache.Save, out warning);
                    result   += "?" + function.GetRandomString(6);
                }
                break;

                case "imgwater":    //水印图片路径
                {
                    string watervpath = Request.Form["watervpath"];
                    int    trans      = DataConverter.CLng(Request.Form["trans"]);
                    savePath += "imgw_" + Path.GetFileName(vpath);
                    result    = ImageDealLib.makewatermark(vpath, watervpath, GetWaterType(Request.Form["pos"]), savePath, ImageDealLib.ImageType.JPEG, ImageDealLib.FileCache.Save, out warning, trans);
                    result   += "?" + function.GetRandomString(6);
                }
                break;
                }
                Response.Write(result); Response.Flush(); Response.End();
            }
            if (!IsPostBack)
            {
                M_UserInfo mu       = buser.GetLogin();
                string     ipath    = Request.QueryString["ipath"].ToLower().Replace("/uploadfiles/user/", "");
                string     UserPath = "/UploadFiles/User/" + mu.UserName + mu.UserID + "/" + ipath.TrimStart('/');//不做过多的限制,如需要文件安全,则使用单独的文件服务器
                if (string.IsNullOrEmpty(UserPath) || !SafeC.IsImage(UserPath))
                {
                    function.WriteErrMsg("只允许编辑图片文件!");
                }
                if (!Directory.Exists(Server.MapPath(savePath)))
                {
                    Directory.CreateDirectory(Server.MapPath(savePath));
                }
                if (!File.Exists(Server.MapPath(UserPath)))
                {
                    function.WriteErrMsg("需要修改的图片" + UserPath + "不存在");
                }
                NowImg_Hid.Value = SourceImg_Hid.Value = UserPath;
                System.Drawing.Image img = System.Drawing.Image.FromFile(Server.MapPath(UserPath));
                ImgWidth_Hid.Value  = img.Width.ToString();
                ImgHeight_Hid.Value = img.Height.ToString();
                RPT.DataSource      = GetWaterImgDT();
                RPT.DataBind();
                img.Dispose();
            }
        }
 /// <summary>
 /// 得到所有行数(异步方式)
 /// </summary>
 /// <returns></returns>
 public virtual async Task <int> GetCountAsync()
 {
     return(DataConverter.CLng(await GetScalarAsync("count(*)"), 0));
 }
        protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            int num3;
            IEncourageStrategy <int> strategy;
            string toUser = this.HdnUsersId.Value;
            int    num    = DataConverter.CLng(this.TxtValidNum.Text.Trim());
            int    num2   = DataConverter.CLng(this.DropValidUnit.SelectedValue);
            string reason = this.TxtReason.Text.Trim();
            string text   = this.TxtMemo.Text;

            if (this.RadValidType.Checked && ((num <= 0) || (num > 0x270f)))
            {
                AdminPage.WriteErrMsg("<li>指定期限必须为数字并且必须大于0小于9999!</li>");
            }
            if (this.RadValidType.Checked)
            {
                switch (num2)
                {
                case 1:
                    num3 = num;
                    goto Label_00BF;

                case 2:
                    num3 = num * 30;
                    goto Label_00BF;

                case 3:
                    num3 = num * 0x16d;
                    goto Label_00BF;
                }
                num3 = num;
            }
            else
            {
                num3 = 0x270f;
            }
Label_00BF:
            strategy = new UserDate();
            if (strategy.IncreaseForUsers(toUser, -num3, reason, true, text))
            {
                StringBuilder builder = new StringBuilder();
                builder.Append("<li>用户扣除有效期成功!</li>");
                if (this.ChkIsSendMessage.Checked)
                {
                    UserInfo userById            = Users.GetUserById(DataConverter.CLng(toUser));
                    string   payoutPeriodMessage = SiteConfig.SmsConfig.PayoutPeriodMessage;
                    if (this.RadValidType2.Checked)
                    {
                        payoutPeriodMessage = payoutPeriodMessage.Replace("{$Valid}", "归零");
                    }
                    else
                    {
                        payoutPeriodMessage = payoutPeriodMessage.Replace("{$Valid}", num3.ToString());
                    }
                    payoutPeriodMessage = payoutPeriodMessage.Replace("{$Reason}", reason);
                    builder.Append(Users.SendMessageToUser(userById, payoutPeriodMessage));
                }
                AdminPage.WriteSuccessMsg(builder.ToString(), "UserShow.aspx?UserID=" + toUser);
            }
            else
            {
                AdminPage.WriteErrMsg("<li>用户扣除有效期失败!</li>");
            }
        }
Example #29
0
        //提交订单
        protected void AddOrder_Btn_Click(object sender, EventArgs e)
        {
            if (Address_Div.Visible && DataConvert.CLng(Request.Form["address_rad"]) < 1)
            {
                function.WriteErrMsg("尚未选定收货地址");
            }
            //1,生成订单,2,关联购物车中商品为已绑定订单
            M_UserInfo  mu      = buser.GetLogin(false);
            M_UserRecei receMod = receBll.GetSelect(Convert.ToInt32(Request.Form["address_rad"]), mu.UserID);
            DataTable   cartDT  = cartBll.SelByCartID(B_Cart.GetCartID(), mu.UserID, ProClass, ids);//需要购买的商品

            if (cartDT.Rows.Count < 1)
            {
                function.WriteErrMsg("你尚未选择商品,<a href='/User/Order/OrderList'>查看我的订单</a>");
            }
            //------生成订单前检测区
            foreach (DataRow dr in cartDT.Rows)
            {
                if (!HasStock(dr["Allowed"], DataConvert.CLng(dr["stock"]), Convert.ToInt32(dr["Pronum"])))
                {
                    function.WriteErrMsg("购买失败," + dr["proname"] + "的库存数量不足");
                }
            }
            //------检测End
            //按店铺生成订单,统一存ZL_Orderinfo
            DataTable          storeDT   = cartDT.DefaultView.ToTable(true, "StoreID");
            List <M_OrderList> orderList = new List <M_OrderList>();//用于生成临时订单,统计计算(Disuse)

            foreach (DataRow dr in storeDT.Rows)
            {
                #region 暂不使用字段
                //Odata.province = this.DropDownList1.SelectedValue;
                //Odata.city = this.DropDownList2.SelectedValue;//将地址省份与市ID存入,XML数据源
                //Odata.Guojia = "";//国家
                //Odata.Chengshi = DropDownList2.SelectedItem.Text;//城市
                //Odata.Diqu = DropDownList3.SelectedItem.Text;//地区
                //Odata.Delivery = DataConverter.CLng(Request.Form["Delivery"]);
                //Odata.Deliverytime = DataConverter.CLng(this.Deliverytime.Text);
                //Odata.Mobile = receMod.MobileNum;
                #endregion
                M_OrderList Odata = new M_OrderList();
                Odata.Ordertype = OrderHelper.GetOrderType(ProClass);
                Odata.OrderNo   = B_OrderList.CreateOrderNo((M_OrderList.OrderEnum)Odata.Ordertype);
                Odata.StoreID   = Convert.ToInt32(dr["StoreID"]);
                cartDT.DefaultView.RowFilter = "StoreID=" + Odata.StoreID;
                DataTable storeCartDT = cartDT.DefaultView.ToTable();
                switch (ProClass)//旅游机票等,以联系人信息为地址
                {
                case 7:
                case 8:
                    M_Cart_Travel   model = JsonConvert.DeserializeObject <M_Cart_Travel>(storeCartDT.Rows[0]["Additional"].ToString());
                    M_Cart_Contract user  = model.Contract[0];
                    Odata.Receiver  = user.Name;
                    Odata.Reuser    = user.Name;
                    Odata.Phone     = user.Mobile;
                    Odata.MobileNum = user.Mobile;
                    Odata.Email     = user.Email;
                    break;

                default:
                    if (Address_Div.Visible)
                    {
                        Odata.Receiver  = receMod.ReceivName;
                        Odata.Reuser    = receMod.ReceivName;
                        Odata.Phone     = receMod.phone;
                        Odata.MobileNum = receMod.MobileNum;
                        Odata.Email     = receMod.Email;
                        Odata.Shengfen  = receMod.Provinces;
                        Odata.Jiedao    = receMod.Street;
                        Odata.ZipCode   = receMod.Zipcode;
                    }
                    break;
                }
                Odata.Invoiceneeds    = DataConverter.CLng(Request.Form["invoice_rad"]);//是否需开发票
                Odata.Invoice         = Odata.Invoiceneeds == 0 ? "" : InvoTitle_T.Text + "||" + Invoice_T.Text;
                Odata.Rename          = mu.UserName;
                Odata.Outstock        = 0;              //缺货处理
                Odata.Ordermessage    = ORemind_T.Text; //订货留言
                Odata.Merchandiser    = "";             //跟单员
                Odata.Internalrecords = "";             //内部记录
                Odata.IsCount         = false;
                //-----金额计算
                Odata.Balance_price     = GetTotalMoney(storeCartDT);
                Odata.Freight           = GetFarePrice(storeCartDT, Odata.StoreID); //运费计算
                Odata.Ordersamount      = Odata.Balance_price + Odata.Freight;      //订单金额
                Odata.AllMoney_Json     = orderCom.GetTotalJson(storeCartDT);       //附加需要的虚拟币
                Odata.Specifiedprice    = Odata.Ordersamount;                       //订单金额;
                Odata.Receivablesamount = 0;                                        //收款金额
                Odata.Developedvotes    = 0;
                Odata.OrderStatus       = (int)M_OrderList.StatusEnum.Normal;       //订单状态
                Odata.Paymentstatus     = (int)M_OrderList.PayEnum.NoPay;           //付款状态
                Odata.StateLogistics    = 0;                                        //物流状态
                Odata.Signed            = 0;                                        //签收
                Odata.Settle            = 0;                                        //结清
                Odata.Aside             = 0;                                        //作废
                Odata.Suspended         = 0;                                        //暂停
                Odata.AddUser           = mu.UserName;;
                Odata.Userid            = mu.UserID;
                Odata.Integral          = DataConverter.CLng(Request.QueryString["jifen"]);
                Odata.Freight_remark    = " ";
                Odata.Balance_remark    = "";
                Odata.Promoter          = 0;
                Odata.id = orderBll.Adds(Odata);
                cartProBll.CopyToCartPro(mu, storeCartDT, Odata.id);
                orderList.Add(Odata);
                orderCom.SendMessage(Odata, null, "ordered");
            }
            cartBll.DelByids(ids);
            //-----------------订单生成后处理
            //进行减库存等操作
            foreach (DataRow dr in cartDT.Rows)
            {
                M_Product model = proBll.GetproductByid(Convert.ToInt32(dr["Proid"]));
                model.Stock = model.Stock - DataConvert.CLng(dr["Pronum"]);
                SqlHelper.ExecuteSql("Update ZL_Commodities Set Stock=" + model.Stock + " Where ID=" + model.ID);
            }
            //生成支付单,处理优惠券,并进入付款步骤
            M_Payment payMod = payBll.CreateByOrder(orderList);
            //优惠券
            if (!string.IsNullOrEmpty(Arrive_Hid.Value))
            {
                M_Arrive avMod  = avBll.SelModelByFlow(Arrive_Hid.Value, mu.UserID);
                double   money  = payMod.MoneyPay;
                string   err    = "";
                string   remind = "支付单抵扣[" + payMod.PayNo + "]";
                if (avBll.U_UseArrive(avMod, mu.UserID, ref money, ref err, remind))
                {
                    payMod.MoneyPay     = money;
                    payMod.ArriveMoney  = avMod.Amount;
                    payMod.ArriveDetail = avMod.ID.ToString();
                }
                else
                {
                    payMod.ArriveDetail = "优惠券[" + avMod.ID + "]异常 :" + err;
                }
            }
            //积分处理
            if (point_body.Visible && DataConvert.CLng(Point_T.Text) > 0)
            {
                int point    = DataConvert.CLng(Point_T.Text);
                int maxPoint = (int)((SiteConfig.ShopConfig.PointRatiot * 0.01) * (double)payMod.MoneyPay / SiteConfig.ShopConfig.PointRate);
                //if (point <= 0) { function.WriteErrMsg("积分数值不正确"); }
                if (point > mu.UserExp)
                {
                    function.WriteErrMsg("您的积分不足!");
                }
                if (point > maxPoint)
                {
                    function.WriteErrMsg("积分不能大于可兑换金额!");
                }
                //生成支付单时扣除用户积分
                buser.ChangeVirtualMoney(mu.UserID, new M_UserExpHis()
                {
                    ScoreType = (int)M_UserExpHis.SType.Point, score = -point, detail = "积分抵扣,支付单号:" + payMod.PayNo
                });
                payMod.MoneyPay = payMod.MoneyPay - (point * SiteConfig.ShopConfig.PointRate);
                payMod.UsePoint = point;
            }
            if (payMod.MoneyPay <= 0)
            {
                payMod.MoneyPay = 0.01;
            }
            payMod.Remark    = cartDT.Rows.Count > 1 ? "[" + cartDT.Rows[0]["ProName"] as string + "]等" : cartDT.Rows[0]["ProName"] as string;
            payMod.PaymentID = payBll.Add(payMod);
            Response.Redirect("/PayOnline/Orderpay.aspx?PayNo=" + payMod.PayNo);
        }
Example #30
0
        /// <summary>
        ///     Create a new TaskHubClient with given name, Service Bus and Azure Storage connection strings  with specified
        ///     settings.
        /// </summary>
        /// <param name="hubName">Name of the Task Hub</param>
        /// <param name="connectionString">Service Bus connection string</param>
        /// <param name="tableStoreConnectionString">Azure Storage connection string</param>
        /// <param name="settings">Client settings</param>
        public TaskHubClient(string hubName, string connectionString, string tableStoreConnectionString,
            TaskHubClientSettings settings)
        {
            this.hubName = hubName;
            this.connectionString = connectionString;
            messagingFactory = Utils.CreateMessagingFactory(connectionString);
            workerEntityName = string.Format(FrameworkConstants.WorkerEndpointFormat, this.hubName);
            orchestratorEntityName = string.Format(FrameworkConstants.OrchestratorEndpointFormat, this.hubName);
            defaultConverter = new JsonDataConverter();
            this.settings = settings;

            this.tableStoreConnectionString = tableStoreConnectionString;
            if (!string.IsNullOrEmpty(this.tableStoreConnectionString))
            {
                tableClient = new TableClient(this.hubName, this.tableStoreConnectionString);
            }
        }
Example #31
0
 public ByteBuffer()
 {
     this.c = DataConverter.BigEndian;
 }
        protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            M_Node nodeMod = new M_Node();

            if (NodeID > 0)
            {
                nodeMod = bll.SelReturnModel(NodeID);
            }
            else
            {
                nodeMod.ParentID = ParentID;
            }
            nodeMod.NodeName = this.TxtNodeName.Text;
            nodeMod.NodeType = 2;
            nodeMod.NodePic  = this.TxtNodePicUrl.Text;
            nodeMod.NodeDir  = this.TxtNodeDir.Text;
            nodeMod.NodeUrl  = "";
            //nodeMod.ParentID = DataConverter.CLng(this.HdnParentId.Value);
            //nodeMod.Depth = DataConverter.CLng(this.HdnDepth.Value);
            //nodeMod.OrderID = DataConverter.CLng(this.HdnOrderID.Value);
            nodeMod.Tips             = this.TxtTips.Text;
            nodeMod.Description      = this.TxtDescription.Text;
            nodeMod.Meta_Keywords    = this.TxtMetaKeywords.Text;
            nodeMod.Meta_Description = this.TxtMetaDescription.Text;
            nodeMod.OpenNew          = DataConverter.CBool(this.RBLOpenType.SelectedValue);
            nodeMod.ItemOpenType     = true;
            nodeMod.PurviewType      = false;
            nodeMod.CommentType      = "0";
            nodeMod.HitsOfHot        = 0;
            //----模板
            nodeMod.ListTemplateFile = TxtTemplate_hid.Value;
            nodeMod.IndexTemplate    = IndexTemplate_hid.Value;
            nodeMod.LastinfoTemplate = LastinfoTemplate_hid.Value;
            nodeMod.ProposeTemplate  = ProposeTemplate_hid.Value;
            nodeMod.HotinfoTemplate  = HotinfoTemplate_hid.Value;
            nodeMod.ContentModel     = "";
            nodeMod.ListPageHtmlEx   = DataConverter.CLng(this.RBLListEx.SelectedValue);
            nodeMod.ListPageEx       = DataConverter.CLng(ListPageEx_Rad.SelectedValue);
            nodeMod.LastinfoPageEx   = DataConverter.CLng(LastinfoPageEx_Rad.SelectedValue);
            nodeMod.HotinfoPageEx    = DataConverter.CLng(HotinfoPageEx.SelectedValue);
            nodeMod.ProposePageEx    = DataConverter.CLng(ProposePageEx.SelectedValue);

            nodeMod.ContentFileEx       = 0;
            nodeMod.ContentPageHtmlRule = 0;
            nodeMod.ConsumePoint        = 0;
            nodeMod.ConsumeType         = 0;
            nodeMod.ConsumeTime         = 0;
            nodeMod.ConsumeCount        = 0;
            nodeMod.Shares       = 0;
            nodeMod.Custom       = "";
            nodeMod.NodeListUrl  = "";
            nodeMod.SafeGuard    = DataConverter.CLng(this.SafeGuard.SelectedValue);
            nodeMod.ItemOpenType = DataConverter.CBool(this.RBLItemOpenType.SelectedValue);
            nodeMod.OpenTypeTrue = this.RBLOpenType.SelectedValue;
            nodeMod.HtmlPosition = DataConverter.CLng(RBLPosition.SelectedValue);
            if (NodeID > 0)
            {
                bll.UpdateNode(nodeMod);
            }
            else
            {
                nodeMod.NodeID = bll.AddNode(nodeMod); CreateFile(nodeMod);
            }
            if (ViewMode.Equals("design"))
            {
                function.WriteSuccessMsg("操作成功", CustomerPageAction.customPath2 + "Content/DesignNodeManage.aspx", 3000);
            }
            else
            {
                function.WriteSuccessMsg("操作成功", CustomerPageAction.customPath2 + "Content/NodeManage.aspx", 3000);
            }
        }
Example #33
0
        public string GetUpdateHtmlUser(int ModelID, int NodeID, DataTable dt1)
        {
            DataTable     dt      = this.dal.GetModelFieldList(ModelID).Tables[0];
            StringBuilder builder = new StringBuilder();

            if (dt1.Rows.Count > 0)
            {
                DataRow dr = dt1.Rows[0];
                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        builder.Append(GetShowStyleUser(dt.Rows[i]["FieldAlias"].ToString(), dt.Rows[i]["FieldName"].ToString(), DataConverter.CBool(dt.Rows[i]["IsNotNull"].ToString()), dt.Rows[i]["FieldType"].ToString(), dt.Rows[i]["Content"].ToString(), dt.Rows[i]["Description"].ToString(), ModelID, NodeID, dr));
                    }
                }
            }
            return(builder.ToString());
        }
        public void CreateFile(M_Node nodeMod)
        {
            string UName = this.TxtNodeDir.Text.Trim();
            string Ulook = "";

            if (!string.IsNullOrEmpty(Ulook))
            {
                if (RadioButtonList1.SelectedValue == "0")
                {
                    if (Ulook.IndexOf("http://") == -1)
                    {
                        Ulook = "http://" + Ulook;
                    }
                }
                if (RadioButtonList1.SelectedValue == "1")
                {
                    if (Ulook.IndexOf("~/") == -1)
                    {
                        Ulook = "~/" + Ulook;
                    }
                }
                string USend = "~/ColumnList.aspx?NodeID=" + nodeMod.NodeID;
                #region 文件生成
                USend = Ulook;
                string AbsPath = base.Request.PhysicalApplicationPath;
                if (USend.IndexOf("http://") > -1)
                {
                    if (USend.IndexOf("/", 8) > -1 && USend.Length > USend.IndexOf("/", 8) + 1)
                    {
                        string USend2 = USend.Substring(USend.IndexOf("/", 8));
                        if (USend2.IndexOf(".") > -1)
                        {
                            USend2 = USend2.Substring(USend2.IndexOf("."));
                        }
                        else
                        {
                            #region 文件生成
                            try
                            {
                                DirectoryInfo info = new DirectoryInfo(AbsPath + USend2 + @"\Default.aspx");
                                if (info.Exists)
                                {
                                    // Response.Write("<script>alert('文件以');</script>");
                                }
                                else
                                {
                                    FileSystemObject.Create(AbsPath + USend2 + @"\Default.aspx", FsoMethod.File);
                                    FileSystemObject.Create(AbsPath + USend2 + @"\Index.aspx", FsoMethod.File);
                                }
                            }
                            catch (FileNotFoundException)
                            {
                                function.WriteErrMsg("发生错误");
                            }
                            catch (UnauthorizedAccessException)
                            {
                                function.WriteErrMsg("发生错误");
                            }
                            #endregion
                        }
                    }
                }
                else
                {
                    string USend3 = USend.Substring(2);

                    if (USend.IndexOf(".") > -1)
                    {
                        //  USend = USend.Substring(USend.IndexOf("."));
                        //  Response.Write("<script>alert('" + USend3 + "');</script>");
                    }
                    else
                    {
                        #region 文件生成
                        try
                        {
                            DirectoryInfo info = new DirectoryInfo(AbsPath + USend3);
                            if (info.Exists)
                            {
                                //   Response.Write("<script>alert('aa');</script>");
                            }
                            else
                            {
                                FileSystemObject.Create(AbsPath + USend3 + @"\Default.aspx", FsoMethod.File);
                                FileSystemObject.Create(AbsPath + USend3 + @"\Index.aspx", FsoMethod.File);
                            }
                        }
                        catch (FileNotFoundException)
                        {
                            function.WriteErrMsg("发生错误");
                        }
                        catch (UnauthorizedAccessException)
                        {
                            function.WriteErrMsg("发生错误");
                        }
                        #endregion
                    }
                }
                #endregion
            }
            if (DropDownList1.SelectedValue != "0")
            {
                M_Pub pm = pll.GetSelect(DataConverter.CLng(DropDownList1.SelectedValue));
                pm.PubNodeID = nodeMod.NodeID.ToString();
                pll.GetUpdate(pm);
            }
        }
        public string GetUserName(string UserID)
        {
            B_User buser = new B_User();

            return(buser.SeachByID(DataConverter.CLng(UserID)).UserName);
        }
Example #36
0
 /// <summary>
 /// 将请求参数转换成Int32 如果为空或不能转换则赋值默认值
 /// </summary>
 /// <param name="queryItem">URL的请求参数</param>
 /// <param name="defaultValue">默认值</param>
 /// <returns>int整形</returns>
 public static int RequestInt32(string queryItem, int defaultValue)
 {
     return(DataConverter.CLng(HttpContext.Current.Request.QueryString[queryItem], defaultValue));
 }
Example #37
0
		public static void Save(Request request)
		{
			var service = ServiceManager.GetService<RequestService>();
			var dto = new DataConverter<Request>().Convert<RequestDTO>(request);
			dto.SourceType = RequestSourceEnum.External;
			var actionTypeEnum = request.IsNew ? ActionTypeEnum.Add : ActionTypeEnum.Update;
			try
			{
				if(request.IsNew)
				{
					request.ID = service.Save(dto, Requester.Logged.ID, request.IsUrgent);
					request.RequestID = request.ID;
				}
				else
				{
					request.LastEditorID = Requester.Logged.ID;
					service.Update(dto);
				}

				var actionProcessor = new ActionProcessor();

				actionProcessor.ProcessAction(actionTypeEnum, request);
			}
			catch (Exception ex)
			{
				log.Debug("Error catched", ex);

				var error = ex.Message;

				if (ex.Message.Contains("AccessDeniedException"))
				{
					error = "The request was not posted. Access is denied.";
				}

				if (ex.Message.Contains("password is invalid"))
				{
					error = "The request was not posted. The provided password is invalid.";
				}

				ActionProcessor.SetLastAction(error, null, ActionTypeEnum.None);
				ActionProcessor.IsError = true;
			}
		}
Example #38
0
 public static string GetCRC326HashAsHexString(byte[] data)
 {
     var crc32Implementation = new CRC32();
     byte[] hashData = crc32Implementation.ComputeHash(data);
     return DataConverter.ByteArrayToHexString(hashData);
 }
 /// <summary>
 /// Initializes this instance of EndianAwareBinaryReader with the given input stream,
 /// assuming a default text encoding, and using the Endianness of the given DataConverter
 /// </summary>
 /// <param name="output">The stream to read input From</param>
 /// <param name="DataConverter">The DataConverter with the Endianness to use</param>
 public EndianAwareBinaryReader(System.IO.Stream output, DataConverter DataConverter)
     : base(output)
 {
     this._DataConverter = DataConverter;
 }
Example #40
0
		public static void Save(Requester requester)
		{
			log.DebugFormat("Save requester with id '{0}'", requester.ID);
			var service = ServiceManager.GetService<RequesterService>();
			var dto = new DataConverter<Requester>().Convert<RequesterDTO>(requester);
			int? requesterId;

			if (requester.IsNew)
			{
				requesterId = service.Create(dto);
			}
			else
			{
				service.Update(dto);
				requesterId = dto.ID;
				DataPortal.Instance.ResetCachedValue(typeof(Requester), requesterId);
			}
			
			var actionProcessor = new ActionProcessor();
			requester.ID = requesterId;
			requester.UserID = requesterId;
			ActionTypeEnum actionTypeEnum = requester.IsNew ? ActionTypeEnum.Add : ActionTypeEnum.Update;
			actionProcessor.ProcessAction(actionTypeEnum, requester);
		}