示例#1
0
        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
        public static IDAL.VO.RefertoVO RefeMapper(DataRow row)
        {
            IDAL.VO.RefertoVO refe = new IDAL.VO.RefertoVO();

            refe.refeidid = row["refeidid"] != DBNull.Value ? (int)row["refeidid"] : (int?)null;
            refe.refedocu = row["refedocu"] != DBNull.Value ? (string)row["refedocu"] : null;
            refe.refemeno = row["refemeno"] != DBNull.Value ? (string)row["refemeno"] : null;
            refe.refemecf = row["refemecf"] != DBNull.Value ? (string)row["refemecf"] : null;
            refe.refedata = row["refedata"] != DBNull.Value ? (DateTime)row["refedata"] : (DateTime?)null;
            refe.refeidid = row["refeesam"] != DBNull.Value ? (int)row["refeesam"] : (int?)null;

            return(refe);
        }
示例#3
0
        public static IBLL.DTO.RefertoDTO RefeMapper(IDAL.VO.RefertoVO raw)
        {
            IBLL.DTO.RefertoDTO refe = null;
            try
            {
                Mapper.Initialize(cfg => cfg.CreateMap <IDAL.VO.RefertoVO, IBLL.DTO.RefertoDTO>());
                Mapper.AssertConfigurationIsValid();
                refe = Mapper.Map <IBLL.DTO.RefertoDTO>(raw);
            }
            catch (AutoMapperConfigurationException ex)
            {
                log.Error(string.Format("AutoMapper Configuration Error!\n{0}", ex.Message));
            }
            catch (AutoMapperMappingException ex)
            {
                log.Error(string.Format("AutoMapper Mapping Error!\n{0}", ex.Message));
            }

            return(refe);
        }