public static void updateActiveStatus(Guid id, Boolean activeStatus) { DBUtil.updateActiveStatus("product_update_active", id, activeStatus); }
public static void updateDefaultRow(Guid id) { DBUtil.updateDefaultRow("state_update_default", id, "Set as new default item"); }
public static DataTable getRow(Guid ID) { return(DBUtil.getRows("inventorystocklevel_get", ID)); }
public static DataTable getRow(Guid ID) { return(DBUtil.getRows("productstorename_get", ID)); }
public static void updateActiveStatus(Guid id, Boolean activeStatus) { DBUtil.updateActiveStatus("customer_update_active", id, activeStatus); }
public static DataTable getRow(Guid ID) { return(DBUtil.getRows("inventoryitem_get", ID)); }
public static void updateActiveStatus(Guid id, Boolean activeStatus) { DBUtil.updateActiveStatus("gordenitem_update_active", id, activeStatus); }
public static void updateActiveStatus(Guid id, Boolean activeStatus) { DBUtil.updateActiveStatus("lengthunit_update_active", id, activeStatus); }
public static DataTable getRow(Guid ID) { return(DBUtil.getRows("productwidth_get", ID)); }
public static void updateDefaultRow(Guid id) { DBUtil.updateDefaultRow("PettyCashRecordsCategories_update_default", id, "Set as new default item"); }
public static DataTable getRow(Guid ID) { return(DBUtil.getRows("lengthunit_get", ID)); }
public static void updateActiveStatus(Guid id, Boolean activeStatus) { DBUtil.updateActiveStatus("PettyCashRecordsCategories_update_active", id, activeStatus); }
public static DataTable getRow(Guid ID) { return(DBUtil.getRows("CustomerTerms_get", ID)); }
public static bool update(Guid saleID, Guid?Customers_Id, Guid?Vendors_Id, DataTable saleItems, Guid?transportID, decimal shippingCost, string notes) { Sale objOld = new Sale(saleID); DataTable objOldItems = Tools.setDataTablePrimaryKey(SaleItem.getItems(saleID), SaleItem.COL_ID); string customerInfo = objOld.customer_info; //generate log description string log = ""; //update customer/vendor info Customer newCustomer = new Customer(Customers_Id); if (objOld.customer_id != newCustomer.ID) { log = Util.appendChange(log, objOld.Customers_Name, newCustomer.Name, "Customer: '{0}' to '{1}'"); log = Util.appendChange(log, objOld.customer_info, newCustomer.Info, "Info: '{0}' to '{1}'"); } Vendor newVendor = new Vendor(Vendors_Id); if (objOld.Vendors_Id != Vendors_Id) { log = Util.appendChange(log, objOld.Vendors_Name, newVendor.Name, "Vendor: '{0}' to '{1}'"); log = Util.appendChange(log, objOld.customer_info, newVendor.Info, "Info: '{0}' to '{1}'"); } if (Customers_Id != null) { customerInfo = newCustomer.Info; } else { customerInfo = newVendor.Info; } log = ActivityLog.appendChange(log, objOld.TransportName, new Transport(transportID).Name, "Angkutan: '{0}' to '{1}'"); log = ActivityLog.appendChange(log, objOld.ShippingCost.ToString("N2"), shippingCost.ToString("N2"), "Shipping: '{0}' to '{1}'"); log = ActivityLog.appendChange(log, objOld.notes, notes, "Notes: '{0}' to '{1}'"); DataRow row; Guid id; decimal oldAdjustment, newAdjustment; for (int i = saleItems.Rows.Count - 1; i >= 0; i--) { row = saleItems.Rows[i]; id = DBUtil.parseData <Guid>(row, SaleItem.COL_ID); newAdjustment = DBUtil.parseData <decimal>(row, SaleItem.COL_ADJUSTMENT); oldAdjustment = DBUtil.parseData <decimal>(objOldItems.Rows.Find(id), SaleItem.COL_ADJUSTMENT); if (oldAdjustment != newAdjustment) { log = ActivityLog.appendChange(log, oldAdjustment, newAdjustment, "Inventory Item " + DBUtil.parseData <string>(row, SaleItem.COL_BARCODE) + " adjustment: {0:N2} to {1:N2}"); row[SaleItem.COL_ADJUSTMENT] = newAdjustment; } else { //remove if has no change saleItems.Rows.RemoveAt(i); } } if (!string.IsNullOrEmpty(log)) { //format notes if (string.IsNullOrWhiteSpace(notes)) { notes = null; } else { notes = string.Format("{0:MM/dd/yy}-{1}: {2}", DateTime.Now, GlobalData.UserAccount.name, notes); } SqlQueryResult result = DBConnection.query( false, DBConnection.ActiveSqlConnection, QueryTypes.ExecuteNonQuery, "sale_update", new SqlQueryParameter(COL_ID, SqlDbType.UniqueIdentifier, saleID), new SqlQueryParameter(COL_CUSTOMER_ID, SqlDbType.UniqueIdentifier, Util.wrapNullable(Customers_Id)), new SqlQueryParameter(COL_DB_Vendors_Id, SqlDbType.UniqueIdentifier, Util.wrapNullable(Vendors_Id)), new SqlQueryParameter(COL_DB_CUSTOMERINFO, SqlDbType.VarChar, Util.wrapNullable(customerInfo)), new SqlQueryParameter(COL_DB_TRANSPORTID, SqlDbType.UniqueIdentifier, Util.wrapNullable(transportID)), new SqlQueryParameter(COL_DB_SHIPPINGCOST, SqlDbType.Decimal, shippingCost), new SqlQueryParameter(COL_DB_Notes, SqlDbType.VarChar, Util.wrapNullable(notes)) ); if (!result.IsSuccessful) { return(false); } else { ActivityLog.submit(saleID, "Update: " + log); if (saleItems.Rows.Count > 0) { SaleItem.updateItems(getListOfSaleItemsForUpdate(saleID, saleItems)); } } } return(true); }
public static DataTable getRow(Guid ID) { return(DBUtil.getRows("todo_get", ID)); }
/*******************************************************************************************************/ #region DATABASE METHODS private static DataTable getRow(Guid ID) { return(DBUtil.getRows("city_get", ID)); }
public static DataTable getRow(Guid ID) { return(DBUtil.getRows("customersaleadjustment_get", ID)); }
public static void updateActiveStatus(Guid id, Boolean activeStatus) { DBUtil.updateActiveStatus("inventory_update_active", id, activeStatus); }