Example #1
0
        public bool BorealEnviar(OrdenCargaBE objOrdenCargaBE, ref int code, ref string message)
        {
            try
            {
                code    = Notification.OperationCode.Exito.GetHashCode();
                message = Notification.Titulo.Exito;

                objOrdenCargaDALC.BorealEnviar(objOrdenCargaBE);
                return(true);
            }
            catch (SqlException exSql)
            {
                objErrorDALC = new ErrorDALC();
                objErrorDALC.Registrar(2, exSql.Message, "OrdenCargaBL.BorealEnviar", (int)objOrdenCargaBE.IdUsuarioSupervisor, null, objOrdenCargaBE.IdOrdenCarga);

                message = Notification.Titulo.ErrorSQLServer;
                code    = Notification.OperationCode.ErrorDataBase.GetHashCode();
                return(false);
            }
            catch (Exception ex)
            {
                objErrorDALC = new ErrorDALC();
                objErrorDALC.Registrar(3, ex.Message, "OrdenCargaBL.BorealEnviar", (int)objOrdenCargaBE.IdUsuarioSupervisor, null, objOrdenCargaBE.IdOrdenCarga);

                message = Notification.Titulo.ErrorInterface;
                code    = Notification.OperationCode.ErrorNotControl.GetHashCode();
                return(false);
            }
        }
Example #2
0
        public IHttpActionResult TransportistaFinalizar([FromBody] OrdenCargaBE objOrdenCargaBE)
        {
            int    codeResult    = 0;
            string messageResult = string.Empty;

            objOrdenCargaBL = new OrdenCargaBL();
            var dataResult = objOrdenCargaBL.TransportistaFinalizar(objOrdenCargaBE, ref codeResult, ref messageResult);

            return(Ok(new Result()
            {
                Message = messageResult, Data = dataResult, Code = codeResult
            }));
        }
Example #3
0
        public IHttpActionResult NoPlanIniciar([FromBody] OrdenCargaBE objOrdenCargaBE)
        {
            int    codeResult    = 0;
            string messageResult = string.Empty;

            objOrdenCargaBL = new OrdenCargaBL();
            var dataResult = objOrdenCargaBL.NoPlanIniciar((int)objOrdenCargaBE.IdUsuarioTransportista,
                                                           (int)objOrdenCargaBE.IdOrdenCarga, ref codeResult, ref messageResult);

            return(Ok(new Result()
            {
                Message = messageResult, Data = dataResult, Code = codeResult
            }));
        }
Example #4
0
        public IHttpActionResult InspectorIniciar([FromBody] OrdenCargaBE objOrdenCargaBE)
        {
            int    codeResult    = 0;
            string messageResult = string.Empty;

            objOrdenCargaBL = new OrdenCargaBL();
            var dataResult = objOrdenCargaBL.InspectorIniciar((int)objOrdenCargaBE.IdOrdenCarga,
                                                              (int)objOrdenCargaBE.IdUsuarioSupervisor, ref codeResult, ref messageResult);

            return(Ok(new Result()
            {
                Message = messageResult, Data = dataResult, Code = codeResult
            }));
        }
Example #5
0
        public bool InspectorFinalizar(OrdenCargaBE objOrdenCargaBE, ref int code, ref string message)
        {
            try
            {
                code    = Notification.OperationCode.Exito.GetHashCode();
                message = Notification.Titulo.Exito;

                if (!objOrdenCargaDALC.ComercialEnviar(objOrdenCargaBE))
                {
                    throw new ArgumentException("No se puedo enviar guardar la orden de carga");
                }

                objOrdenCargaDALC.InspectorActualizar(objOrdenCargaBE);

                return(objOrdenCargaDALC.InspectorFinalizar((int)objOrdenCargaBE.IdUsuarioSupervisor,
                                                            (int)objOrdenCargaBE.IdOrdenCarga));
            }
            catch (SqlException exSql)
            {
                objErrorDALC = new ErrorDALC();
                objErrorDALC.Registrar(2, exSql.Message, "OrdenCargaBL.InspectorFinalizar", (int)objOrdenCargaBE.IdUsuarioSupervisor, null, objOrdenCargaBE.IdOrdenCarga);

                message = Notification.Titulo.ErrorSQLServer;
                code    = Notification.OperationCode.ErrorDataBase.GetHashCode();
                return(false);
            }
            catch (Exception ex)
            {
                objErrorDALC = new ErrorDALC();

                if (ex.Message.Equals("CUSTOM"))
                {
                    message = ex.InnerException.Message;
                }
                else
                {
                    message = Notification.Titulo.ErrorInterface;
                }

                objErrorDALC.Registrar(3, message, "OrdenCargaBL.InspectorFinalizar", (int)objOrdenCargaBE.IdUsuarioSupervisor, null, objOrdenCargaBE.IdOrdenCarga);
                code = Notification.OperationCode.ErrorNotControl.GetHashCode();
                return(false);
            }
        }
Example #6
0
        public bool TransportistaFinalizar(OrdenCargaBE objOrdenCargaBE, ref int code, ref string message)
        {
            try
            {
                code    = Notification.OperationCode.Exito.GetHashCode();
                message = Notification.Titulo.Exito;

                objOrdenCargaDALC.TransportistaActualizar(objOrdenCargaBE);
                return(objOrdenCargaDALC.TransportistaFinalizar((int)objOrdenCargaBE.IdUsuarioTransportista, (int)objOrdenCargaBE.IdOrdenCarga));
            }
            catch (SqlException exSql)
            {
                objErrorDALC = new ErrorDALC();
                objErrorDALC.Registrar(2, exSql.Message, "OrdenCargaBL.TransportistaFinalizar", (int)objOrdenCargaBE.IdUsuarioTransportista, null, objOrdenCargaBE.IdOrdenCarga);

                message = Notification.Titulo.ErrorSQLServer;
                code    = Notification.OperationCode.ErrorDataBase.GetHashCode();
                return(false);
            }
            catch (Exception ex)
            {
                objErrorDALC = new ErrorDALC();

                if (ex.Message.Equals("CUSTOM"))
                {
                    message = ex.InnerException.Message;
                }
                else
                {
                    message = Notification.Titulo.ErrorNoControlado;
                }

                objErrorDALC.Registrar(1, message, "OrdenCargaBL.TransportistaFinalizar", (int)objOrdenCargaBE.IdUsuarioTransportista, null, objOrdenCargaBE.IdOrdenCarga);
                code = Notification.OperationCode.ErrorNotControl.GetHashCode();
                return(false);
            }
        }