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

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

                if (_Id == 0)
                {
                    mydb.L_Form.AddObject(Lt);
                    mydb.SaveChanges();
                    JscriptPrint("表单发布成功啦!", "list.aspx", "Success");
                }
                else
                {
                    mydb.SaveChanges();
                    JscriptPrint("表单修改成功啦!", "list.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_Form Lt = new L_Form();
            if (_Id != 0)
            {
                Lt = mydb.L_Form.First(p => p.FID == _Id);
            }

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


            if (_Id == 0)
            {
                mydb.L_Form.AddObject(Lt);
                mydb.SaveChanges();
                JscriptPrint("表单发布成功啦!", "list.aspx", "Success");
            }
            else
            {
                mydb.SaveChanges();
                JscriptPrint("表单修改成功啦!", "list.aspx", "Success");
            }
        }


        // bll.Add(model);
        //保存日志
        //SaveLogs("[资讯模块]添加文章:" + model.Title);
        //JscriptPrint("文章发布成功啦!", "Add.aspx?classId=" + ddlClassId.SelectedValue, "Success");
    }
Example #3
0
    private void ShowInfo(int _id)
    {
        Entities mydb = new Entities();
        {
            L_Form _lt = mydb.L_Form.First(p => p.FID == _id);
            txtName.Text = _lt.FNmae;
            txtTag.Text  = _lt.Fother;
            TextC.Text   = _lt.F1;

            //txtTag2.Text = _lx.CTag2;
            //txtTag3.Text = _lx.CTag3;
        }
    }
Example #4
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_Form   model = bll.L_Form.First(p => p.FID == 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 #5
0
 /// <summary>
 /// 创建新的 L_Form 对象。
 /// </summary>
 /// <param name="fID">FID 属性的初始值。</param>
 public static L_Form CreateL_Form(global::System.Int64 fID)
 {
     L_Form l_Form = new L_Form();
     l_Form.FID = fID;
     return l_Form;
 }
Example #6
0
 /// <summary>
 /// 用于向 L_Form EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet&lt;T&gt; 属性的 .Add 方法。
 /// </summary>
 public void AddToL_Form(L_Form l_Form)
 {
     base.AddObject("L_Form", l_Form);
 }