public void InsertNewItem(MaestroProduct product) { SpCall call = new SpCall("DAT.PRODUCT_INSERT"); call.SetVarchar("@PRODUCT_NAME", product.Name); call.SetVarchar("@PRODUCT_DESCRIPTION", product.Description); call.SetVarchar("@QB_PRODUCT_ID", product.QuickBooksProductId); call.SetDecimal("@PRICE", product.Price); call.SetInt("@MINIMUM_ORDER_QUANTITY", product.MinimumOrderQuantity); call.SetBigInt("@UNIT_TYPE_ID", product.UnitType.Id); call.SetBigInt("@PRODUCT_GROUP_ID", product.GroupId); call.SetDecimal("@COST_BASE", product.CostBase); call.SetDateTime("@CREATE_DATE", product.CreateDate); call.SetVarchar("@CREATE_USER", product.CreatedUser); product.Id = db.ExecuteScalar <long>(call); }
public void UpdateOrderItem(OrderItem item) { item.UpdateDate = DateTime.Now; item.UpdatedUser = context.UserName; SpCall spCall = new SpCall("DAT.ORDER_ITEM_UPDATE"); spCall.SetBigInt("@ID", item.Id); spCall.SetBigInt("@ORDER_ID", item.OrderId); spCall.SetBigInt("@PRODUCT_ID", item.Product.Id); spCall.SetInt("@QUANTITY", item.Quantity); spCall.SetBigInt("@UNIT_ID", item.Unit.Id); spCall.SetBigInt("@QB_PRODUCT_MAP_ID", item.QbProductMap.Id); spCall.SetDecimal("@PRICE", item.Price); spCall.SetDateTime("@UPDATE_DATE", item.UpdateDate); spCall.SetVarchar("@UPDATE_USER", context.UserName); spCall.SetDecimal("@AMOUNT", item.Amount); db.ExecuteNonQuery(spCall); }
public void Update(MaestroProduct product) { SpCall call = new SpCall("DAT.PRODUCT_UPDATE"); call.SetBigInt("@ID", product.Id); call.SetVarchar("@PRODUCT_NAME", product.Name); call.SetVarchar("@PRODUCT_DESCRIPTION", product.Description); call.SetVarchar("@QB_PRODUCT_ID", product.QuickBooksProductId); call.SetDecimal("@PRICE", product.Price); call.SetInt("@MINIMUM_ORDER_QUANTITY", product.MinimumOrderQuantity); call.SetBigInt("@UNIT_TYPE_ID", product.UnitType.Id); call.SetBigInt("@PRODUCT_GROUP_ID", product.GroupId); call.SetDecimal("@COST_BASE", product.CostBase); call.SetDateTime("@UPDATE_DATE", DateTime.Now); call.SetVarchar("@UPDATE_USER", context.UserName); db.ExecuteNonQuery(call); }
public void InsertTransactionLog(TransactionLog tranLog) { SpCall call = new SpCall("COR.TRANSACTION_LOG_INSERT"); call.SetVarchar("@TRAN_CODE", tranLog.TransactionCode); call.SetBinary("@TRANSACTION_LOG", tranLog.Log); call.SetVarchar("@TRANSACTION_JSON", tranLog.LogJson); call.SetVarchar("@TRANSACTION_STATUS", tranLog.Status); call.SetBigInt("@TRANSACTION_OBJECT_ID", tranLog.LogObjectId); call.SetVarchar("@ACTION_TYPE", tranLog.ActionType); call.SetVarchar("@REQUEST_TYPE", tranLog.RequestType); call.SetDateTime("@CREATE_DATE", DateTime.Now); call.SetVarchar("@CREATE_USER", tranLog.CreatedUser); call.SetDecimal("@DURATION", tranLog.Duration); long id = db.ExecuteScalar <long>(call); tranLog.Id = id; }
public void Update(QuickBooksProductMapDef map) { SpCall call = new SpCall("DAT.QB_PRODUCT_MAP_UPDATE"); call.SetBigInt("@ID", map.Id); call.SetBigInt("@PRODUCT_ID", map.Product.Id); call.SetVarchar("@QB_CODE", map.QuickBooksCode); call.SetVarchar("@QB_LIST_ID", map.QuickBooksListId); call.SetVarchar("@QB_PARENT_CODE", map.QuickBooksParentCode); call.SetVarchar("@QB_PARENT_LIST_ID", map.QuickBooksParentListId); call.SetVarchar("@QB_DESCRIPTION", map.QuickBooksDescription); call.SetBigInt("@UNIT_ID", map.Unit.Id); call.SetDecimal("@PRICE", map.Price); call.SetDateTime("@UPDATE_DATE", DateTime.Now); call.SetVarchar("@UPDATE_USER", context.UserName); call.SetVarchar("@REPORT_LABEL", map.Label); db.ExecuteNonQuery(call); }
protected override void New() { Entity.QuickBooksProductMapDef map = (Entity.QuickBooksProductMapDef)request.TransactionEntityList[0]; SpCall call = new SpCall("DAT.QB_PRODUCT_MAP_INSERT"); call.SetBigInt("@PRODUCT_ID", map.Product.Id); call.SetVarchar("@QB_CODE", map.QuickBooksCode); call.SetVarchar("@QB_LIST_ID", map.QuickBooksListId); call.SetVarchar("@QB_PARENT_CODE", map.QuickBooksParentCode); call.SetVarchar("@QB_PARENT_LIST_ID", map.QuickBooksParentListId); call.SetVarchar("@QB_DESCRIPTION", map.QuickBooksDescription); call.SetBigInt("@UNIT_ID", map.Unit.Id); call.SetDecimal("@PRICE", map.Price); call.SetDateTime("@CREATE_DATE", DateTime.Now); call.SetVarchar("@CREATE_USER", Context.UserName); call.SetVarchar("@REPORT_LABEL", map.Label); map.Id = db.ExecuteScalar <long>(call); response.TransactionResult = map; }
void InsertExecutionLog(DateTime startDate) { DateTime endDate = DateTime.Now; double duration = endDate.Subtract(startDate).TotalMilliseconds; OnLogEventHandler(string.Format("Inserting execution log for Task `{0}`, duration:{1} miliseconds", taskName, duration), null); using (Database db = new Database()) { SpCall call = new SpCall("COR.TASK_SCHEDULER_LOG_INSERT"); call.SetVarchar("@TASK_NAME", taskName); call.SetDateTime("@START_DATE", startDate); call.SetDateTime("@END_DATE", endDate); call.SetInt("@INTERVALL", intervall); call.SetVarchar("@INTERVALL_UNIT", intervallUnit.ToString()); call.SetDecimal("@DURATION", Convert.ToDecimal(duration)); call.SetDateTime("@CREATE_DATE", DateTime.Now); db.ExecuteNonQuery(call); } this.lastExecution = endDate; }