예제 #1
0
 public void ChargeDonnées(string[] titreCommencePar)
 {
     using (new WaitingCursor())
         using (IDbCommand cmd = BDDatabase.Database.GetCommand())
         {
             StringBuilder SQL = new StringBuilder();
             cmd.Parameters.Clear();
             SQL.Append("SELECT * FROM ALBUMS A INNER JOIN SERIES S ON A.ID_SERIE = S.ID_SERIE");
             if (titreCommencePar != null && titreCommencePar.Length > 0)
             {
                 SQL.Append("\nWHERE");
                 for (int i = 0; i < titreCommencePar.Length; i++)
                 {
                     SQL.Append((i == 0 ? "" : "\nOR") + "\nUPPERTITREALBUM LIKE ?");
                     cmd.Parameters.Add(BDDatabase.Database.GetParameter("@P" + i.ToString(), titreCommencePar[i].ToUpper() + "%"));
                 }
             }
             SQL.Append("\nORDER BY A.UPPERTITREALBUM");
             cmd.CommandText = SQL.ToString();
             using (IDataReader result = cmd.ExecuteReader())
                 using (BaseDataReader <Album> dataReader = new BaseDataReader <Album>(result))
                     if (result != null)
                     {
                         dataReader.FillList(this);
                     }
         }
 }
예제 #2
0
 public void ChargeDonnées(string[] titreCommencePar)
 {
     using (new WaitingCursor())
         using (IDbCommand cmd = BDPPCDatabase.GetCommand())
         {
             StringBuilder SQL = new StringBuilder();
             cmd.Parameters.Clear();
             SQL.Append("SELECT REFEMPRUNTEUR, NOMEMPRUNTEUR FROM EMPRUNTEURS");
             if (titreCommencePar != null && titreCommencePar.Length > 0)
             {
                 SQL.Append("\nWHERE");
                 for (int i = 0; i < titreCommencePar.Length; i++)
                 {
                     SQL.Append((i == 0 ? "" : "\nOR") + "\nUPPERNOMEMPRUNTEUR LIKE ?");
                     cmd.Parameters.Add(BDPPCDatabase.GetParameter("@P" + i.ToString(), titreCommencePar[i].ToUpper() + "%"));
                 }
             }
             SQL.Append("\nORDER BY UPPERNOMEMPRUNTEUR");
             cmd.CommandText = SQL.ToString();
             using (IDataReader result = cmd.ExecuteReader())
                 using (BaseDataReader <Emprunteur> dataReader = new BaseDataReader <Emprunteur>(result))
                     if (result != null)
                     {
                         dataReader.FillList(this);
                     }
         }
 }
예제 #3
0
 public void loadData(string[] TitleStartWith)
 {
     using (new WaitCursor())
         using (IDbCommand cmd = BDPPCDatabase.getCommand())
         {
             StringBuilder SQL = new StringBuilder();
             SQL.Append("SELECT * FROM SERIES S LEFT JOIN EDITEURS E ON S.REFEDITEUR = E.REFEDITEUR LEFT JOIN COLLECTIONS C ON S.REFCOLLECTION=C.REFCOLLECTION");
             if (TitleStartWith != null && TitleStartWith.Length > 0)
             {
                 SQL.Append("\nWHERE");
                 for (int i = 0; i < TitleStartWith.Length; i++)
                 {
                     SQL.Append((i == 0 ? "" : "\nOR") + "\nUPPERTITRESERIE LIKE ?");
                     cmd.Parameters.Add(BDPPCDatabase.getParameter("@P" + i.ToString(), TitleStartWith[i].ToUpper() + "%"));
                 }
             }
             SQL.Append("\nORDER BY S.UPPERTITRESERIE");
             cmd.CommandText = SQL.ToString();
             using (IDataReader result = cmd.ExecuteReader())
                 using (BaseDataReader dataReader = new BaseDataReader(result, typeof(Serie)))
                     if (result != null)
                     {
                         dataReader.fillList(this);
                     }
         }
 }
예제 #4
0
        public override void Fill(params object[] references)
        {
            if (references.Length < 1)
            {
                return;
            }
            Guid reference = (Guid)references[0];

            if (reference.Equals(Guid.Empty))
            {
                return;
            }
            using (new WaitingCursor())
                using (IDbCommand cmd = BDDatabase.Database.GetCommand())
                {
                    cmd.CommandText = "SELECT ID_EDITEUR, NOMEDITEUR, SITEWEB FROM EDITEURS WHERE ID_EDITEUR = ?";
                    cmd.Parameters.Clear();
                    cmd.Parameters.Add(BDDatabase.Database.GetParameter("@ID_editeur", StringUtils.GuidToString(reference)));
                    using (IDataReader result = cmd.ExecuteReader())
                        using (BaseDataReader <EditeurComplet> dataReader = new BaseDataReader <EditeurComplet>(result))
                            if (result != null && result.Read())
                            {
                                dataReader.LoadData(this);
                            }
                }
        }
        /// <summary>
        /// 新增用法
        /// </summary>
        public void SaveUsageItem()
        {
            try
            {
                UsageItem item = new UsageItem( );
                item.Name            = formView.UsageName;
                item.Unit            = formView.UsageUnit;
                item.Py_Code         = formView.UsagePyCode;
                item.Wb_Code         = formView.UsageWbCode;
                item.PrintLongOrder  = formView.PrintLong;
                item.PrintTempOrder  = formView.PrintTemp;
                item.DeleteBit       = formView.DeleteBit;
                item.AssociatedItems = formView.AssociatedItems;

                ServiceItemController controller = new ServiceItemController( );
                if (controller.ItemNameExists(item))
                {
                    throw new Exception("用法名称【" + item.Name + "】已经存在");
                }

                controller.AddUsageItem(item);
                tbUsagediction = BaseDataReader.GetUsageDictionList( );
            }
            catch (Exception err)
            {
                throw err;
            }
        }
예제 #6
0
        public void Fill(Guid ID_Album, int Stock)
        {
            Clear();
            using (IDbCommand cmd = BDDatabase.Database.GetCommand())
            {
                cmd.CommandText = "SELECT ID_Edition FROM EDITIONS WHERE ID_Album = ?";
                if (Stock == 0 || Stock == 1)
                {
                    cmd.CommandText += "AND e.STOCK = ?";
                }
                cmd.Parameters.Clear();
                cmd.Parameters.Add(BDDatabase.Database.GetParameter("@ID_album", StringUtils.GuidToString(ID_Album)));
                if (Stock == 0 || Stock == 1)
                {
                    cmd.Parameters.Add(BDDatabase.Database.GetParameter("@Stock", Stock));
                }

                using (IDataReader result = cmd.ExecuteReader())
                    using (BaseDataReader <EditionComplet> dataReader = new BaseDataReader <EditionComplet>(result))
                        while (result != null && result.Read())
                        {
                            Add(BaseRecordComplet.Create <EditionComplet>(dataReader.GetGuid(0)) as EditionComplet);
                        }
            }
        }
예제 #7
0
 public void loadData(string[] TitleStartWith)
 {
     using (new WaitCursor())
         using (IDbCommand cmd = BDPPCDatabase.getCommand())
         {
             StringBuilder SQL = new StringBuilder();
             SQL.Append("SELECT * FROM ALBUMS A INNER JOIN SERIES S ON A.REFSERIE = S.REFSERIE");
             if (TitleStartWith != null && TitleStartWith.Length > 0)
             {
                 SQL.Append("\nWHERE");
                 for (int i = 0; i < TitleStartWith.Length; i++)
                 {
                     SQL.Append((i == 0 ? "" : "\nOR") + "\nUPPERTITREALBUM LIKE ?");
                     cmd.Parameters.Add(BDPPCDatabase.getParameter("@P" + i.ToString(), TitleStartWith[i].ToUpper() + "%"));
                 }
             }
             SQL.Append("\nORDER BY A.UPPERTITREALBUM");
             cmd.CommandText = SQL.ToString();
             using (IDataReader result = cmd.ExecuteReader())
                 using (BaseDataReader dataReader = new BaseDataReader(result, typeof(Album)))
                     if (result != null)
                     {
                         dataReader.fillList(this);
                     }
         }
 }
예제 #8
0
        public override void Fill(params object[] references)
        {
            if (references.Length < 1)
            {
                return;
            }
            int reference = (int)references[0];

            if (reference == 0)
            {
                return;
            }
            using (new WaitingCursor())
                using (IDbCommand cmd = BDPPCDatabase.GetCommand())
                {
                    cmd.CommandText = "SELECT REFEDITEUR, NOMEDITEUR, SITEWEB FROM EDITEURS WHERE REFEDITEUR = ?";
                    cmd.Parameters.Clear();
                    cmd.Parameters.Add(BDPPCDatabase.GetParameter("@refediteur", reference));
                    using (IDataReader result = cmd.ExecuteReader())
                        using (BaseDataReader <EditeurComplet> dataReader = new BaseDataReader <EditeurComplet>(result))
                            if (result != null && result.Read())
                            {
                                dataReader.LoadData(this);
                            }
                }
        }
예제 #9
0
        public override void Fill(params object[] references)
        {
            if (references.Length < 1)
            {
                return;
            }
            Guid reference = (Guid)references[0];

            if (reference.Equals(Guid.Empty))
            {
                return;
            }
            using (new WaitingCursor())
                using (IDbCommand cmd = BDDatabase.Database.GetCommand())
                {
                    cmd.CommandText = "SELECT ID_ALBUM, TITREALBUM, MOISPARUTION, ANNEEPARUTION, ID_Serie, TOME, TOMEDEBUT, TOMEFIN, SUJETALBUM, REMARQUESALBUM, HORSSERIE, INTEGRALE, COMPLET "
                                      + "FROM ALBUMS "
                                      + "WHERE ID_Album = ?";
                    cmd.Parameters.Clear();
                    cmd.Parameters.Add(BDDatabase.Database.GetParameter("@ID_album", StringUtils.GuidToString(reference)));
                    using (IDataReader result = cmd.ExecuteReader())
                        using (BaseDataReader <AlbumComplet> dataReader = new BaseDataReader <AlbumComplet>(result))
                            if (result != null && result.Read())
                            {
                                dataReader.LoadData(this);
                                fSerie.Fill(dataReader.GetGuid("ID_Serie"));
                            }

                    ListeAuteurs Auteurs = new ListeAuteurs();
                    StoredProcedures.PS.ProcAuteurs(Auteurs, reference, Guid.Empty, Guid.Empty);
                    this.Scénaristes.Clear();
                    this.Dessinateurs.Clear();
                    this.Coloristes.Clear();
                    foreach (Auteur auteur in Auteurs)
                    {
                        switch (auteur.Metier)
                        {
                        case 0:
                        {
                            this.Scénaristes.Add(auteur);
                            break;
                        }

                        case 1:
                        {
                            this.Dessinateurs.Add(auteur);
                            break;
                        }

                        case 2:
                        {
                            this.Coloristes.Add(auteur);
                            break;
                        }
                        }
                    }

                    this.Editions.Fill(ID_Album);
                }
        }
예제 #10
0
 public void ChargeDonnées(string[] titreCommencePar)
 {
     using (new WaitingCursor())
         using (IDbCommand cmd = BDDatabase.Database.GetCommand())
         {
             StringBuilder SQL = new StringBuilder();
             cmd.Parameters.Clear();
             SQL.Append("SELECT * FROM SERIES S LEFT JOIN EDITEURS E ON S.ID_EDITEUR = E.ID_EDITEUR LEFT JOIN COLLECTIONS C ON S.ID_COLLECTION=C.ID_COLLECTION");
             if (titreCommencePar != null && titreCommencePar.Length > 0)
             {
                 SQL.Append("\nWHERE");
                 for (int i = 0; i < titreCommencePar.Length; i++)
                 {
                     SQL.Append((i == 0 ? "" : "\nOR") + "\nUPPERTITRESERIE LIKE ?");
                     cmd.Parameters.Add(BDDatabase.Database.GetParameter("@P" + i.ToString(), titreCommencePar[i].ToUpper() + "%"));
                 }
             }
             SQL.Append("\nORDER BY S.UPPERTITRESERIE");
             cmd.CommandText = SQL.ToString();
             using (IDataReader result = cmd.ExecuteReader())
                 using (BaseDataReader <Série> dataReader = new BaseDataReader <Série>(result))
                     if (result != null)
                     {
                         dataReader.FillList(this);
                     }
         }
 }
예제 #11
0
 public void loadData(string[] TitleStartWith)
 {
     using (new WaitCursor())
         using (IDbCommand cmd = BDPPCDatabase.getCommand())
         {
             StringBuilder SQL = new StringBuilder();
             SQL.Append("SELECT REFEMPRUNTEUR, NOMEMPRUNTEUR FROM EMPRUNTEURS");
             if (TitleStartWith != null && TitleStartWith.Length > 0)
             {
                 SQL.Append("\nWHERE");
                 for (int i = 0; i < TitleStartWith.Length; i++)
                 {
                     SQL.Append((i == 0 ? "" : "\nOR") + "\nUPPERNOMEMPRUNTEUR LIKE ?");
                     cmd.Parameters.Add(BDPPCDatabase.getParameter("@P" + i.ToString(), TitleStartWith[i].ToUpper() + "%"));
                 }
             }
             SQL.Append("\nORDER BY UPPERNOMEMPRUNTEUR");
             cmd.CommandText = SQL.ToString();
             using (IDataReader result = cmd.ExecuteReader())
                 using (BaseDataReader dataReader = new BaseDataReader(result, typeof(Emprunteur)))
                     if (result != null)
                     {
                         dataReader.fillList(this);
                     }
         }
 }
        public void Initialize()
        {
            tbUsagediction = BaseDataReader.GetUsageDictionList( );

            tbServiceItems = BaseDataReader.Get_Hospital_Service_Items( );

            tbUsageFee = BaseDataReader.GetUsageFee( );
        }
예제 #13
0
 /// <summary>
 /// 初始化控制器数据
 /// </summary>
 public void Initiazle()
 {
     OrderList    = BaseDataReader.GetOrderList();
     OrderType    = BaseDataReader.GetBaseTableData(Tables.BASE_ORDER_TYPE, "");
     MedicalClass = BaseDataReader.GetBaseTableData(Tables.BASE_MEDICAL_CLASS, "");
     ServiceItems = BaseDataReader.Get_Hospital_Service_Items();
     DefaultUsage = BaseDataReader.GetBaseTableData(Tables.BASE_USAGEDICTION, Tables.base_usagediction.DELETE_BIT + " = 0");
 }
        /// <summary>
        /// 初始化数据
        /// </summary>
        public void InitData()
        {
            tbServiceItems = BaseDataReader.GetBaseServiceItems();

            tbRegTypeDetailItems = BaseDataReader.GetRegisterTypeAndServiceItemRelation();

            view.RegTypeDefine = BaseDataReader.GetRegisterTypeList();
        }
        private bool isShowing; //标记是否为正在显示数据,防止因显示数据而引发ConfigValueChange事件

        private DataTable GetVindicateTableFieldList( )
        {
            DataTable tbTemp = BaseDataReader.GetVindicateTableFieldList(Tables.base_table_config.TABLE_DB_NAME + " = '" + tableInfo.BASE_TABLE_DB_NAME.ToString().Trim() + "'");

            tbFieldConfig = tbTemp.Clone();
            DataRow[] drs = tbTemp.Select("", Tables.base_table_config.TABINDEX + " ASC");
            for (int i = 0; i < drs.Length; i++)
            {
                tbFieldConfig.Rows.Add(drs[i].ItemArray);
            }
            return(tbFieldConfig);
        }
예제 #16
0
        /// <summary>
        /// 加载药房
        /// </summary>
        private void LoadDrugRoomList()
        {
            DataTable dtDrugRoom = BaseDataReader.GetDrugRoomList();

            foreach (DataRow dr in dtDrugRoom.Rows)
            {
                int          deptId   = Convert.ToInt32(dr["DEPTID"]);
                string       deptName = dr["DEPTNAME"].ToString().Trim();
                ListViewItem item     = new ListViewItem();
                item.Text = deptName;
                item.Tag  = deptId;
                lstDrugRoom.Items.Add(item);
            }
        }
예제 #17
0
        public static BaseDataReader <BaseData> GetReader(int someType)
        {
            BaseDataReader <BaseData> ret = null;

            if (someType == (int)DataReader.postprocesorsData)
            {
                ret = new PostprocesorsData();
            }
            else if (someType == (int)DataReader.settingsData)
            {
                ret = new SettingsData();
            }
            return(ret);
        }
예제 #18
0
        public override void Fill(params System.Object[] references)
        {
            if (references.Length < 1)
            {
                return;
            }
            Guid reference = (Guid)references[0];

            if (reference.Equals(Guid.Empty))
            {
                return;
            }
            using (new WaitingCursor())
                using (IDbCommand cmd = BDDatabase.Database.GetCommand())
                {
                    cmd.CommandText = "SELECT ID_EDITION, ID_Album, e.ID_Editeur, e.ID_Collection, NOMCOLLECTION, ANNEEEDITION, PRIX, VO, COULEUR, ISBN, DEDICACE, PRETE,"
                                      + "STOCK, Offert, Gratuit, NombreDePages, etat, le.libelle as setat, reliure, lr.libelle as sreliure, orientation, lo.libelle as sorientation,"
                                      + "FormatEdition, lf.libelle as sFormatEdition, typeedition, lte.libelle as stypeedition, DateAchat, Notes, AnneeCote, PrixCote "
                                      + "FROM EDITIONS e LEFT JOIN COLLECTIONS c ON e.ID_Collection = c.ID_Collection "
                                      + "LEFT JOIN LISTES le on (le.ref = e.etat and le.categorie = 1) "
                                      + "LEFT JOIN LISTES lr on (lr.ref = e.reliure and lr.categorie = 2) "
                                      + "LEFT JOIN LISTES lte on (lte.ref = e.typeedition and lte.categorie = 3) "
                                      + "LEFT JOIN LISTES lo on (lo.ref = e.orientation and lo.categorie = 4) "
                                      + "LEFT JOIN LISTES lf on (lf.ref = e.formatedition and lf.categorie = 5) "
                                      + "WHERE ID_Edition = ?";
                    cmd.Parameters.Clear();
                    cmd.Parameters.Add(BDDatabase.Database.GetParameter("@ID_Edition", StringUtils.GuidToString(reference)));
                    using (IDataReader result = cmd.ExecuteReader())
                        using (BaseDataReader <EditionComplet> dataReader = new BaseDataReader <EditionComplet>(result))
                            if (result != null && result.Read())
                            {
                                dataReader.LoadData(this);
                                Editeur.Fill(dataReader.GetGuid("ID_EDITEUR"));
                                // Self.Collection.Fill(q);
                            }

                    Emprunts.Fill(reference, srcEmprunt.Album);

                    cmd.CommandText  = "SELECT ID_Couverture, FichierCouverture, STOCKAGECOUVERTURE, CategorieImage, l.Libelle as sCategorieImage";
                    cmd.CommandText += " FROM Couvertures c LEFT JOIN Listes l ON (c.categorieimage = l.ref and l.categorie = 6)";
                    cmd.CommandText += " WHERE ID_Edition = ? ORDER BY c.categorieimage NULLS FIRST, c.Ordre";
                    cmd.Parameters.Add(BDDatabase.Database.GetParameter("@ID_Edition", StringUtils.GuidToString(reference)));
                    using (IDataReader result = cmd.ExecuteReader())
                        using (BaseDataReader <Couverture> dataReader = new BaseDataReader <Couverture>(result))
                            if (result != null)
                            {
                                dataReader.FillList(fCouvertures);
                            }
                }
        }
예제 #19
0
        public override void Fill(params object[] references)
        {
            if (references.Length < 1)
            {
                return;
            }
            Guid reference = (Guid)references[0];

            if (reference.Equals(Guid.Empty))
            {
                return;
            }
            using (new WaitingCursor())
                using (IDbCommand cmd = BDDatabase.Database.GetCommand())
                {
                    cmd.CommandText = "SELECT ID_PERSONNE, NOMPERSONNE, SITEWEB, BIOGRAPHIE FROM PERSONNES WHERE ID_PERSONNE = ?";
                    cmd.Parameters.Clear();
                    cmd.Parameters.Add(BDDatabase.Database.GetParameter("@ID_personne", StringUtils.GuidToString(reference)));
                    using (IDataReader result = cmd.ExecuteReader())
                        using (BaseDataReader <AuteurComplet> dataReader = new BaseDataReader <AuteurComplet>(result))
                            if (result != null && result.Read())
                            {
                                dataReader.LoadData(this);
                            }

                    // UpperTitreSerie en premier pour forcer l'union à trier sur le titre
                    cmd.CommandText  = "SELECT UPPERTITRESERIE, s.ID_SERIE";
                    cmd.CommandText += " FROM ALBUMS al";
                    cmd.CommandText += "  INNER JOIN AUTEURS au ON al.ID_album = au.ID_album AND au.ID_personne = ?";
                    cmd.CommandText += "  INNER JOIN SERIES s ON s.ID_serie = al.ID_serie";
                    cmd.CommandText += " union ";
                    cmd.CommandText += "SELECT UPPERTITRESERIE, s.ID_SERIE";
                    cmd.CommandText += " FROM auteurs_series au";
                    cmd.CommandText += "  INNER JOIN SERIES s ON s.ID_serie = au.ID_serie AND au.ID_personne = ?";
                    cmd.Parameters.Clear();
                    cmd.Parameters.Add(BDDatabase.Database.GetParameter("@ID_personne1", StringUtils.GuidToString(reference)));
                    cmd.Parameters.Add(BDDatabase.Database.GetParameter("@ID_personne2", StringUtils.GuidToString(reference)));
                    this.Séries.Clear();
                    using (IDataReader result = cmd.ExecuteReader())
                        using (BaseDataReader <object> dataReader = new BaseDataReader <object>(result))
                            if (result != null)
                            {
                                while (result.Read())
                                {
                                    this.Séries.Add(BaseRecord.Create <SérieComplet>(dataReader.GetGuid(1), this.ID_Auteur));
                                }
                            }
                }
        }
        /// <summary>
        /// 初始化控制器
        /// </summary>
        public void Initiazle()
        {
            systemTables = BaseDataController.GetSystemTableList();
            DataTable tbbaseTable = BaseDataReader.GetVindicateTableList();

            vindicateTableList = new List <TableConfig>();
            for (int i = 0; i < tbbaseTable.Rows.Count; i++)
            {
                TableConfig tableConfig = new TableConfig();
                tableConfig.BASE_TABLE_CN_NAME  = tbbaseTable.Rows[i][Tables.base_vindicate_table.BASE_TABLE_CN_NAME].ToString().Trim();
                tableConfig.BASE_TABLE_DB_NAME  = tbbaseTable.Rows[i][Tables.base_vindicate_table.BASE_TABLE_DB_NAME].ToString().Trim();
                tableConfig.ALLOW_USER_EDIT     = Convert.ToInt32(tbbaseTable.Rows[i][Tables.base_vindicate_table.ALLOW_USER_EDIT]) == 1 ? true : false;
                tableConfig.ALLOW_PHYSIC_DELETE = Convert.ToInt32(tbbaseTable.Rows[i][Tables.base_vindicate_table.ALLOW_PHYSIC_DELETE]) == 1 ? true : false;
                vindicateTableList.Add(tableConfig);
            }
        }
        /// <summary>
        /// 初始化
        /// </summary>
        public void Initialize()
        {
            //加载需要维护的基础表的列表
            baseTableList = new List <TableConfig>();
            DataTable tbbaseTable = BaseDataReader.GetVindicateTableList();

            for (int i = 0; i < tbbaseTable.Rows.Count; i++)
            {
                TableConfig tableConfig = new TableConfig();
                tableConfig.BASE_TABLE_CN_NAME = tbbaseTable.Rows[i][Tables.base_vindicate_table.BASE_TABLE_CN_NAME].ToString().Trim();
                tableConfig.BASE_TABLE_DB_NAME = tbbaseTable.Rows[i][Tables.base_vindicate_table.BASE_TABLE_DB_NAME].ToString().Trim();
                tableConfig.ALLOW_USER_EDIT    = Convert.ToInt32(tbbaseTable.Rows[i][Tables.base_vindicate_table.ALLOW_USER_EDIT]) == 1 ? true : false;
                baseTableList.Add(tableConfig);
            }

            tbFieldConfig = BaseDataReader.GetVindicateTableFieldList("");
        }
        /// <summary>
        /// 在网格内显示表数据
        /// </summary>
        public void ShowDataInGrid()
        {
            DataRow[] drsConfig = tbFieldConfig.Select(Tables.base_table_config.TABLE_DB_NAME + "='" + formView.SelectedTable.BASE_TABLE_DB_NAME.ToString().Trim() + "'",
                                                       Tables.base_table_config.TABINDEX + " ASC");
            string[] fields = new string[drsConfig.Length];
            for (int i = 0; i < drsConfig.Length; i++)
            {
                fields[i] = "rtrim(cast(" + drsConfig[i][Tables.base_table_config.FIELD_DB_NAME].ToString( ) + " as char(30))) as " + drsConfig[i][Tables.base_table_config.FIELD_DB_NAME].ToString( );
            }
            if (fields.Length == 0)
            {
                fields = null;
            }

            DataTable tbData = BaseDataReader.GetBaseTableData(formView.SelectedTable.BASE_TABLE_DB_NAME.Trim().ToString(), fields, "");

            dataGridViewEx.DataSource = tbData.DefaultView;
        }
예제 #23
0
 public override void Fill(int Reference)
 {
     if (Reference == 0)
     {
         return;
     }
     using (new WaitCursor())
         using (IDbCommand cmd = BDPPCDatabase.getCommand())
         {
             cmd.CommandText = "SELECT REFEDITEUR, NOMEDITEUR, SITEWEB FROM EDITEURS WHERE REFEDITEUR = ?";
             cmd.Parameters.Add(BDPPCDatabase.getParameter("@refediteur", Reference));
             using (IDataReader result = cmd.ExecuteReader())
                 using (BaseDataReader dataReader = new BaseDataReader(result, this.GetType()))
                     if (result != null && result.Read())
                     {
                         dataReader.loadData(this);
                     }
         }
 }
예제 #24
0
        public override void ProcAuteurs(ListeAuteurs list, Guid ID_Album, Guid ID_Série, Guid ID_ParaBD)
        {
            using (new WaitingCursor())
                using (IDbCommand cmd = BDDatabase.Database.GetCommand())
                {
                    cmd.CommandText = "select id_personne, nompersonne, id_album, id_serie, id_parabd, metier from proc_auteurs(?, ?, ?)";
                    cmd.Parameters.Clear();
                    cmd.Parameters.Add(BDDatabase.Database.GetParameter("@ID_Album", StringUtils.GuidToString(ID_Album)));
                    cmd.Parameters.Add(BDDatabase.Database.GetParameter("@ID_Serie", StringUtils.GuidToString(ID_Série)));
                    cmd.Parameters.Add(BDDatabase.Database.GetParameter("@ID_ParaBD", StringUtils.GuidToString(ID_ParaBD)));

                    using (IDataReader result = cmd.ExecuteReader())
                        using (BaseDataReader <Auteur> dataReader = new BaseDataReader <Auteur>(result))
                            if (result != null)
                            {
                                dataReader.FillList(list);
                            }
                }
        }
예제 #25
0
        private void LoadDatasource()
        {
            DataRow[] drs     = BaseDataReader.GetOrderList().Select("DELETE_BIT=0");
            DataTable dtOrder = BaseDataReader.GetOrderList().Clone();

            for (int i = 0; i < drs.Length; i++)
            {
                dtOrder.Rows.Add(drs[i].ItemArray);
            }

            txt002.SetSelectionCardDataSource(BaseDataReader.GetUsageDictionList().Select("DELETE_BIT=0").CopyToDataTable());

            DataRow[] drDeptOfMZ = BaseDataReader.Base_Dept_Property.Select("MZ_FLAG=1 AND TYPE_CODE='001'");
            for (int i = 0; i < drDeptOfMZ.Length; i++)
            {
                DataRow dr = baseDataSet.Tables["dtDeptOfMZ"].NewRow();
                dr["DEPT_ID"] = drDeptOfMZ[i]["DEPT_ID"];
                dr["NAME"]    = drDeptOfMZ[i]["NAME"];
                baseDataSet.Tables["dtDeptOfMZ"].Rows.Add(dr);
            }

            DataRow[] drDeptOfYP = BaseDataReader.GetDrugRoomList().Select("DEPTTYPE1='药房'");
            for (int i = 0; i < drDeptOfYP.Length; i++)
            {
                DataRow dr = baseDataSet1.Tables["dtDeptOfYP"].NewRow();
                dr["DEPTDICID"] = drDeptOfYP[i]["DEPTID"];
                dr["DEPTNAME"]  = drDeptOfYP[i]["DEPTNAME"];
                baseDataSet1.Tables["dtDeptOfYP"].Rows.Add(dr);
            }

            dgv007.SetSelectionCardDataSource(dtOrder, 1);

            DataTable dtOrderType = BaseDataReader.GetOrderType();

            for (int i = 0; i < dtOrderType.Rows.Count; i++)
            {
                ListViewItem item = new ListViewItem();
                item.Text = dtOrderType.Rows[i]["NAME"].ToString();
                item.Tag  = Convert.ToInt32(dtOrderType.Rows[i]["ID"]);
                lvw010.Items.Add(item);
            }
        }
        /// <summary>
        /// 加载数据
        /// </summary>
        public void Initalize()
        {
            tbSystemTable = BaseDataController.GetSystemTableList();
            //加载字段配置表
            tbFieldConfig = GetVindicateTableFieldList();
            ////根据表名从DLL加载字段列表
            //string dllName = System.Windows.Forms.Application.StartupPath + "\\HIS.Entity.dll";
            //Assembly assembly = Assembly.LoadFile( dllName );
            //string typeName = "HIS.Model." + tableInfo.BASE_TABLE_DB_NAME.ToString().Trim();
            //object obj = assembly.CreateInstance( typeName, true );
            //if ( obj == null )
            //    throw new Exception( "未能从实体文件加载表对象【"+typeName + "】");
            //PropertyInfo[] properies = obj.GetType().GetProperties();
            //获取当前数据库表
            DataTable tb = BaseDataReader.GetBaseTableData(tableInfo.BASE_TABLE_DB_NAME.ToString(), "1>2");

            lstField = new List <Item>();
            bool reloadConfig = false;

            for (int i = 0; i < tb.Columns.Count; i++)
            {
                string strWhere = Tables.base_table_config.TABLE_DB_NAME + " = '" + tableInfo.BASE_TABLE_DB_NAME.ToString().Trim() + "' and "
                                  + Tables.base_table_config.FIELD_DB_NAME + " = '" + tb.Columns[i].ColumnName + "'";
                DataRow[] drsFields = tbFieldConfig.Select(strWhere);
                if (drsFields.Length == 0)
                {
                    TableAndFieldConfig.AddDefaultConfig(tableInfo, tb.Columns[i].ColumnName);
                    reloadConfig = true;
                }
            }
            if (reloadConfig)
            {
                tbFieldConfig = GetVindicateTableFieldList();
            }
            for (int i = 0; i < tbFieldConfig.Rows.Count; i++)
            {
                Item item = new Item();
                item.Text  = tbFieldConfig.Rows[i][Tables.base_table_config.FIELD_CN_NAME].ToString().Trim();
                item.Value = tbFieldConfig.Rows[i][Tables.base_table_config.FIELD_DB_NAME].ToString().Trim();
                lstField.Add(item);
            }
        }
예제 #27
0
        public override void Fill(int Reference)
        {
            if (Reference == 0)
            {
                return;
            }
            using (new WaitCursor())
                using (IDbCommand cmd = BDPPCDatabase.getCommand())
                {
                    cmd.CommandText = "SELECT REFPERSONNE, NOMPERSONNE, SITEWEB, BIOGRAPHIE FROM PERSONNES WHERE REFPERSONNE = ?";
                    cmd.Parameters.Add(BDPPCDatabase.getParameter("@refpersonne", Reference));
                    using (IDataReader result = cmd.ExecuteReader())
                        using (BaseDataReader dataReader = new BaseDataReader(result, this.GetType()))
                            if (result != null && result.Read())
                            {
                                dataReader.loadData(this);
                            }

                    // UpperTitreSerie en premier pour forcer l'union à trier sur le titre
                    cmd.CommandText  = "SELECT UPPERTITRESERIE, s.REFSERIE";
                    cmd.CommandText += " FROM ALBUMS al";
                    cmd.CommandText += "  INNER JOIN AUTEURS au ON al.refalbum = au.refalbum AND au.refpersonne = ?";
                    cmd.CommandText += "  INNER JOIN SERIES s ON s.refserie = al.refserie";
                    cmd.CommandText += " union ";
                    cmd.CommandText += "SELECT UPPERTITRESERIE, s.REFSERIE";
                    cmd.CommandText += " FROM auteurs_series au";
                    cmd.CommandText += "  INNER JOIN SERIES s ON s.refserie = au.refserie AND au.refpersonne = ?";
                    cmd.Parameters.Add(BDPPCDatabase.getParameter("@refpersonne1", Reference));
                    cmd.Parameters.Add(BDPPCDatabase.getParameter("@refpersonne2", Reference));
                    Series.Clear();
                    using (IDataReader result = cmd.ExecuteReader())
                        using (BaseDataReader dataReader = new BaseDataReader(result, typeof(SerieComplet)))
                            if (result != null)
                            {
                                while (result.Read())
                                {
                                    Series.Add(new SerieCompletPPC(dataReader.GetInt(1), this.RefAuteur));
                                }
                            }
                }
        }
예제 #28
0
        static void Main(string[] args)
        {
            string appPath   = System.Reflection.Assembly.GetExecutingAssembly().Location;
            var    directory = System.IO.Path.GetDirectoryName(appPath);

            BaseDataReader <BaseData> reader = Factory.GetReader((int)FileType.settingFile);
            SETTINGS setting = (SETTINGS)reader.ReadData(Path.Combine(directory, @"SETTING.xml"));

            var dataFilePath = Path.Combine(setting.settingrows[0].ZODataPath, setting.settingrows[0].DataFileName);

            reader = Factory.GetReader((int)FileType.dataFile);
            DATA data = (DATA)reader.ReadData(dataFilePath, true);

            FileManipulator fileManipulator = new FileManipulator(data, setting.settingrows[0].LogFilePath)
            {
                OutputPath     = setting.settingrows[0].OutputPath,
                FileRepository = setting.settingrows[0].FileRepositoryPath
            };

            fileManipulator.Manipulate();
        }
예제 #29
0
        private void LoadDataSource()
        {
            // * 20100517.2.01 住院医生站参数设置修改(科室和药房对应关系)
            DataRow[] drDeptOfZY = BaseDataReader.Base_Dept_Property.Select("ZY_FLAG=1 AND TYPE_CODE='001'");
            for (int i = 0; i < drDeptOfZY.Length; i++)
            {
                DataRow dr = baseDataSet.Tables["dtDeptOfZY"].NewRow();
                dr["DEPT_ID"] = drDeptOfZY[i]["DEPT_ID"];
                dr["NAME"]    = drDeptOfZY[i]["NAME"];
                baseDataSet.Tables["dtDeptOfZY"].Rows.Add(dr);
            }

            DataRow[] drDeptOfYP = BaseDataReader.GetDrugRoomList().Select("DEPTTYPE1='药房'");
            for (int i = 0; i < drDeptOfYP.Length; i++)
            {
                DataRow dr = baseDataSet.Tables["dtDeptOfYP"].NewRow();
                dr["DEPTDICID"] = drDeptOfYP[i]["DEPTID"];
                dr["DEPTNAME"]  = drDeptOfYP[i]["DEPTNAME"];
                baseDataSet.Tables["dtDeptOfYP"].Rows.Add(dr);
            }
        }
예제 #30
0
        public static void ProcAuteurs(ArrayList list, int refAlbum, int refSérie)
        {
            using (new WaitingCursor())
                using (IDbCommand cmd = BDPPCDatabase.GetCommand())
                {
                    if (refAlbum != -1)
                    {
                        cmd.CommandText = "select p.refpersonne, p.nompersonne, a.refalbum, NULL as refserie, a.metier "
                                          + "from personnes p inner join auteurs a on a.refpersonne = p.refpersonne "
                                          + "where a.refalbum = ? "
                                          + "order by a.metier, p.uppernompersonne";
                        cmd.Parameters.Clear();
                        cmd.Parameters.Add(BDPPCDatabase.GetParameter("@RefAlbum", refAlbum));

                        using (IDataReader result = cmd.ExecuteReader())
                            using (BaseDataReader <Auteur> dataReader = new BaseDataReader <Auteur>(result))
                                if (result != null)
                                {
                                    dataReader.FillList(list);
                                }
                    }

                    if (refSérie != -1)
                    {
                        cmd.CommandText = "select p.refpersonne, p.nompersonne, NULL as refalbum, a.refserie, a.metier "
                                          + "from personnes p inner join auteurs_series a on a.refpersonne = p.refpersonne "
                                          + "where a.refserie = ? "
                                          + "order by a.metier, p.uppernompersonne";
                        cmd.Parameters.Clear();
                        cmd.Parameters.Add(BDPPCDatabase.GetParameter("@RefSerie", refSérie));

                        using (IDataReader result = cmd.ExecuteReader())
                            using (BaseDataReader <Auteur> dataReader = new BaseDataReader <Auteur>(result))
                                if (result != null)
                                {
                                    dataReader.FillList(list);
                                }
                    }
                }
        }