示例#1
0
文件: CmpEx.cs 项目: cmxcol/sinco_q
        public IExcpPTO ValIExcp(IExcpPTO eX)
        {
            Int64 i64;

            eX.EMsg += (Int64.TryParse(eX.IdCliente, out i64) ? null : "IdCliente.");
            DateTime dt;

            if (eX.TEx.Trim() == "PMT")
            {
                eX.EMsg += null;
                eX.DtVig = null;
            }
            else
            {
                eX.EMsg += (Int64.TryParse(eX.DtVig, out i64)
               ? (Int64.Parse(eX.DtVig) > 0 & Int64.Parse(eX.DtVig) <= 400000 ? null : "Fecha.")
               : (DateTime.TryParse(eX.DtVig, out dt)) ? (DateTime.Parse(eX.DtVig) >= DateTime.Today ? null : "Fecha.") : "Fecha.");
                eX.EMsg += (_emp.Exist(eX.IdEmp) ? null : "Id Empleado.");
            }
            eX.EMsg += (tEx.Exists(eX.TEx) ? null : "Tipo de Excepción.");
            //eX.EMsg += (_emp.Exist(eX.IdEmp) ? null : "Id Empleado.");

            if (eX.EMsg == "")
            {
                eX.EMsg = null;
            }
            else
            {
                eX.EMsg += (eX.EMsg == null ? null : "No Valido(a)");
            }
            if (Int64.TryParse(eX.DtVig, out i64))
            {
                if (Int64.Parse(eX.DtVig) > 0 & Int64.Parse(eX.DtVig) <= 400000)
                {
                    eX.DtVig = String.Format("{0:yyyy-MM-dd}", DateTime.FromOADate(Double.Parse(eX.DtVig)));
                }
            }
            return(eX);
        }
示例#2
0
 public IExcpDTO PTOtoDTO(IExcpPTO ex, Int32 idRol, Int32 idPais, Int32 idEx)
 {
     //return (ex != null ? new ExcpDTO(idEx, Int64.Parse(ex.IdCliente),TExcpDAO.EtoDTO(new TExcpDAO().Load(ex.TEx)), ex.DtVig, PaisDAO.EtoDTO(new PaisDAO().Load(idPais)), RolDAO.EtoDTO(new RolDAO().Load(idRol)), ex.MsgEx,ex.IdEmp) : null);
     return(ex != null ? new ExcpDTO(idEx, Int64.Parse(ex.IdCliente), new TExcpDAO().Load(ex.TEx), ex.DtVig, new PaisDAO().Load(idPais), new RolDAO().Load(idRol), ex.MsgEx, ex.IdEmp) : null);
 }