protected void Page_Load(object sender, EventArgs e)
 {
     if (!int.TryParse(Request.Params["Id"] as string, out Id))
     {
         Server.Transfer("error.aspx");
         return;
     }
     if (!IsPostBack)
     {
         ArrayList al = new ArrayList();
         for (int i = 1; i <= 100; i++)
         {
             al.Add(i.ToString());
         }
         DropDownList1.DataSource = al;
         DropDownList1.DataBind();
         DropDownList2.DataSource = al;
         DropDownList2.DataBind();
         DropDownList3.DataSource = al;
         DropDownList3.DataBind();
         DropDownList4.DataSource = al;
         DropDownList4.DataBind();
     }
     DtCms.BLL.Societies bll = new DtCms.BLL.Societies();
     model = bll.GetModel(Id);
 }
Ejemplo n.º 2
0
 //赋值操作
 private void ShowInfo(int editID)
 {
     DtCms.BLL.Societies   bll   = new DtCms.BLL.Societies();
     DtCms.Model.Societies model = new DtCms.Model.Societies();
     model = bll.GetModel(editID);
     txtSocietiesName.Text = model.SocietiesName;
     txtContent.Value      = model.SocietiesRemark;
 }
Ejemplo n.º 3
0
        //保存
        protected void btnSave_Click(object sender, EventArgs e)
        {
            DtCms.Model.Societies model = new DtCms.Model.Societies();
            DtCms.BLL.Societies   bll   = new DtCms.BLL.Societies();
            string SocietiesName        = txtSocietiesName.Text.Trim();
            string SocietiesRemark      = txtContent.Value.Trim();

            model.SocietiesName   = SocietiesName;
            model.SocietiesRemark = SocietiesRemark;

            bll.Add(model);
            JscriptPrint("添加社团成功啦!", "list.aspx", "Success");
        }
Ejemplo n.º 4
0
 protected void lbtnDel_Click(object sender, EventArgs e)
 {
     DtCms.BLL.Societies bll = new DtCms.BLL.Societies();
     //批量删除
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int      id = Convert.ToInt32(((Label)rptList.Items[i].FindControl("lb_id")).Text);
         CheckBox cb = (CheckBox)rptList.Items[i].FindControl("cb_id");
         if (cb.Checked)
         {
             //删除记录
             bll.Delete(id);
         }
     }
     JscriptPrint("批量删除成功啦!", "List.aspx?" + CombUrlTxt(this.keywords, this.property) + "page=0", "Success");
 }
Ejemplo n.º 5
0
 private void RptBind(string strWhere)
 {
     DtCms.BLL.Societies bll = new DtCms.BLL.Societies();
     //获得总条数
     this.pcount = bll.GetCount(strWhere);
     if (this.pcount > 0)
     {
         this.lbtnDel.Enabled = true;
     }
     else
     {
         this.lbtnDel.Enabled = false;
     }
     this.rptList.DataSource = bll.GetPageList(this.pagesize, this.page, strWhere, "AddTime desc");
     this.rptList.DataBind();
 }
Ejemplo n.º 6
0
        protected void Societies_List_DataBind(object sender, EventArgs e)
        {
            Repeater _rpt = sender as Repeater;

            if (_rpt == null)
            {
                return;
            }
            DtCms.BLL.Societies bll = new DtCms.BLL.Societies();
            //绑定数据
            if (_rpt.PageSize > 0)
            {
                _rpt.DataSource = bll.GetPageList(_rpt.PageSize, _rpt.PageIndex, _rpt.Where, "AddTime desc");
            }
            else
            {
                _rpt.DataSource = bll.GetList(_rpt.Top, _rpt.Where, "AddTime desc");
            }
            _rpt.DataBind();
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            int Quality    = Convert.ToInt32(DropDownList1.SelectedValue);
            int Number     = Convert.ToInt32(DropDownList2.SelectedValue);
            int Atmosphere = Convert.ToInt32(DropDownList3.SelectedValue);
            int Activities = Convert.ToInt32(DropDownList4.SelectedValue);

            DtCms.BLL.Societies   societies      = new DtCms.BLL.Societies();
            DtCms.Model.Societies Societiesmodel = new DtCms.Model.Societies();
            Societiesmodel = societies.GetModel(Id);
            DtCms.Model.Score score = new DtCms.Model.Score();
            score.Quality       = Quality;
            score.Number        = Number;
            score.Atmosphere    = Atmosphere;
            score.SocietiesName = Societiesmodel.SocietiesName;
            score.Activities    = Activities;

            DtCms.BLL.Score bll = new DtCms.BLL.Score();
            bll.Add(score);
            Response.Write("<script>alert('艺术团活动评分成功啦!');</script>");
        }