예제 #1
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 index = ((GridViewRow)(img.Parent.Parent)).RowIndex;

            gvColumns.EditIndex = index;
            BindData(null, null);
            //绑定树
            DropDownTree tree = (DropDownTree)gvColumns.Rows[index].FindControl("ddlColTree");

            Song.Entities.GuideColumns[] cous = Business.Do <IGuide>().GetColumnsAll(couid, null);
            tree.DataSource     = cous;
            tree.DataTextField  = "Gc_title";
            tree.DataValueField = "Gc_ID";
            tree.Root           = 0;
            tree.DataBind();
            tree.Items.Insert(0, new ListItem("   -- 顶级 --", "0"));
            //当前父级
            int      pid = Convert.ToInt32(img.CommandArgument);
            ListItem li  = tree.Items.FindByValue(pid.ToString());

            if (li != null)
            {
                li.Selected = true;
            }
        }
예제 #2
0
        /// <summary>
        /// 进入编辑
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnEdit_Click(object sender, ImageClickEventArgs e)
        {
            plEditArea.Visible = true;
            plListArea.Visible = false;
            //
            WeiSha.WebControl.RowEdit img = (WeiSha.WebControl.RowEdit)sender;
            int index = ((GridViewRow)(img.Parent.Parent)).RowIndex;
            int id    = int.Parse(this.GridView1.DataKeys[index].Value.ToString());

            //上级
            ddlTree.Items.Clear();
            Song.Entities.KnowledgeSort[] cous = Business.Do <IKnowledge>().GetSortAll(org.Org_ID, couid, null);
            ddlTree.DataSource          = cous;
            this.ddlTree.DataTextField  = "Kns_Name";
            this.ddlTree.DataValueField = "Kns_ID";
            this.ddlTree.Root           = 0;
            this.ddlTree.DataBind();
            ddlTree.Items.Insert(0, new ListItem("   -- 顶级 --", "0"));
            //
            Song.Entities.Knowledge kn = Business.Do <IKnowledge>().KnowledgeSingle(id);
            lbID.Text      = kn.Kn_ID.ToString();
            tbTitle.Text   = kn.Kn_Title;
            tbDetails.Text = kn.Kn_Details;
            ListItem li = ddlTree.Items.FindByValue(kn.Kns_ID.ToString());

            if (li != null)
            {
                li.Selected = true;
            }
        }
예제 #3
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;
        }
        /// <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 index = ((GridViewRow)(img.Parent.Parent)).RowIndex;

            gvProfit.EditIndex  = index;
            plAddProfit.Enabled = false;    //禁用新增
            BindGridviewData();
        }
예제 #5
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 index = ((GridViewRow)(img.Parent.Parent)).RowIndex;

            gvPrice.EditIndex = index;
            BindPriceData();
            //当前单位
            DropDownList ddlUnit = (DropDownList)gvPrice.Rows[index].FindControl("ddlUnit");
            string       unit    = img.CommandArgument;
            ListItem     li      = ddlUnit.Items.FindByText(unit);

            if (li != null)
            {
                ddlUnit.SelectedIndex = -1;
                li.Selected           = true;
            }
        }
예제 #6
0
        /// <summary>
        /// 进入编辑
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnEdit_Click(object sender, ImageClickEventArgs e)
        {
            plEditArea.Visible = true;
            plListArea.Visible = false;
            //
            WeiSha.WebControl.RowEdit img = (WeiSha.WebControl.RowEdit)sender;
            int index = ((GridViewRow)(img.Parent.Parent)).RowIndex;
            int id    = int.Parse(this.GridView1.DataKeys[index].Value.ToString());

            //上级
            ddlTree.Items.Clear();
            Song.Entities.GuideColumns[] cous = Business.Do <IGuide>().GetColumnsAll(couid, null);
            ddlTree.DataSource          = cous;
            this.ddlTree.DataTextField  = "Gc_title";
            this.ddlTree.DataValueField = "Gc_ID";
            this.ddlTree.Root           = 0;
            this.ddlTree.DataBind();
            ddlTree.Items.Insert(0, new ListItem("   -- 顶级 --", "0"));
            //
            Song.Entities.Guide guide = Business.Do <IGuide>().GuideSingle(id);
            lbID.Text       = guide.Gu_Id.ToString();
            tbTitle.Text    = guide.Gu_Title;
            cbIsHot.Checked = guide.Gu_IsHot;
            //是否显示
            cbIsShow.Checked = guide.Gu_IsShow;
            //是否置顶
            cbIsTop.Checked = guide.Gu_IsTop;
            //是否推荐
            cbIsRec.Checked = guide.Gu_IsRec;
            tbDetails.Text  = guide.Gu_Details;
            ListItem li = ddlTree.Items.FindByValue(guide.Gc_ID.ToString());

            if (li != null)
            {
                li.Selected = true;
            }
        }