예제 #1
0
        public IDAL.VO.EsameVO GetEsameById(string esamidid)
        {
            Stopwatch tw = new Stopwatch();

            tw.Start();

            IDAL.VO.EsameVO esam = null;
            try
            {
                long           esamidid_ = long.Parse(esamidid);
                hlt_esameradio esam_     = hltCC.hlt_esameradio.Single(t => t.esameidid == esamidid_);
                log.Info(string.Format("Entity Framework Query Executed! Retrieved 1 record!"));
                esam = EsameMapper.EsamMapper(esam_);
                log.Info(string.Format("Record mapped to {0}", esam.GetType().ToString()));
            }
            catch (Exception ex)
            {
                log.Info(string.Format("Entity Framework Query Executed! Retrieved 0 record!"));
                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(esam);
        }
예제 #2
0
파일: EsameBLL.cs 프로젝트: GitMAGI/RISRep
        public int UpdateEsameById(IBLL.DTO.EsameDTO data, string esamidid)
        {
            Stopwatch tw = new Stopwatch();

            tw.Start();

            int result = 0;

            try
            {
                IDAL.VO.EsameVO data_ = EsameMapper.EsamMapper(data);
                log.Info(string.Format("1 {0} mapped to {1}", data.GetType().ToString(), data_.GetType().ToString()));
                result = dal.UpdateEsameByPk(data_, esamidid);
            }
            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(result);
        }