Exemplo n.º 1
0
        /// <summary>
        /// 编辑当前数据项
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnEditEnter_Click(object sender, EventArgs e)
        {
            int typeid = 0;

            int.TryParse(lbTypeID.Text, out typeid);
            Song.Entities.QuesTypes qt = Business.Do <IQuestions>().TypeSingle(typeid);
            if (qt == null)
            {
                return;
            }
            qt.Cou_ID = id;
            qt.Org_ID = org.Org_ID;
            //名称
            qt.Qt_Name = tbName.Text.Trim();
            //基础类型
            int type;

            int.TryParse(ddlBaseType.SelectedValue, out type);
            qt.Qt_Type     = type;
            qt.Qt_TypeName = ddlBaseType.SelectedItem.Text;
            //简介
            qt.Qt_Intro = this.tbIntro.Text.Trim();
            qt.Qt_IsUse = cbIsUse.Checked;
            Business.Do <IQuestions>().TypeSave(qt);
            //
            BindPriceData();
        }
Exemplo n.º 2
0
        /// <summary>
        /// 进入编辑
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnEdit_Click(object sender, ImageClickEventArgs e)
        {
            WeiSha.WebControl.RowEdit img = (WeiSha.WebControl.RowEdit)sender;
            int typeid = 0;

            int.TryParse(img.CommandArgument, out typeid);
            Song.Entities.QuesTypes qt = Business.Do <IQuestions>().TypeSingle(typeid);
            if (qt == null)
            {
                return;
            }
            //名称
            tbName.Text = qt.Qt_Name;
            //基础类型
            ListItem liType = ddlBaseType.Items.FindByValue(qt.Qt_Type.ToString());

            if (liType != null)
            {
                ddlBaseType.SelectedIndex = -1;
                liType.Selected           = true;
            }
            //简介
            tbIntro.Text    = qt.Qt_Intro;
            cbIsUse.Checked = qt.Qt_IsUse;
            lbTypeID.Text   = qt.Qt_ID.ToString();
            //改一些标识
            lbTypeTitle.Text    = "编辑";
            btnAddEnter.Visible = false;
            plEditBox.Visible   = true;
        }
Exemplo n.º 3
0
        /// 修改是否使用的状态
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void sbUse_Click(object sender, EventArgs e)
        {
            StateButton ub    = (StateButton)sender;
            int         index = ((GridViewRow)(ub.Parent.Parent)).RowIndex;
            int         id    = int.Parse(this.gvPrice.DataKeys[index].Value.ToString());

            //
            Song.Entities.QuesTypes entity = Business.Do <IQuestions>().TypeSingle(id);
            entity.Qt_IsUse = !entity.Qt_IsUse;
            Business.Do <IQuestions>().TypeSave(entity);
            BindPriceData();
        }