Ejemplo n.º 1
0
        private bool SetData(STRowRcpData item, out string msg, OracleConnection connection)
        {
            if (connection is null)
            {
                throw new ArgumentNullException(nameof(connection));
            }

            msg = null;

            try
            {
                string query = "INSERT INTO Rcd.VALID_RCPDATA (SHIFTDATE, SALESUM, EMTCODEFRM, AZSCODE, DOCNUMBER, POSNUMBER, DOCDATE, OPERCODE, REALDOSE, PRICE, CURRCODE, EMTCODETO, VSTYPE, " +
                               "VSCODE, WTCASHTYPE, DESCRIPT, CARDBANK, RRN, S_DIIS, NAMEPRODUCT) values (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18, :19, :20)";
                OracleCommand command = new OracleCommand(query, connection);

                command.Parameters.Add(crp(OracleType.DateTime, item.SHIFTDATE, "1", false));
                command.Parameters.Add(crp(OracleType.Number, item.SALESUM, "2", false));
                command.Parameters.Add(crp(OracleType.Int32, item.EMTCODEFRM, "3", false));
                command.Parameters.Add(crp(OracleType.Int32, item.AZSCODE, "4", false));
                command.Parameters.Add(crp(OracleType.Int32, item.DOCNUMBER, "5", false));
                command.Parameters.Add(crp(OracleType.Int32, item.POSNUMBER, "6", false));
                command.Parameters.Add(crp(OracleType.DateTime, item.DOCDATE, "7", false));
                command.Parameters.Add(crp(OracleType.Int32, item.OPERCODE, "8", false));
                command.Parameters.Add(crp(OracleType.Number, item.REALDOSE, "9", false));
                command.Parameters.Add(crp(OracleType.Number, item.PRICE, "10", false));
                command.Parameters.Add(crp(OracleType.Int32, item.CURRCODE, "11", false));
                command.Parameters.Add(crp(OracleType.Int32, item.EMTCODETO, "12", false));
                command.Parameters.Add(crp(OracleType.Int32, item.VSTYPE, "13", false));
                command.Parameters.Add(crp(OracleType.Int32, item.VSCODE, "14", false));
                command.Parameters.Add(crp(OracleType.Int32, item.WTCASHTYPE, "15", false));
                command.Parameters.Add(crp(OracleType.Char, item.DESCRIPT, "16", false));
                command.Parameters.Add(crp(OracleType.Char, item.CARDBANK, "17", false));
                command.Parameters.Add(crp(OracleType.Char, item.RRN, "18", false));
                command.Parameters.Add(crp(OracleType.Number, item.S_DIIS, "19", false));
                command.Parameters.Add(crp(OracleType.Char, item.NAMEPRODUCT, "20", false));

                command.ExecuteNonQuery();
            }
            catch (Exception ex) { msg = ex.Message; return(false); }
            return(true);
        }
Ejemplo n.º 2
0
        private bool read(SqlDataReader reader, out STRowRcpData data, out string msg)
        {
            bool ret = true;

            data = new STRowRcpData();
            msg  = null;
            try
            {
                if (!reader.IsDBNull(0))
                {
                    data.SHIFTDATE = reader.GetDateTime(0);
                }
                if (!reader.IsDBNull(1))
                {
                    data.SALESUM = reader.GetDouble(1);
                }
                if (!reader.IsDBNull(2))
                {
                    data.EMTCODEFRM = reader.GetInt32(2);
                }
                if (!reader.IsDBNull(3))
                {
                    data.AZSCODE = reader.GetInt32(3);
                }
                if (!reader.IsDBNull(4))
                {
                    data.DOCNUMBER = reader.GetInt32(4);
                }
                if (!reader.IsDBNull(5))
                {
                    data.POSNUMBER = reader.GetInt32(5);
                }
                if (!reader.IsDBNull(6))
                {
                    data.DOCDATE = reader.GetDateTime(6);
                }
                if (!reader.IsDBNull(7))
                {
                    data.OPERCODE = reader.GetInt32(7);
                }
                if (!reader.IsDBNull(8))
                {
                    data.REALDOSE = reader.GetDouble(8);
                }
                if (!reader.IsDBNull(9))
                {
                    data.PRICE = reader.GetDouble(9);
                }
                if (!reader.IsDBNull(10))
                {
                    data.CURRCODE = reader.GetInt32(10);
                }
                if (!reader.IsDBNull(11))
                {
                    data.EMTCODETO = reader.GetInt32(11);
                }
                if (!reader.IsDBNull(12))
                {
                    data.VSTYPE = reader.GetInt32(12);
                }
                if (!reader.IsDBNull(13))
                {
                    data.VSCODE = reader.GetInt32(13);
                }
                if (!reader.IsDBNull(14))
                {
                    data.WTCASHTYPE = reader.GetInt32(14);
                }
                if (!reader.IsDBNull(15))
                {
                    data.DESCRIPT = reader.GetString(15);
                }
                if (!reader.IsDBNull(16))
                {
                    data.CARDBANK = reader.GetString(16);
                }
                if (!reader.IsDBNull(17))
                {
                    data.RRN = reader.GetString(17);
                }
                if (!reader.IsDBNull(18))
                {
                    data.S_DIIS = reader.GetDouble(18);
                }
                if (!reader.IsDBNull(19))
                {
                    data.NAMEPRODUCT = reader.GetString(19);
                }
            }
            catch (Exception ex) { log.LogLine("CBookOwner.read() " + ex.Message); msg = ex.Message; ret = false; }
            return(ret);
        }