예제 #1
0
        public void CopyFromLine(Pesaje item, TLine line)
        {
            try
            {
                switch (SerialDevice)
                {
                case ESerialDevice.K3Scales:
                {
                    try { item.Neto = Convert.ToDecimal(line.Line.Substring(2, 8)); }
                    catch { item.Neto = 0; }

                    item.Fecha         = line.Date;
                    item.Tara          = 0;
                    item.Bruto         = item.Tara + item.Neto;
                    item.Observaciones = EnumText <ESerialDevice> .GetLabel(ESerialDevice.K3Scales) + " | " + line.Line;
                }
                break;
                }
            }
            catch (Exception ex)
            {
                MyLogger.LogText(ex.Message + ex.StackTrace, "CALLER", "ScalesMng::CopyFromLine");
            }
        }
예제 #2
0
        public static bool CheckEditAllowedEstado(EEstado estado, EEstado allowedEstado)
        {
            if ((estado != allowedEstado) || (estado == EEstado.Anulado))
            {
                throw new iQException(string.Format(Resources.Messages.EDIT_NOT_ALLOWED_BY_ESTADO, EnumText <EEstado> .GetLabel(estado)));
            }

            return(true);
        }