Пример #1
0
        protected override void New()
        {
            TransactionDefinition td = (TransactionDefinition)request.TransactionEntityList[0];

            td.CreateDate  = DateTime.Now;
            td.CreatedUser = Context.UserName;

            if (TransactionCache.Instance.Get(td.TranCode, false) != null)
            {
                throw new Exception(string.Format("Trancode `{0}` exists", td.TranCode));
            }

            SpCall spCall = new SpCall("COR.TRANSACTION_DEFINITION_INSERT");

            spCall.SetVarchar("@TRAN_CODE", td.TranCode);
            spCall.SetVarchar("@TRAN_DESCRIPTION", td.TranDescription);
            spCall.SetBit("@IS_CANCELLABLE", td.IsCancellable);

            spCall.SetInt("@MENU_ID", td.MenuId);
            spCall.SetVarchar("@GROUP_CODE", td.GroupCode);
            spCall.SetBit("@QB_RELATED", td.IsQbRelated);
            spCall.SetVarchar("@CODE_BASE", td.CodeBase);
            spCall.SetDateTime("@CREATE_DATE", td.CreateDate);
            spCall.SetVarchar("@CREATE_USER", td.CreatedUser);

            long id = db.ExecuteScalar <long>(spCall);

            td.Id = id;
            Context.TransactionObject = td;
        }
Пример #2
0
        public void InsertNewItem(MaestroUnitType item)
        {
            SpCall call = new SpCall("DAT.UNIT_TYPE_INSERT");

            call.SetVarchar("@UNIT_TYPE_NAME", item.Name);
            call.SetVarchar("@UNIT_TYPE_DESCRIPTION", item.Description);
            call.SetBit("@CAN_HAVE_UNITS", item.CanHaveUnits);
            call.SetDateTime("@CREATE_DATE", DateTime.Now);
            call.SetVarchar("@CREATE_USER", context.UserName);
            item.Id = db.ExecuteScalar <long>(call);
        }
Пример #3
0
        protected override void Update()
        {
            TransactionDefinition td = (TransactionDefinition)request.TransactionEntityList[0];

            td.UpdateDate  = DateTime.Now;
            td.UpdatedUser = Context.UserName;

            SpCall spCall = new SpCall("COR.TRANSACTION_DEFINITION_UPDATE");

            spCall.SetBigInt("ID", td.Id);
            spCall.SetVarchar("@TRAN_CODE", td.TranCode);
            spCall.SetVarchar("@TRAN_DESCRIPTION", td.TranDescription);
            spCall.SetBit("@IS_CANCELLABLE", td.IsCancellable);
            spCall.SetInt("@MENU_ID", td.MenuId);
            spCall.SetVarchar("@GROUP_CODE", td.GroupCode);
            spCall.SetBit("@QB_RELATED", td.IsQbRelated);
            spCall.SetVarchar("@CODE_BASE", td.CodeBase);
            spCall.SetDateTime("@UPDATE_DATE", td.UpdateDate);
            spCall.SetVarchar("@UPDATE_USER", td.UpdatedUser);
            db.ExecuteNonQuery(spCall);

            Context.TransactionObject = td;
        }
Пример #4
0
        protected override void Update()
        {
            MaestroUnitType item = (MaestroUnitType)request.TransactionEntityList[0];

            Context.TransactionObject = item;
            SpCall call = new SpCall("DAT.UNIT_TYPE_UPDATE");

            call.SetBigInt("@ID", item.Id);
            call.SetVarchar("@UNIT_TYPE_NAME", item.Name);
            call.SetVarchar("@UNIT_TYPE_DESCRIPTION", item.Description);
            call.SetBit("@CAN_HAVE_UNITS", item.CanHaveUnits);
            call.SetDateTime("@UPDATE_DATE", DateTime.Now);
            call.SetVarchar("@UPDATE_USER", Context.UserName);
            db.ExecuteNonQuery(call);
        }
        public List <QuickBooksInvoiceLog> List(DateTime begin, DateTime end, long customerId, string status, long batchId, bool notIntegrated)
        {
            List <QuickBooksInvoiceLog> result = new List <QuickBooksInvoiceLog>();

            SpCall spCall = new SpCall("DAT.QB_INVOICE_LOG_LIST");

            spCall.SetVarchar("@INTEGRATION_STATUS", status);
            spCall.SetDateTime("@INTEGRATION_DATE_BEGIN", begin);
            spCall.SetDateTime("@INTEGRATION_DATE_END", end);
            spCall.SetBigInt("@BATCH_ID", batchId);
            spCall.SetBigInt("@CUSTOMER_ID", customerId);
            spCall.SetBit("@NOT_INTEGRATED", notIntegrated);

            DataSet ds = db.ExecuteDataSet(spCall);

            ds.Tables[0].AsEnumerable().ToList().ForEach(logRow => { result.Add(InitLog(logRow)); });

            return(result);
        }
Пример #6
0
        void UpdateOrderInternal(OrderMaster orderMaster, bool cleanItems)
        {
            orderMaster.UpdateDate = DateTime.Now;

            SpCall spCall = new SpCall("DAT.ORDER_MASTER_UPDATE");

            spCall.SetBigInt("@ID", orderMaster.Id);
            spCall.SetBigInt("@CUSTOMER_ID", orderMaster.Customer.Id);
            spCall.SetDateTime("@ORDER_DATE", orderMaster.OrderDate);
            spCall.SetDateTime("@DELIVERY_DATE", orderMaster.DeliveryDate);
            spCall.SetVarchar("@PAYMENT_TYPE", orderMaster.PaymentType);
            spCall.SetVarchar("@NOTES", orderMaster.Notes);
            spCall.SetVarchar("@ORDER_STATUS", orderMaster.OrderStatus);
            spCall.SetDateTime("@UPDATE_DATE", orderMaster.UpdateDate);
            spCall.SetVarchar("@UPDATE_USER", orderMaster.UpdatedUser);
            spCall.SetBit("@CLEAN_ORDERITEMS", cleanItems);
            spCall.SetBigInt("@SHIP_ADDRESS", orderMaster.ShippingAddressId);
            db.ExecuteNonQuery(spCall);
        }