public UIMaster GetGridViewDBKey(string objName, string objCaption)
        {
            if (gridDBKey == null)
            {
                var gridDBKey = XpoDefault.Session.FindObject <UIMaster>(CriteriaOperator.Parse("[ObjCodeName] = ? ", objName));
                if (gridDBKey == null)//Create new line
                {
                    gridDBKey = new UIMaster(XpoDefault.Session)
                    {
                        ObjCodeName = objName, ObjCodeCaption = objCaption
                    };
                    gridDBKey.Save();
                }
            }


            return(gridDBKey);

            /*  SqlCommand cmd = new SqlCommand();
             * SqlParameter gridCSharpCodeNameParm = new SqlParameter("@GridCSharpCodeName", objName);
             * SqlParameter gridCSharpCodeCaptionParm = new SqlParameter("@GridCSharpCodeCaption", objCaption);
             * SqlParameter gridKeyParmOutPut = new SqlParameter("@GridKey", SqlDbType.Int);
             * gridKeyParmOutPut.Direction = ParameterDirection.Output;
             *
             * cmd.Connection = HFrameWork.GlobalVariable.Sqlca;
             * cmd.CommandType = CommandType.StoredProcedure;
             * cmd.CommandText = "sp_ERPSys_Grid_GetGridViewDBKey";
             * cmd.Parameters.Add(gridCSharpCodeNameParm);
             * cmd.Parameters.Add(gridCSharpCodeCaptionParm);
             * cmd.Parameters.Add(gridKeyParmOutPut);
             *
             * cmd.ExecuteNonQuery();
             *
             * return (int)gridKeyParmOutPut.Value;
             */
        }