public static void delete(Guid id) { InventoryStockLevel obj = new InventoryStockLevel(id); //generate log description string logDescription = ""; logDescription = Tools.append(logDescription, String.Format("Product Store Name: '{0}'", obj.ProductStoreName), ","); logDescription = Tools.append(logDescription, String.Format("Grade: '{0}'", obj.GradeName), ","); logDescription = Tools.append(logDescription, String.Format("Product Width: '{0}'", obj.ProductWidthName), ","); logDescription = Tools.append(logDescription, String.Format("Length Unit: '{0}'", obj.LengthUnitName), ","); logDescription = Tools.append(logDescription, String.Format("Vendor: '{0}'", obj.VendorName), ","); logDescription = Tools.append(logDescription, String.Format("Qty: '{0}'", obj.Qty), ","); logDescription = Tools.append(logDescription, String.Format("PO Notes: '{0}'", obj.PONotes), ","); logDescription = Tools.append(logDescription, String.Format("Notes: '{0}'", obj.Notes), ","); SqlQueryResult result = DBConnection.query( false, DBConnection.ActiveSqlConnection, QueryTypes.ExecuteNonQuery, "inventorystocklevel_delete", new SqlQueryParameter(COL_DB_ID, SqlDbType.UniqueIdentifier, id) ); if (result.IsSuccessful) { ActivityLog.submit(id, String.Format("Deleted: {0}", logDescription)); } }
private void populatePageData() { DataTable dtReceivables; if (GlobalData.UserAccount.role == Roles.User) { dtReceivables = Sale.get_ReceivablesOnly(true); } else { dtReceivables = Sale.get_ReceivablesOnly(false); } Util.setGridviewDataSource(gridReceivables, dtReceivables); gridReceivables.Sort(col_gridReceivables_RemainingTermDays, ListSortDirection.Ascending); lblTotalDaftarPiutang.Text = string.Format("{0:N0}", LIBUtil.Util.compute(dtReceivables, "SUM", Sale.COL_RECEIVABLEAMOUNT, "")); populateReceivablesSummary(dtReceivables); populateIncompletePO(); Util.setGridviewDataSource(gridStockLevel, InventoryStockLevel.getAll(null, null, null, null, null, null, true)); }
public static void update(Guid id, Guid gradeID, Guid productID, Guid productWidthID, Guid lengthUnitID, Guid colorID, int qty, int orderLotQty, string poNotes, string notes) { InventoryStockLevel objOld = new InventoryStockLevel(id); //generate log description string logDescription = ""; Product product = new Product(productID); if (objOld.ProductStoreNameID != product.StoreNameID) { logDescription = Tools.append(logDescription, String.Format("Product Store Name: '{0}' to '{1}'", objOld.ProductStoreName, product.StoreName), ","); } if (objOld.GradeID != gradeID) { logDescription = Tools.append(logDescription, String.Format("Grade: '{0}' to '{1}'", objOld.GradeID, new Grade(gradeID).Name), ","); } if (objOld.ProductWidthID != productWidthID) { logDescription = Tools.append(logDescription, String.Format("Product Width: '{0}' to '{1}'", objOld.ProductWidthName, new ProductWidth(productWidthID).Name), ","); } if (objOld.LengthUnitID != lengthUnitID) { logDescription = Tools.append(logDescription, String.Format("Length Unit: '{0}' to '{1}'", objOld.LengthUnitID, new LengthUnit(lengthUnitID).Name), ","); } if (objOld.VendorName != product.VendorName) { logDescription = Tools.append(logDescription, String.Format("Vendor: '{0}' to '{1}'", objOld.VendorName, product.VendorName), ","); } if (objOld.OrderLotQty != orderLotQty) { logDescription = Tools.append(logDescription, String.Format("Lot qty: '{0}' to '{1}'", objOld.OrderLotQty, orderLotQty), ","); } if (objOld.Qty != qty) { logDescription = Tools.append(logDescription, String.Format("Qty: '{0}' to '{1}'", objOld.Qty, qty), ","); } if (objOld.PONotes != poNotes) { logDescription = Tools.append(logDescription, String.Format("PO Notes: '{0}' to '{1}'", objOld.PONotes, poNotes), ","); } if (objOld.Notes != notes) { logDescription = Tools.append(logDescription, String.Format("Notes: '{0}' to '{1}'", objOld.Notes, notes), ","); } if (!string.IsNullOrEmpty(logDescription)) { SqlQueryResult result = DBConnection.query( false, DBConnection.ActiveSqlConnection, QueryTypes.ExecuteNonQuery, "inventorystocklevel_update", new SqlQueryParameter(COL_DB_ID, SqlDbType.UniqueIdentifier, id), new SqlQueryParameter(COL_DB_GRADEID, SqlDbType.UniqueIdentifier, gradeID), new SqlQueryParameter(COL_DB_PRODUCTID, SqlDbType.UniqueIdentifier, productID), new SqlQueryParameter(COL_DB_PRODUCTWIDTHID, SqlDbType.UniqueIdentifier, productWidthID), new SqlQueryParameter(COL_DB_LENGTHUNITID, SqlDbType.UniqueIdentifier, lengthUnitID), new SqlQueryParameter(COL_DB_COLORID, SqlDbType.UniqueIdentifier, colorID), new SqlQueryParameter(COL_DB_ORDERLOTQTY, SqlDbType.Int, orderLotQty), new SqlQueryParameter(COL_DB_QTY, SqlDbType.Int, qty), new SqlQueryParameter(COL_DB_PONOTES, SqlDbType.VarChar, Util.wrapNullable(poNotes)), new SqlQueryParameter(COL_DB_NOTES, SqlDbType.VarChar, Util.wrapNullable(notes)) ); if (result.IsSuccessful) { ActivityLog.submitUpdate(id, logDescription); } } }