コード例 #1
0
ファイル: Edit.aspx.cs プロジェクト: crestviewshanghai/Tony
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            hlBack.NavigateUrl = "List.aspx?active=" + Request.QueryString["active"];

            MojoCube.Web.Sql.DropDownListBind(ddlStatus, "Sys_StatusID", "StatusName_CHS", "ID", "TableName='Comment_List'", "ID", "asc");

            if (Request.QueryString["id"] != null)
            {
                ViewState["pk_Comment"] = MojoCube.Api.Text.Security.DecryptString(Request.QueryString["id"]);

                MojoCube.Web.Comment.List list = new MojoCube.Web.Comment.List();
                list.GetData(int.Parse(ViewState["pk_Comment"].ToString()));

                lblTitle.Text       = list.Title;
                lblFrom.Text        = "创建:" + list.Author;
                lblDate.Text        = list.CreateDate;
                lblDescription.Text = list.Description.Replace("\n", "<br/>");
                txtDescription.Text = list.Feedback;
                MojoCube.Web.Sql.ddlFindByValue(ddlStatus, list.StatusID.ToString());

                if (!list.IsRead)
                {
                    list.IsRead   = true;
                    list.ReadDate = DateTime.Now.ToString();
                    list.UpdateData(list.pk_Comment);
                }

                this.Title = "留言编辑:" + lblTitle.Text.Trim();
            }
        }
    }
コード例 #2
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (txtTitle.Text == "" || txtName.Text == "" || txtPhone.Text.Trim() == "")
        {
            MojoCube.Api.UI.Script.ScriptMessage(this, "请填写完整");
            return;
        }

        //判断是否存在用户名及验证码是否正确
        if (Session["SiteCheckCode"] == null)
        {
            MojoCube.Api.UI.Script.ScriptMessage(this, "请填写验证码");
            return;
        }
        if (Session["SiteCheckCode"] != null && Session["SiteCheckCode"].ToString().ToLower() != txtCode.Text.Trim().ToLower())
        {
            MojoCube.Api.UI.Script.ScriptMessage(this, "验证码错误");
            return;
        }

        MojoCube.Web.Comment.List list = new MojoCube.Web.Comment.List();
        list.Title        = txtTitle.Text.Trim();
        list.Subtitle     = string.Empty;
        list.Description  = CreateTemplate();
        list.Feedback     = string.Empty;
        list.Visual       = string.Empty;
        list.Author       = txtName.Text.Trim();
        list.Email        = txtEmail.Text.Trim();
        list.Phone        = txtPhone.Text.Trim();
        list.Address      = string.Empty;
        list.Website      = string.Empty;
        list.IPAddress    = MojoCube.Web.IP.Get();
        list.Browser      = MojoCube.Web.String.GetBrowserInfo();
        list.Issue        = true;
        list.IsComment    = false;
        list.IsRecommend  = false;
        list.IsRead       = false;
        list.ReadDate     = DateTime.Now.ToString();
        list.Clicks       = 0;
        list.fk_ID        = 0;
        list.SortID       = 0;
        list.TypeID       = 0;
        list.StatusID     = 0;
        list.Score        = 0;
        list.ScoreIn      = 0;
        list.CreateDate   = DateTime.Now.ToString();
        list.CreateUserID = 0;
        list.ModifyDate   = DateTime.Now.ToString();
        list.ModifyUserID = 0;
        list.Language     = MojoCube.Api.UI.Language.GetLanguage();
        list.InsertData();

        MojoCube.Api.UI.Script.ScriptMessage(this, "您的留言已提交,我们会尽快阅读!");
        btnSubmit.Enabled = false;
    }
コード例 #3
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        MojoCube.Web.Order.List order = new MojoCube.Web.Order.List();
        order.GetData(int.Parse(ViewState["pk_Order"].ToString()));

        order.IsComment = true;
        order.UpdateData(order.pk_Order);

        if (GridView1.Rows.Count > 0)
        {
            MojoCube.Web.Member.List member = new MojoCube.Web.Member.List();
            member.GetData(int.Parse(Session["Member_UserID"].ToString()));

            MojoCube.Web.Comment.List list = new MojoCube.Web.Comment.List();

            for (int i = 0; i < GridView1.Rows.Count; i++)
            {
                if (((TextBox)GridView1.Rows[i].FindControl("txtComment")).Text.Trim() != "")
                {
                    list.Title        = ((Label)GridView1.Rows[i].FindControl("lblTitle")).Text;
                    list.Subtitle     = string.Empty;
                    list.Description  = ((TextBox)GridView1.Rows[i].FindControl("txtComment")).Text.Trim();
                    list.Feedback     = string.Empty;
                    list.Visual       = string.Empty;
                    list.Author       = member.LastName + member.FirstName;
                    list.Email        = member.Email;
                    list.Phone        = member.Phone1;
                    list.Address      = member.Address;
                    list.Website      = string.Empty;
                    list.IPAddress    = MojoCube.Web.IP.Get();
                    list.Browser      = MojoCube.Web.String.GetBrowserInfo();
                    list.Issue        = true;
                    list.IsComment    = false;
                    list.IsRecommend  = false;
                    list.IsRead       = false;
                    list.ReadDate     = DateTime.Now.ToString();
                    list.Clicks       = 0;
                    list.fk_ID        = int.Parse(((Label)GridView1.Rows[i].FindControl("lblfkID")).Text);
                    list.SortID       = 0;
                    list.TypeID       = 1;
                    list.StatusID     = 0;
                    list.Score        = int.Parse(((DropDownList)GridView1.Rows[i].FindControl("ddlScore")).SelectedValue);
                    list.ScoreIn      = list.Score;
                    list.CreateDate   = DateTime.Now.ToString();
                    list.CreateUserID = member.pk_Member;
                    list.ModifyDate   = DateTime.Now.ToString();
                    list.ModifyUserID = 0;
                    list.Language     = MojoCube.Api.UI.Language.GetLanguage();
                    list.InsertData();
                }
            }
        }

        Response.Redirect(MojoCube.Web.Site.Cache.GetUrlExtension("OrderDetail", MojoCube.Api.UI.Language.GetLanguage()) + "?id=" + MojoCube.Api.Text.Security.EncryptString(ViewState["pk_Order"].ToString()));
    }
コード例 #4
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        MojoCube.Web.Comment.List list = new MojoCube.Web.Comment.List();
        int index = 0;

        //删除
        if (e.CommandName == "_delete")
        {
            index = Convert.ToInt32(e.CommandArgument);
            list.DeleteData(int.Parse(((Label)GridView1.Rows[index].FindControl("lblID")).Text));
        }
        GridBind();
    }
コード例 #5
0
ファイル: Edit.aspx.cs プロジェクト: crestviewshanghai/Tony
    protected void btnSave_Click(object sender, EventArgs e)
    {
        MojoCube.Web.Comment.List list = new MojoCube.Web.Comment.List();

        //修改
        if (ViewState["pk_Comment"] != null)
        {
            list.GetData(int.Parse(ViewState["pk_Comment"].ToString()));
            list.Feedback     = txtDescription.Text.Trim();
            list.StatusID     = int.Parse(ddlStatus.SelectedValue);
            list.ModifyDate   = DateTime.Now.ToString();
            list.ModifyUserID = int.Parse(Session["UserID"].ToString());
            list.UpdateData(list.pk_Comment);
        }

        AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("success", "数据保存成功");
    }