Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //zlg 如果有模块,则先配置
        valObj.setConn(conn).setModule(ModuleName);

        #region//默认隐藏的列
        //hideTableColumnList = new List<AttributeItem>();
        //hideTableColumnList.Add(WEC_A_VOTE.Attribute.EXP1);
        //hideTableColumnList.Add(WEC_A_VOTE.Attribute.EXP2);
        //hideTableColumnList.Add(WEC_A_VOTE.Attribute.EXP3);
        //valObj.LoadAllAttributes(true);//暂时加此代码,以后框架更新将不需要
        //valObj.Remove(hideTableColumnList);

        //hideFindColumnList = new List<AttributeItem>();
        //hideFindColumnList.Add(WEC_A_VOTE.Attribute.EXP1);
        //hideFindColumnList.Add(WEC_A_VOTE.Attribute.EXP2);
        //hideFindColumnList.Add(WEC_A_VOTE.Attribute.EXP3);
        #endregion
        condObj.OrderBy(WEC_A_VOTE.Attribute.ID, Order.Desc);

        if (!IsPostBack)
        {
            btnFind.Text              = LanguageService.GetLanguageString("btnFind", "查询");
            aspPager.PageSize         = 10;
            aspPager.CurrentPageIndex = 1;

            if (!string.IsNullOrEmpty(Request["ids"]))
            {
                WEC_A_VOTE roleOld = new WEC_A_VOTE();
                roleOld.Where(WEC_A_VOTE.Attribute.ID, Request["ids"].ToString());
                listObj = BLLTable <WEC_A_VOTE> .Factory(conn).Select(valObj, roleOld);

                for (int i = 0; i < listObj.Count; i++)
                {
                    if (i > 0)
                    {
                        hidOld.Value     += ",";
                        hidInitIDS.Value += ",";
                    }
                    hidOld.Value     += "{ID:'" + listObj[i].ID + "',Name:'" + listObj[i].ID + "'}";//这里的Name用于显示在列表中,请自行重定义。
                    hidInitIDS.Value += listObj[i].ID;
                }
            }
            try
            {
                listObj = BLLTable <WEC_A_VOTE> .Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount);

                repList.DataSource = listObj;
                repList.DataBind();
                aspPager.RecordCount = recount;
            }
            catch (Exception ex)
            {
                litWarn.Text = ex.Message;
            }
        }
    }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //zlg 如果有模块,则先配置
        valObj.setConn(conn).setModule(ModuleName);

        #region//默认隐藏的列
        //hideTableColumnList = new List<AttributeItem>();
        //hideTableColumnList.Add(WEC_A_VOTE.Attribute.EXP1);
        //hideTableColumnList.Add(WEC_A_VOTE.Attribute.EXP2);
        //hideTableColumnList.Add(WEC_A_VOTE.Attribute.EXP3);
        //valObj.LoadAllAttributes(true);//暂时加此代码,以后框架更新将不需要
        //valObj.Remove(hideTableColumnList);

        //hideFindColumnList = new List<AttributeItem>();
        //hideFindColumnList.Add(WEC_A_VOTE.Attribute.EXP1);
        //hideFindColumnList.Add(WEC_A_VOTE.Attribute.EXP2);
        //hideFindColumnList.Add(WEC_A_VOTE.Attribute.EXP3);
        #endregion
        title      = valObj._ZhName + "管理";
        Page.Title = title;
        if (Request["PID"] != null)
        {
            pid = Request["PID"];
        }
        if (!IsPostBack)
        {
            #region//默认属性初始化
            aspPager.CurrentPageIndex = 1;
            //aspPager.ShowInputBox = AgileFrame.Core.WebSystem.WebCtrls.ShowInputBox.Auto;
            txtPageSize.Value = "30";
            aspPager.PageSize = 30;
            //if (pid == "" || pid == "0")
            //{
            //    a_top.Visible = false;
            //}
            #endregion
            #region//数据初始化

            txtSTATUS.Items.AddRange(FormHelper.GetListItem(WEC_A_VOTE.Attribute.STATUS));
            txtPIC_SHOW.Items.AddRange(FormHelper.GetListItem(WEC_A_VOTE.Attribute.PIC_SHOW));
            txtIS_RADIO.Items.AddRange(FormHelper.GetListItem(WEC_A_VOTE.Attribute.IS_RADIO));
            txtSHARE.Items.AddRange(FormHelper.GetListItem(WEC_A_VOTE.Attribute.SHARE));
            txtKIND.Items.AddRange(FormHelper.GetListItem(WEC_A_VOTE.Attribute.KIND));
            #endregion

            BindList(condObj, 1);
        }
    }
Example #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //zlg 如果有模块,则先配置
        valObj.setConn(conn).setModule(ModuleName);

        #region//默认隐藏的列
        //hideTableColumnList = new List<AttributeItem>();
        //hideTableColumnList.Add(WEC_A_VOTE.Attribute.EXP1);
        //hideTableColumnList.Add(WEC_A_VOTE.Attribute.EXP2);
        //hideTableColumnList.Add(WEC_A_VOTE.Attribute.EXP3);
        //valObj.LoadAllAttributes(true);//暂时加此代码,以后框架更新将不需要
        //valObj.Remove(hideTableColumnList);

        //hideFindColumnList = new List<AttributeItem>();
        //hideFindColumnList.Add(WEC_A_VOTE.Attribute.EXP1);
        //hideFindColumnList.Add(WEC_A_VOTE.Attribute.EXP2);
        //hideFindColumnList.Add(WEC_A_VOTE.Attribute.EXP3);
        #endregion
        //多级数据表页面才用到
        if (Request["PID"] != null)
        {
            pid = Request["PID"];
        }
        title      = valObj._ZhName + "选择";
        Page.Title = title;
        if (!IsPostBack)
        {
            aspPager.CurrentPageIndex = 1;
            aspPager.PageSize         = 20;
            try
            {
                listObj = BLLTable <WEC_A_VOTE> .Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount);

                repCus.DataSource = listObj;
                repCus.DataBind();
            }
            catch (Exception ex)
            {
                litWarn.Text = ex.Message;
            }
            aspPager.RecordCount = recount;
        }
    }
Example #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //zlg 如果有模块,则先配置
        valObj.setConn(conn).setModule(ModuleName);

        title      = valObj._ZhName + "详细";
        Page.Title = title;
        if (!IsPostBack)
        {
            try
            {
                if (!string.IsNullOrEmpty(Request["ID"]))
                {
                    valObj = BLLTable <WEC_A_VOTE> .Factory(conn).GetRowData(WEC_A_VOTE.Attribute.ID, Request["ID"]);

                    if (valObj == null)
                    {
                        return;
                    }


                    txtID.Text = Convert.ToString(valObj.ID);//Convert.ToDecimal


                    txtAID.Text = Convert.ToString(valObj.AID);//Convert.ToDecimal


                    txtSTATUS.Text = valObj.STATUS.ToString();


                    txtADDTIME.Text = Convert.ToString(valObj.ADDTIME);//Convert.ToDateTime


                    txtKEYWORD.Text = Convert.ToString(valObj.KEYWORD);//Convert.ToString


                    txtTITLE.Text = Convert.ToString(valObj.TITLE);//Convert.ToString


                    txtPICURL.Text = Convert.ToString(valObj.PICURL);//Convert.ToString


                    txtINSTRUCTION.Text = Convert.ToString(valObj.INSTRUCTION);//Convert.ToString


                    txtPIC_SHOW.Text = valObj.PIC_SHOW.ToString();


                    txtIS_RADIO.Text = valObj.IS_RADIO.ToString();


                    txtSELECT_NUM.Text = Convert.ToString(valObj.SELECT_NUM);//Convert.ToInt32


                    txtTIME.Text = Convert.ToString(valObj.TIME);//Convert.ToString


                    txtRESULT.Text = Convert.ToString(valObj.RESULT);//Convert.ToInt32


                    txtSHARE.Text = valObj.SHARE.ToString();


                    txtKIND.Text = valObj.KIND.ToString();
                }
            }
            catch (Exception ex)
            {
                litWarn.Text = ex.Message;
            }

            if (Request["ajax"] != null)
            {
                Response.Clear();
                Response.Buffer          = true;
                Response.Charset         = "utf-8";
                Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");//设置输出流为简体中文
                //Response.ContentType = "html/text";

                this.EnableViewState = false;
                System.Globalization.CultureInfo myCItrad        = new System.Globalization.CultureInfo("ZH-CN", true);
                System.IO.StringWriter           oStringWriter   = new System.IO.StringWriter(myCItrad);
                System.Web.UI.HtmlTextWriter     oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);
                divC.RenderControl(oHtmlTextWriter);

                Response.Write(oStringWriter.ToString());
                Response.End();
            }
        }
    }
Example #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //zlg 如果有模块,则先配置
        valObj.setConn(conn).setModule(ModuleName);

        title      = valObj._ZhName + "编辑";
        Page.Title = title;
        if (!string.IsNullOrEmpty(Request["ID"]))
        {
            keyid = Request["ID"];
        }

        if (!string.IsNullOrEmpty(Request["KeyID"]))
        {
            keyid = Request["KeyID"];
        }
        if (!string.IsNullOrEmpty(Request["record"]))
        {
            keyid = Request["record"];
        }
        if (!IsPostBack)
        {
            txtSTATUS.Items.AddRange(FormHelper.GetListItem(WEC_A_VOTE.Attribute.STATUS));
            txtPIC_SHOW.Items.AddRange(FormHelper.GetListItem(WEC_A_VOTE.Attribute.PIC_SHOW));
            txtIS_RADIO.Items.AddRange(FormHelper.GetListItem(WEC_A_VOTE.Attribute.IS_RADIO));
            txtSHARE.Items.AddRange(FormHelper.GetListItem(WEC_A_VOTE.Attribute.SHARE));
            txtKIND.Items.AddRange(FormHelper.GetListItem(WEC_A_VOTE.Attribute.KIND));

            this.txtID.Disabled            = true; this.txtID.Value = "0";
            this.txtID.Attributes["class"] = "hide";
            try
            {
                if (keyid != "")
                {
                    valObj = BLLTable <WEC_A_VOTE> .Factory(conn).GetRowData(WEC_A_VOTE.Attribute.ID, keyid);

                    if (valObj == null)
                    {
                        return;
                    }


                    txtID.Value = Convert.ToString(valObj.ID);   //Convert.ToDecimal

                    txtAID.Value = Convert.ToString(valObj.AID); //Convert.ToDecimal

                    txtSTATUS.Value = valObj.STATUS.ToString();

                    txtADDTIME.Value = Convert.ToString(valObj.ADDTIME); //Convert.ToDateTime

                    txtKEYWORD.Value = Convert.ToString(valObj.KEYWORD); //Convert.ToString

                    txtTITLE.Value = Convert.ToString(valObj.TITLE);     //Convert.ToString

                    txtPICURL.Src = valObj.PICURL;

                    txtINSTRUCTION.Value = Convert.ToString(valObj.INSTRUCTION);//Convert.ToString

                    txtPIC_SHOW.Value = valObj.PIC_SHOW.ToString();

                    txtIS_RADIO.Value = valObj.IS_RADIO.ToString();

                    txtSELECT_NUM.Value = Convert.ToString(valObj.SELECT_NUM); //Convert.ToInt32

                    txtTIME.Value = Convert.ToString(valObj.TIME);             //Convert.ToString

                    txtRESULT.Value = Convert.ToString(valObj.RESULT);         //Convert.ToInt32

                    txtSHARE.Value = valObj.SHARE.ToString();

                    txtKIND.Value = valObj.KIND.ToString();
                }
            }
            catch (Exception ex)
            {
                litWarn.Text = ex.Message;
            }
        }
    }