Exemplo n.º 1
0
 private void InitData()
 {
     JBind.BindList(drpType, bll.GetList(0, "N_SubId,C_SubTitle", "Parentid=0 and N_SysId=" + sysid, "").Tables[0], "C_SubTitle", "N_SubId");      //省份
     drpType.Items.Insert(0, new ListItem("一级目录", "0"));
     JBind.BindList(drpUnit, new MW.BLL.B_Voteunit().GetList(0, "N_SubId,C_SubTitle", "N_SysId=" + sysid, "").Tables[0], "C_SubTitle", "N_SubId"); //省份
     //drpUnit.Items.Insert(0, new ListItem("请选择", "0"));
     hidsysid.Value = sysid.ToString();
     if (Id > 0)
     {//edit
         model = bll.GetModel(Id);
         if (model != null)
         {
             txtC_SubTitle.Text    = model.C_SubTitle;
             txtN_OrderId.Text     = model.N_OrderId.ToString();
             drpNeed.SelectedValue = model.N_Need.ToString();
             drpType.SelectedValue = model.Parentid.ToString();
             drpUnit.SelectedValue = model.N_Type.ToString();
             if (BaseVote.ShowSysEdit(sysid))
             {
                 drpUnit.Enabled = false;
             }
         }
     }
     else
     {
         drpType.SelectedValue = parentid.ToString();
     }
 }
Exemplo n.º 2
0
 protected void rpt_List_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         DataRowView drv = (DataRowView)e.Item.DataItem;
         if (BaseVote.ShowSysEdit(sysid))
         {
             ((LinkButton)e.Item.FindControl("lbtnDelete")).Visible = false;
         }
     }
 }
Exemplo n.º 3
0
 protected void rpt_List_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         DataRowView drv      = (DataRowView)e.Item.DataItem;
         int         parentid = Utils.StrToInt(drv["parentid"], 0);
         if (!BaseVote.ShowSysEdit(sysid) && parentid == 0)
         {
             ((Literal)e.Item.FindControl("lit")).Text = "<a href=\"biceitemdetail.aspx?sysid=" + sysid + "&parentid=" + drv["n_subid"] + "\">添加子项</a>";
         }
         if (BaseVote.ShowSysEdit(sysid))
         {
             ((LinkButton)e.Item.FindControl("lbtnDelete")).Visible = false;
         }
     }
 }
Exemplo n.º 4
0
        private void InitData()
        {
            hidsubid.Value = subid.ToString();
            hidtype.Value  = ntype.ToString();
            if (Id > 0)
            {//edit
                model = bll.GetModel(Id);
                if (model != null)
                {
                    txtC_KeyTitle.Text        = model.C_KeyTitle;
                    drpType.SelectedValue     = model.N_Type.ToString();
                    txtN_OrderId.Text         = model.N_OrderId.ToString();
                    DDLRule.SelectedItem.Text = model.C_Rule.Split('`')[0];
                    txtN_Score.Text           = model.N_Score.ToString();

                    if (BaseVote.ShowSysEdit(sysid))
                    {
                        txtC_KeyTitle.Enabled = false;
                        drpType.Enabled       = false;
                        txtN_Score.Enabled    = false;
                    }
                }
            }
        }