public static DataView GetStockOutReport(int orderId) { var query = HCMIS.Repository.Queries.OrderDetail.SelectStockOutDetail(orderId); var orderDetail = new OrderDetail(); orderDetail.LoadFromRawSql(query); return(orderDetail.DefaultView); }
/// <summary> /// This function gives the previous order from the one specified in the parameter /// </summary> /// <param name="orderId">The order that gets returned is going to be the one just previous to this order.</param> /// <param name="facilityId">The facility ID</param> /// <returns></returns> public DataTable GetLastOrderDetailByFacility(int orderId, int facilityId) { var query = HCMIS.Repository.Queries.OrderDetail.SelectLastOrderDetailByFacility(orderId, facilityId); this.LoadFromRawSql(query); this.AddColumn("LastApprovedQuantity", typeof(decimal)); this.AddColumn("LastRequestedQuantity", typeof(decimal)); this.AddColumn("LastRequestedDate", typeof(DateTime)); while (!this.EOF) { var oDetail = new OrderDetail(); var querylastdetails = HCMIS.Repository.Queries.OrderDetail.SelectQueryLastDetails(this.ItemID, this.UnitID, (int)this.GetColumn("RequestedBy")); oDetail.LoadFromRawSql(querylastdetails); if (oDetail.RowCount > 0) { this.SetColumn("LastApprovedQuantity", oDetail.GetColumn("LastApprovedQuantity")); this.SetColumn("LastRequestedQuantity", oDetail.GetColumn("LastRequestedQuantity")); this.SetColumn("LastRequestedDate", oDetail.GetColumn("LastRequestedDate")); } this.MoveNext(); } return(this.DataTable); }