Example #1
0
    //保存
    protected void btnSave_Click(object sender, EventArgs e)
    {
        Entities mydb = new Entities();
        {
            L_RForm Lt = new L_RForm();
            Lt = mydb.L_RForm.First(p => p.FrID == _Id);

            //Lt.FNmae = txtName.Text.Trim();
            //Lt.Fother = this.txtTag.Text;
            //Lt.F1 = this.TextC.Text.Trim();

            if (this.CheckBox1.Checked)
            {
                Lt.FrReOk = 0;
            }
            Lt.FrRepaly = this.txtRe.Text.Trim();

            Lt.FrReTime = DateTime.Now;

            mydb.SaveChanges();
            JscriptPrint("回复成功啦!", "Rlist.aspx", "Success");
        }



        // bll.Add(model);
        //保存日志
        //SaveLogs("[资讯模块]添加文章:" + model.Title);
        //JscriptPrint("文章发布成功啦!", "Add.aspx?classId=" + ddlClassId.SelectedValue, "Success");
    }
Example #2
0
    //保存
    protected void btnSave_Click(object sender, EventArgs e)
    {
        Entities mydb = new Entities();
                  {
                      L_RForm Lt = new L_RForm();
                      Lt = mydb.L_RForm.First(p => p.FrID == _Id);

                   //Lt.FNmae = txtName.Text.Trim();
                   //Lt.Fother = this.txtTag.Text;
                   //Lt.F1 = this.TextC.Text.Trim();

                      if  (this.CheckBox1.Checked)
                      Lt.FrReOk = 0;
                      Lt.FrRepaly = this.txtRe.Text.Trim();

                      Lt.FrReTime = DateTime.Now;

                    mydb.SaveChanges();
                    JscriptPrint("回复成功啦!", "Rlist.aspx", "Success");
                }

            // bll.Add(model);
            //保存日志
            //SaveLogs("[资讯模块]添加文章:" + model.Title);
            //JscriptPrint("文章发布成功啦!", "Add.aspx?classId=" + ddlClassId.SelectedValue, "Success");
    }
Example #3
0
        protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int id = Convert.ToInt32(((Label)e.Item.FindControl("lb_id")).Text);

            Entities bll   = new Entities();
            L_RForm  model = bll.L_RForm.First(p => p.FrID == id);

            switch (e.CommandName.ToLower())
            {
            case "del":
                bll.DeleteObject(model);

                break;
            }

            bll.SaveChanges();
            grdbind();

            //RptBind("Id>0" + CombSqlTxt(this.kindId, this.classId, this.keywords, this.property), "AddTime desc");
        }
Example #4
0
    ///////
    //接收评论
    public ActionResult Feedback(string ID)
    {
        //      u_id = int.Parse(HttpContext.Current.Request.QueryString["id"]);
            int mid = int.Parse(ID);
            Table newtable = new Table();
            using (Entities db = new Entities())
            {
                var fm = db.L_Form.SingleOrDefault(p => p.FID == mid);
                this.title = fm.FNmae;

                string a = fm.F1;
                // ty_1 = a;

                if (a.Length > 0)
                {
                    a = a.Substring(0, a.Length - 1);
                    string[] sArray = a.Split(new char[] { '|' });
                    textnum = sArray.Length;
                }

                //if (!(Page.Request.Form["id"] == null || Page.Request.Form["id"].ToString() == String.Empty))
                //{
                L_RForm fmRe = new L_RForm();
                fmRe.FrReTime = DateTime.Now;
                for (int i = 1; i <= textnum; i++)
                {
                    string TXname = "ln" + i.ToString();
                    fmRe.Fr2 += Request.Form[TXname] + "|";
                }

                fmRe.Fr1 = a;
                fmRe.FID = mid;
                fmRe.FrRepaly = "";
                db.L_RForm.AddObject(fmRe);
                db.SaveChanges();
                ViewData["Message"] = "";
                Utils.ShowMessage2("提交成功!", "/");

            }
            return View("index");
    }
Example #5
0
    ///////


    //接收评论
    public ActionResult Feedback(string ID)
    {
        //      u_id = int.Parse(HttpContext.Current.Request.QueryString["id"]);
        int   mid      = int.Parse(ID);
        Table newtable = new Table();

        using (Entities db = new Entities())
        {
            var fm = db.L_Form.SingleOrDefault(p => p.FID == mid);
            this.title = fm.FNmae;

            string a = fm.F1;
            // ty_1 = a;

            if (a.Length > 0)
            {
                a = a.Substring(0, a.Length - 1);
                string[] sArray = a.Split(new char[] { '|' });
                textnum = sArray.Length;
            }

            //if (!(Page.Request.Form["id"] == null || Page.Request.Form["id"].ToString() == String.Empty))
            //{
            L_RForm fmRe = new L_RForm();
            fmRe.FrReTime = DateTime.Now;
            for (int i = 1; i <= textnum; i++)
            {
                string TXname = "ln" + i.ToString();
                fmRe.Fr2 += Request.Form[TXname] + "|";
            }

            fmRe.Fr1      = a;
            fmRe.FID      = mid;
            fmRe.FrRepaly = "";
            db.L_RForm.AddObject(fmRe);
            db.SaveChanges();
            ViewData["Message"] = "";
            Utils.ShowMessage2("提交成功!", "/");
        }
        return(View("index"));
    }
Example #6
0
 /// <summary>
 /// 用于向 L_RForm EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet&lt;T&gt; 属性的 .Add 方法。
 /// </summary>
 public void AddToL_RForm(L_RForm l_RForm)
 {
     base.AddObject("L_RForm", l_RForm);
 }
Example #7
0
 /// <summary>
 /// 创建新的 L_RForm 对象。
 /// </summary>
 /// <param name="frID">FrID 属性的初始值。</param>
 public static L_RForm CreateL_RForm(global::System.Int64 frID)
 {
     L_RForm l_RForm = new L_RForm();
     l_RForm.FrID = frID;
     return l_RForm;
 }
Example #8
0
    ////////
    //接收表单
    ////////
    private void LoadmyForm()
    {
        //     u_id = int.Parse(HttpContext.Current.Request.QueryString["id"]);
           string ID = HttpContext.Current.Request.QueryString["ID"];
            if (ID == "F")
            {
                using (Entities mydb = new Entities())
                {

                    L_Feedback fdb = new L_Feedback();
                    fdb.FTime = DateTime.Now.ToString();
                    fdb.FName = Request.Form["Fname"];
                    fdb.NID = Convert.ToInt16(Request.Form["NID"]);
                    fdb.FContent = Request.Form["FContent"];
                    fdb.FQQ = Request.Form["FQQ"];
                    fdb.FLock = "0";
                    mydb.L_Feedback.AddObject(fdb);
                    mydb.SaveChanges();
                    Utils.ShowMessage2("提交成功!", "/");

                }

            }

            else
            {
                int mid = int.Parse(ID);
                Table newtable = new Table();
                using (Entities db = new Entities())
                {
                    var fm = db.L_Form.SingleOrDefault(p => p.FID == mid);
                    this.title = fm.FNmae;

                    string a = fm.F1;
                    // ty_1 = a;

                    if (a.Length > 0)
                    {
                        a = a.Substring(0, a.Length - 1);
                        string[] sArray = a.Split(new char[] { '|' });
                        textnum = sArray.Length;
                    }

                    //if (!(Page.Request.Form["id"] == null || Page.Request.Form["id"].ToString() == String.Empty))
                    //{
                    L_RForm fmRe = new L_RForm();
                    fmRe.FrReTime = DateTime.Now;
                    for (int i = 1; i <= textnum; i++)
                    {
                        string TXname = "ln" + i.ToString();
                        fmRe.Fr2 += Request.Form[TXname] + "|";
                    }

                    fmRe.Fr1 = a;
                    fmRe.FID = mid;
                    fmRe.FrRepaly = "";
                    db.L_RForm.AddObject(fmRe);
                    db.SaveChanges();

                    Utils.ShowMessage2("提交成功!", "/");

                }
            }
    }
Example #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.CacheControl = "no-cache";
        if (!string.IsNullOrEmpty(Request.Params["ID"]))
        {
            _Id = int.Parse(HttpContext.Current.Request.QueryString["ID"]);
        }
        if (!Page.IsPostBack)
        {
            Entities mydb = new Entities();
            {
                L_RForm fmRe = mydb.L_RForm.First(p => p.FrID == _Id);
                this.Labtitle.Text = fmRe.FrName;

                if (fmRe.FrReOk == 0)
                {
                    CheckBox1.Checked = true;
                }


                string a  = fmRe.Fr1;
                string av = fmRe.Fr2;

                if (a.Length > 0)
                {
                    a  = a.Substring(0, a.Length - 1);
                    av = av.Substring(0, av.Length - 1);
                    string[] sArray = a.Split(new char[] { '|' });
                    string[] sValue = av.Split(new char[] { '|' });
                    int      myint  = 0;
                    textnum = 1;
                    foreach (string myStr in sArray)
                    {
                        TableRow newrow = new TableRow();
                        //newrow.Attributes.Add("Class", "hback");

                        TableCell newcell1 = new TableCell();
                        TableCell newcell2 = new TableCell();
                        textnum++;

                        Label  Lab  = new Label();
                        string LbId = "Lab" + textnum.ToString();
                        Lab.ID   = LbId;
                        Lab.Text = myStr + ":";


                        Label  TexB = new Label();
                        string TbId = "Label" + textnum.ToString();
                        TexB.ID   = TbId;
                        TexB.Text = sValue[myint];
                        myint++;

                        newcell1.Controls.Add(Lab);
                        newcell2.Controls.Add(TexB);
                        newrow.Cells.Add(newcell1);
                        newrow.Cells.Add(newcell2);
                        Table1.Rows.Add(newrow);
                    }
                }



                //txtName.Text = _lt.FNmae;
                //txtTag.Text = _lt.Fother;
                //TextC.Text = _lt.F1;
                //txtTag2.Text = _lx.CTag2;
                //txtTag3.Text = _lx.CTag3;
            }
        }
    }