コード例 #1
0
        public static List <ClsBindGridColumn_EO> GetBindGridColumn_EO(string TableName)
        {
            List <ClsBindGridColumn_EO> List_Gc = new List <ClsBindGridColumn_EO>();
            ClsBindGridColumn_EO        Gc;

            DataTable Dt_Def = Do_Methods_Query.GetQuery(@"udf_System_BindDefinition('" + TableName + "')", "", "", "OrderIndex");

            foreach (DataRow Dr in Dt_Def.Rows)
            {
                Gc = new ClsBindGridColumn_EO(
                    (string)Do_Methods.IsNull(Dr["Name"], "")
                    , (string)Do_Methods.IsNull(Dr["Desc"], "")
                    , (Int32)Do_Methods.IsNull(Dr["Width"], 0)
                    , (string)Do_Methods.IsNull(Dr["NumberFormat"], "")
                    , (Layer01_Common.Common.Layer01_Constants.eSystem_Lookup_FieldType)Do_Methods.IsNull(Dr["System_LookupID_FieldType"], Layer01_Common.Common.Layer01_Constants.eSystem_Lookup_FieldType.FieldType_Static)
                    , !(bool)Do_Methods.IsNull(Dr["IsHidden"], false)
                    , !(bool)Do_Methods.IsNull(Dr["IsReadOnly"], false)
                    , (string)Do_Methods.IsNull(Dr["ClientSideBeginEdit"], "")
                    , (string)Do_Methods.IsNull(Dr["ClientSideEndEdit"], "")
                    , (string)Do_Methods.IsNull(Dr["CommandName"], "")
                    );

                Gc.mButtonType = (ButtonColumnType)Do_Methods.IsNull(Dr["System_LookupID_ButtonType"], ButtonColumnType.LinkButton);
                Gc.mFieldText  = (string)Do_Methods.IsNull(Dr["FieldText"], "");

                List_Gc.Add(Gc);
            }

            return(List_Gc);
        }
コード例 #2
0
        List <ClsBindGridColumn_EO> BindGrid(DataTable Dt_List)
        {
            bool IsReadOnly = false;

            if (
                !(this.mCurrentUser.CheckAccess(this.mSystem_ModulesID, Layer01_Common.Common.Layer01_Constants.eAccessLib.eAccessLib_Edit) ||
                  this.mCurrentUser.CheckAccess(this.mSystem_ModulesID, Layer01_Common.Common.Layer01_Constants.eAccessLib.eAccessLib_View))
                )
            {
                IsReadOnly = true;
            }

            bool IsNoSelect = false;

            try { IsNoSelect = (bool)this.ViewState[CnsIsNoSelect]; }
            catch { }

            if (IsNoSelect)
            {
                IsReadOnly = true;
            }

            DataRow Dr_Bind = Do_Methods_Query.GetSystemBindDefinition(this.mSystem_BinDefinition_Name);
            List <ClsBindGridColumn_EO> List_Gc = Layer01_Methods_Web_EO.GetBindGridColumn_EO(this.mSystem_BinDefinition_Name);

            if (!IsReadOnly)
            {
                ClsBindGridColumn_EO Gc = new ClsBindGridColumn_EO("", "", 50, "", Layer01_Common.Common.Layer01_Constants.eSystem_Lookup_FieldType.FieldType_Button);
                Gc.mCommandName = "Select";
                Gc.mFieldText   = ">>";
                Gc.mButtonType  = ButtonColumnType.LinkButton;
                List_Gc.Insert(0, Gc);
            }

            string TableKey = "";

            if (this.mObj_Base != null)
            {
                TableKey = this.mObj_Base.pHeader_TableKey;
            }
            else
            {
                TableKey = (string)this.ViewState[CnsSourceKey];
                if (TableKey == "")
                {
                    TableKey = (string)Do_Methods.IsNull(Dr_Bind["TableKey"], "");
                }
            }

            this.EOGrid_List.ClientSideOnItemCommand = "EOGrid_ItemCommand";
            this.EOGrid_List.FullRowMode             = true;
            Layer01_Methods_Web_EO.BindEOGrid(ref this.EOGrid_List, Dt_List, List_Gc, TableKey, false, false);
            return(List_Gc);
        }
コード例 #3
0
        //[-]

        List <ClsBindGridColumn_EO> BindGrid(
            DataTable Dt_List
            , eCheck Check = eCheck.None)
        {
            DataRow Dr_Bind = Do_Methods_Query.GetSystemBindDefinition(this.mSelectionName);
            List <ClsBindGridColumn_EO> List_Gc = Layer01_Methods_Web_EO.GetBindGridColumn_EO(this.mSelectionName);

            string Bind_TableKey = (string)Do_Methods.IsNull(Dr_Bind["TableKey"], "");

            string TableKey = (string)this.ViewState[CnsQuery_Selection_Key];

            if (TableKey != "")
            {
                Bind_TableKey = TableKey;
            }

            Dt_List.Columns.Add("IsSelect", typeof(bool));
            ClsBindGridColumn_EO Gc =
                new ClsBindGridColumn_EO(
                    "IsSelect"
                    , "Select?"
                    , 80
                    , ""
                    , Layer01_Common.Common.Layer01_Constants.eSystem_Lookup_FieldType.FieldType_Checkbox
                    , this.mIsMultipleSelect);

            List_Gc.Insert(0, Gc);

            if (Check == eCheck.None)
            {
                foreach (DataRow Dr in this.mDt_Selected.Rows)
                {
                    DataRow[] Inner_ArrDr = Dt_List.Select(Bind_TableKey + " = " + Convert.ToInt64(Dr["ID"]).ToString());
                    if (Inner_ArrDr.Length > 0)
                    {
                        Inner_ArrDr[0]["IsSelect"] = Do_Methods.IsNull(Dr["IsSelect"], false);
                    }
                }
            }
            else
            {
                bool Inner_IsSelect = Check == eCheck.CheckAll;
                foreach (DataRow Dr in Dt_List.Rows)
                {
                    Dr["IsSelect"] = Inner_IsSelect;
                }
            }

            this.EOGrid_Selection.FullRowMode = true;
            Layer01_Methods_Web_EO.BindEOGrid(ref this.EOGrid_Selection, Dt_List, List_Gc, Bind_TableKey, false, false);
            return(List_Gc);
        }
コード例 #4
0
        public void Setup(
            string Name
            , DataTable Dt
            , string Key      = ""
            , bool AllowSort  = false
            , bool HasDelete  = false
            , bool IsReadOnly = false)
        {
            ClsSysCurrentUser Obj_CurrentUser = (ClsSysCurrentUser)this.Session[Layer01_Constants_Web.CnsSession_CurrentUser];

            this.mObjID     = Obj_CurrentUser.GetNewPageObjectID();
            this.mDt_Source = Dt;

            this.ViewState[CnsObjID] = this.mObjID;
            this.Session[this.mObjID + CnsDt_Source] = this.mDt_Source;

            //[-]

            DataRow Dr_Bind       = Do_Methods_Query.GetSystemBindDefinition(Name);
            string  Bind_TableKey = (string)Do_Methods.IsNull(Dr_Bind["TableKey"], "");
            List <ClsBindGridColumn_EO> List_Gc = Layer01_Methods_Web_EO.GetBindGridColumn_EO(Name);

            foreach (ClsBindGridColumn_EO Gc in List_Gc)
            {
                if (Gc.mEnabled)
                {
                    Gc.mEnabled = !IsReadOnly;
                }
            }

            if (!IsReadOnly)
            {
                if (HasDelete)
                {
                    ClsBindGridColumn_EO Gc =
                        new ClsBindGridColumn_EO(
                            ""
                            , ""
                            , 80
                            , ""
                            , Layer01_Common.Common.Layer01_Constants.eSystem_Lookup_FieldType.FieldType_Delete);
                    Gc.mFieldText           = "Delete";
                    Gc.mClientSideBeginEdit = "EOGrid_RowEdit";
                    List_Gc.Add(Gc);
                }
            }

            if (Key.Trim() == "")
            {
                Key = Bind_TableKey;
            }

            this.EOGrid_List.EnableKeyboardNavigation = true;
            this.EOGrid_List.StyleSetIDField          = "Item_Style";
            Layer01_Methods_Web_EO.BindEOGrid(ref this.EOGrid_List, Dt, List_Gc, Key, AllowSort);

            this.ViewState[CnsKey]       = Key;
            this.ViewState[CnsHasDelete] = HasDelete;

            //[-]

            this.Page_Load(null, null);
        }