Exemple #1
0
        /// <summary>
        /// toolbar事件
        /// 作者:姚东
        /// 时间:20101025
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void toolbar_MenuItemClick(object sender, MenuEventArgs e)
        {
            switch (e.Item.Value)
            {
            case "Delete":
                string cid   = "";
                int    count = 0;
                int    num   = 0;
                for (int i = 0; i < grid.Rows.Count; i++)
                {
                    CheckBox chkItem = (CheckBox)grid.Rows[i].FindControl("chkItem");
                    if (chkItem != null && chkItem.Checked == true)
                    {
                        count++;
                        cid = grid.DataKeys[i]["CID"].ToString();

                        SurveyClassEntity entity = new SurveyClassEntity(NDConvert.ToInt64(cid));

                        new SurveyClassRule().Delete(entity);
                    }
                }
                if (count == this.grid.Rows.Count)
                {
                    viewpage1.CurrentPageIndex = viewpage1.CurrentPageIndex == 1 ? 1 : viewpage1.CurrentPageIndex - 1;
                }
                BindGridView();

                PageHelper.ShowMessage("停用成功!");
                if (num > 0)
                {
                    PageHelper.ShowExceptionMessage("部分(已审核、禁用)信息无法停用!");
                }
                break;
            }
        }
Exemple #2
0
        /// <summary>
        /// 加载数据
        /// 作者:姚东
        /// 时间:20101027
        /// </summary>
        private void LoadData()
        {
            SurveyClassEntity entity = new SurveyClassEntity(this.CID);

            txtCID.Text             = entity.CID.ToString();
            txtSurveyClassName.Text = entity.SurveyClassName;
            txtSort.Text            = entity.Sort.ToString();

            if (entity.DefaultClass == true)
            {
                ddlDefaultClass.SelectedValue = "1";
            }
            else
            {
                ddlDefaultClass.SelectedValue = "0";
            }

            txtCID.Enabled = false;
        }
Exemple #3
0
        /// <summary>
        /// 更新
        /// 作者:姚东
        /// 时间:20101027
        /// </summary>
        private void Update()
        {
            SurveyClassEntity entity = new SurveyClassEntity(this.CID);

            #region 更新内容
            entity.SurveyClassName = txtSurveyClassName.Text;
            entity.Sort            = NDConvert.ToInt32(txtSort.Text);

            if (ddlDefaultClass.SelectedValue == "1")
            {
                entity.DefaultClass = true;
            }
            else
            {
                entity.DefaultClass = false;
            }

            entity.ParentID = -1;

            #endregion

            new SurveyClassRule().Update(entity);
        }
 /// <summary>
 /// 删除业务过程
 /// </summary>
 /// <param name = "entity">实体类</param>
 public void Delete(SurveyClassEntity entity)
 {
     NDEntityCtl.Delete(entity);
 }
 /// <summary>
 /// 修改业务过程
 /// </summary>
 /// <param name = "entity">实体类</param>
 public void Update(SurveyClassEntity entity)
 {
     NDEntityCtl.Update(entity);
 }
 /// <summary>
 /// 新增业务过程
 /// </summary>
 /// <param name = "entity">实体类</param>
 public void Add(SurveyClassEntity entity)
 {
     NDEntityCtl.Insert(entity);
 }