Ejemplo n.º 1
0
        private void ParseAccountBillQuantity(Prism867Context context, string[] marketFields)
        {
            var current = context.Current;

            if (current == null || current.ModelType != Type867Types.Header)
            {
                throw new InvalidOperationException();
            }

            var header = current as Type867Header;

            if (header == null)
            {
                throw new InvalidOperationException();
            }

            context.Qualifier = marketFields.AtIndex(2);
            context.Quantity  = marketFields.AtIndex(3);
            context.Uom       = marketFields.AtIndex(4);

            var model = new Type867AccountBillQty
            {
                Qualifier = context.Qualifier,
                Quantity  = context.Quantity,
                UOM       = context.Uom,
                BeginDate = context.R05ServicePeriodBeginDate,
                EndDate   = context.R05ServicePeriodEndDate
            };

            header.AddAccountBillQuantity(model);
        }
Ejemplo n.º 2
0
        public int InsertAccountBillQuanity(Type867AccountBillQty model)
        {
            using (var connection = new SqlConnection(_connectionString))
                using (var command = connection.CreateCommand("csp867AccountBill_QuantityInsert"))
                {
                    SqlParameter keyParameter;

                    command.AddWithValue("@867_Key", model.HeaderKey)
                    .AddIfNotEmptyOrDbNull("@Qualifier", model.Qualifier)
                    .AddIfNotEmptyOrDbNull("@Quantity", model.Quantity)
                    .AddIfNotEmptyOrDbNull("@UOM", model.UOM)
                    .AddIfNotEmptyOrDbNull("@BeginDate", model.BeginDate)
                    .AddIfNotEmptyOrDbNull("@EndDate", model.EndDate)
                    .AddOutParameter("@AccountBill_Quantity_Key", SqlDbType.Int, out keyParameter);

                    if (connection.State != ConnectionState.Open)
                    {
                        connection.Open();
                    }

                    command.ExecuteNonQuery();

                    if (keyParameter.Value == null)
                    {
                        throw new Exception();
                    }

                    var key = (int)keyParameter.Value;
                    model.AccountBillQtyKey = key;

                    return(key);
                }
        }
Ejemplo n.º 3
0
 public int InsertAccountBillQuanity(Type867AccountBillQty model)
 {
     return(-1);
 }