コード例 #1
0
ファイル: RefertoBLL.cs プロジェクト: GitMAGI/LISPluginGen
        public IBLL.DTO.RefertoDTO GetRefertoById(string id)
        {
            Stopwatch tw = new Stopwatch();

            tw.Start();

            log.Info(string.Format("Starting ..."));

            IBLL.DTO.RefertoDTO refe = null;

            try
            {
                IDAL.VO.RefertoVO refe_ = this.dal.GetRefertoById(id);
                refe = RefertoMapper.RefeMapper(refe_);
                log.Info(string.Format("{0} {1} mapped to {2}", LibString.ItemsNumber(refe), LibString.TypeName(refe_), LibString.TypeName(refe)));
            }
            catch (Exception ex)
            {
                string msg = "An Error occured! Exception detected!";
                log.Info(msg);
                log.Error(msg + "\n" + ex.Message);
            }

            tw.Stop();
            log.Info(string.Format("Completed! Elapsed time {0}", LibString.TimeSpanToTimeHmsms(tw.Elapsed)));

            return(refe);
        }
コード例 #2
0
ファイル: RefertoDAO.cs プロジェクト: GitMAGI/LISPluginGen
        public RefertoVO GetRefertoById(string refeidid)
        {
            Stopwatch tw = new Stopwatch();

            tw.Start();

            log.Info(string.Format("Starting ..."));

            RefertoVO refe = null;

            try
            {
                string connectionString = this.GRConnectionString;

                int    refeidid_ = int.Parse(refeidid);
                string table     = this.RefertoTabName;

                Dictionary <string, DBSQL.QueryCondition> conditions = new Dictionary <string, DBSQL.QueryCondition>()
                {
                    {
                        "id",
                        new DBSQL.QueryCondition()
                        {
                            Key   = "refeidid",
                            Op    = DBSQL.Op.Equal,
                            Value = refeidid_,
                            Conj  = DBSQL.Conj.None
                        }
                    }
                };
                DataTable data = DBSQL.SelectOperation(connectionString, table, conditions);
                log.Info(string.Format("DBSQL Query Executed! Retrieved {0} record!", LibString.ItemsNumber(data)));
                if (data != null)
                {
                    if (data.Rows.Count == 1)
                    {
                        refe = RefertoMapper.RefeMapper(data.Rows[0]);
                        log.Info(string.Format("{0} Records mapped to {1}", LibString.ItemsNumber(refe), LibString.TypeName(refe)));
                    }
                }
            }
            catch (Exception ex)
            {
                string msg = "An Error occured! Exception detected!";
                log.Info(msg);
                log.Error(msg + "\n" + ex.Message);
            }

            tw.Stop();

            log.Info(string.Format("Completed! Elapsed time {0}", LibString.TimeSpanToTimeHmsms(tw.Elapsed)));

            return(refe);
        }