Exemple #1
0
        private SimpleView GetSimpleViewFrom(DataRow dr)
        {
            SimpleView view = new SimpleView();

            view.ID               = SqlHelper.GetStringFrom(dr["ViewID"]);
            view.Name             = SqlHelper.GetStringFrom(dr["Name"]);
            view.LocaleID         = SqlHelper.GetStringFrom(dr["LocaleID"]);
            view.ViewType         = SqlHelper.GetIntFrom(dr["ViewType"], 0);
            view.bSystem          = SqlHelper.GetBooleanFrom(dr["bSystem"], false);
            view.ViewClass        = SqlHelper.GetStringFrom(dr["ViewClass"]);
            view.RowsCount        = SqlHelper.GetIntFrom(dr["RowsCount"], 40);
            view.bShowDetail      = SqlHelper.GetBooleanFrom(dr["bShowDetail"], true);
            view.FontColorStyleId = SqlHelper.GetStringFrom(dr["FontColorStyleId"], string.Empty);
            return(view);
        }
Exemple #2
0
        private void FillSimpleViewCollection(DataTable table, string defaultViewID)
        {
            bool HasDefault = false;

            for (int i = 0; i < table.Rows.Count; i++)
            {
                SimpleView view = GetSimpleViewFrom(table.Rows[i]);
                if (view.ID == defaultViewID)
                {
                    view.IsDefault = true;
                    HasDefault     = true;
                }
                view.State = PersistentObjectState.View;
                _SimpleViews.Add(view);
            }

            if (!HasDefault && _SimpleViews.Count > 0)
            {
                _SimpleViews[0].IsDefault = true;
            }
        }
Exemple #3
0
 internal void Remove(SimpleView item)
 {
     this.List.Remove(item);
 }
Exemple #4
0
 public void Add(SimpleView item)
 {
     item.Parent = this;
     this.List.Add(item);
 }
        internal void Retrieve()
        {
            CheckDbCnnString();

            SqlCommand cmd = new SqlCommand("UAP_Report_RuntimeExihibitonGetReportRelateInfor");

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add(SqlHelper.GetParameter("@ID", SqlDbType.NVarChar, 100, _InputID));
            cmd.Parameters.Add(SqlHelper.GetParameter("@cAccId", SqlDbType.Char, 3, _cAccId));
            cmd.Parameters.Add(SqlHelper.GetParameter("@cYear", SqlDbType.Char, 4, _cYear));
            cmd.Parameters.Add(SqlHelper.GetParameter("@cUser", SqlDbType.NVarChar, 20, _UserID));
            cmd.Parameters.Add(SqlHelper.GetParameter("@LocaleID", SqlDbType.NVarChar, 10, _LocaleID));
            cmd.Parameters.Add(SqlHelper.GetParameter("@DefaultViewID", SqlDbType.NVarChar, 100));
            cmd.Parameters.Add(SqlHelper.GetParameter("@ReportID", SqlDbType.NVarChar, 100));

            DataSet ds = SqlHelper.ExecuteDataSet(_DbConnString, cmd);

            if (ds.Tables.Count > 1)
            {
                string defaultviewid = cmd.Parameters["@DefaultViewID"].Value.ToString();
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    SimpleView view = new SimpleView();
                    view.ID              = ds.Tables[0].Rows[i]["ViewGuid"].ToString();
                    view.Name            = ds.Tables[0].Rows[i]["Name"].ToString();
                    view.ViewType        = Convert.ToInt32(ds.Tables[0].Rows[i]["ViewType"]);
                    view.ViewClass       = SqlHelper.GetStringFrom(ds.Tables[0].Rows[i]["ViewClass"]);
                    view.ReportMergeCell = SqlHelper.GetBooleanFrom(ds.Tables[0].Rows[i]["ReportMergeCell"], false);
                    view.RowsCount       = SqlHelper.GetIntFrom(ds.Tables[0].Rows[i]["RowsCount"], 40);
                    view.bShowDetail     = SqlHelper.GetBooleanFrom(ds.Tables[0].Rows[i]["bShowDetail"], false);

                    if (view.ID.ToLower() == defaultviewid.ToLower())
                    {
                        view.IsDefault = true;
                    }

                    _Views.Add(view);
                }

                DataRow dr = ds.Tables[1].Rows[0];
                _ReportID     = cmd.Parameters["@ReportID"].Value.ToString();
                _ClassName    = SqlHelper.GetStringFrom(dr["ClassName"]);
                _FilterId     = SqlHelper.GetStringFrom(dr["FilterId"]);
                _FilterClass  = SqlHelper.GetStringFrom(dr["FilterClass"]);
                _rootReportId = SqlHelper.GetStringFrom(dr["RootReportId"]);
                _bVB          = SqlHelper.GetBooleanFrom(dr["bVB"], true);


                if (defaultviewid == string.Empty)
                {
                    if (_Views.Count <= 0)
                    {
                        throw new ResourceReportException(String4Report.GetString("操作员没有查询权限或视图权限!", _LocaleID));
                    }
                    _DefaultViewID = _Views[0].ID;
                }
                else
                {
                    _DefaultViewID = defaultviewid;
                }
            }
        }