Ejemplo n.º 1
0
        //编辑状态加载数据
        private void LoadInfo()
        {
            string type = RequestHelper.GetRequestString("id", "");

            txttype           = type;
            this.Panel7.Title = "新增";
            if (!string.IsNullOrEmpty(type))
            {
                this.Panel7.Title = "修改";
                DataTable dt = operate.GetRecommendByTypeName(type);
                if (dt != null && dt.Rows.Count > 0)
                {
                    this.txtTypeName.Readonly = true;
                    this.txtTypeName.Text     = HttpUtility.HtmlDecode(dt.Rows[0]["TypeName"].ToString());
                    this.chkFlag.Checked      = Convert.ToBoolean(dt.Rows[0]["Flag"]);

                    var    id          = HttpUtility.HtmlDecode(dt.Rows[0]["PersonID"].ToString()).Split(',');
                    var    name        = HttpUtility.HtmlDecode(dt.Rows[0]["PersonName"].ToString()).Split(',');
                    string newhides    = "[";
                    string newhidename = "[";
                    for (int i = 0; i < id.Length; i++)
                    {
                        newhides    += "\"" + id[i].ToString() + "\",";
                        newhidename += "\"" + name[i].ToString() + "\",";
                    }
                    newhides      = newhides.Substring(0, newhides.Length - 1);
                    newhidename   = newhidename.Substring(0, newhidename.Length - 1);
                    newhides     += "]";
                    newhidename  += "]";
                    hides.Text    = newhides;
                    hidename.Text = newhidename;
                    FineUIGridCommon.UpdateSelectedRowIndexArray(hides, Grid1);
                    FineUIGridCommon.SyncSelectedRowIndexArrayToHiddenField(hides, hidename, Grid1);
                    //BindData();
                    LoadGridChoose();
                }
                else
                {
                    Alert.ShowInParent("读取数据失败!", String.Empty, ActiveWindow.GetHideReference());
                }
            }
        }