本文整理汇总了C#中BLL.ReceiveDoc.MoveNext方法的典型用法代码示例。如果您正苦于以下问题:C# ReceiveDoc.MoveNext方法的具体用法?C# ReceiveDoc.MoveNext怎么用?C# ReceiveDoc.MoveNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLL.ReceiveDoc
的用法示例。
在下文中一共展示了ReceiveDoc.MoveNext方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnChangeReceiptConfirmationStatus_Click
private void btnChangeReceiptConfirmationStatus_Click(object sender, EventArgs e)
{
int newReceiptConfirmationStatus = int.Parse(lkReceiptConfirmationStatus.EditValue.ToString());
BLL.ReceiveDoc rd = new ReceiveDoc();
rd.LoadByReceiptID(int.Parse(txtReceiptID.Text));
while (!rd.EOF)
{
ReceiveDocConfirmation rdc = new ReceiveDocConfirmation();
rdc.LoadByReceiveDocID(rd.ID);
rdc.ReceiptConfirmationStatusID = newReceiptConfirmationStatus;
rdc.Save();
rd.MoveNext();
}
XtraMessageBox.Show("Successful!");
}
示例2: GetStandardRRFOrders
public List<Order> GetStandardRRFOrders()
{
var client = new ServiceRRFLookupClient();
var orders = new List<Order>();
var ginfo = new GeneralInfo();
ginfo.LoadAll();
var dataView = gridItemChoiceView.DataSource as DataView;
if (dataView != null)
{
dataView.RowFilter = gridItemChoiceView.ActiveFilterString;
tblRRF = dataView.ToTable();
}
var periods = client.GetCurrentReportingPeriod(ginfo.FacilityID, ginfo.ScmsWSUserName, ginfo.ScmsWSPassword);
var form = client.GetForms(ginfo.FacilityID, ginfo.ScmsWSUserName, ginfo.ScmsWSPassword);
var rrfs = client.GetFacilityRRForm(ginfo.FacilityID, form[0].Id, periods[0].Id, 1, ginfo.ScmsWSUserName, ginfo.ScmsWSPassword);
var formCategories = rrfs.First().FormCategories;
var chosenCategoryBody = formCategories.First(x => x.Id == 1); //TODO:Hard coding to be removed.
var items = chosenCategoryBody.Pharmaceuticals;
var user = new User();
user.LoadByPrimaryKey(MainWindow.LoggedinId);
var order = new Order
{
RequestCompletedDate = DateTime.Now,
OrderCompletedBy = user.FullName,
RequestVerifiedDate = DateTime.Now,
OrderTypeId = STANDARD_ORDER,
SubmittedBy = user.FullName,
SubmittedDate = DateTime.Now,
SupplyChainUnitId = ginfo.FacilityID,
OrderStatus = 1, //TODO: hardcoding
FormId = form[0].Id, //TODO: hardcoding
ReportingPeriodId = periods[0].Id //TODO: hardcoding
};
var details = new List<RRFTransactionService.OrderDetail>();
foreach (DataRow rrfLine in tblRRF.Rows)
{
var detail = new RRFTransactionService.OrderDetail();
var hcmisItemID = Convert.ToInt32(rrfLine["DSItemID"]);
var rrFormPharmaceutical = items.SingleOrDefault(x => x.PharmaceuticalId == hcmisItemID);
if (rrFormPharmaceutical != null && Convert.ToString(rrfLine["Status"]) != "Below EOP")
{
detail.BeginningBalance = Convert.ToInt32(rrfLine["BeginingBalance"]);
detail.EndingBalance = Convert.ToInt32(rrfLine["SOH"]);
detail.QuantityReceived = Convert.ToInt32(rrfLine["Received"]);
detail.QuantityOrdered = Convert.ToInt32(rrfLine["Quantity"]);
detail.LossAdjustment = Convert.ToInt32(rrfLine["LossAdj"]);
detail.ItemId = rrFormPharmaceutical.ItemId;
var rdDoc = new ReceiveDoc();
var disposal = new Disposal();
rdDoc.GetAllWithQuantityLeft(hcmisItemID, _storeID);
disposal.GetLossAdjustmentsForLastRrfPeriod(hcmisItemID, _storeID, periods[0].StartDate,
periods[0].EndDate);
int receiveDocEntries = rdDoc.RowCount;
int disposalEntries = disposal.RowCount;
if (rdDoc.RowCount == 0 && detail.EndingBalance == 0)
detail.Expiries = null;
detail.Expiries = new Expiry[receiveDocEntries];
detail.Adjustments = new Adjustment[disposalEntries];
rdDoc.Rewind();
int expiryAmountTotal = 0;
for (int j = 0; j < receiveDocEntries; j++)
{
var exp = new Expiry
{
Amount = Convert.ToInt32(rdDoc.QuantityLeft)
};
expiryAmountTotal += exp.Amount;
exp.BatchNo = rdDoc.BatchNo;
exp.ExpiryDate = rdDoc.ExpDate;
if(exp.ExpiryDate > periods[0].EndDate.AddDays(ExpiryTreshHold))
exp.Amount = Convert.ToInt32(rdDoc.QuantityLeft);
exp.ExpiryDate = periods[0].EndDate;
detail.Expiries[j] = exp;
rdDoc.MoveNext();
}
disposal.Rewind();
int lossadjamt = 0;
for (int j = 0; j < disposalEntries; j++)
{
var adj = new Adjustment
{
Amount = Convert.ToInt32(disposal.Quantity),
TypeId = 1,
ReasonId = 1
};
//.........这里部分代码省略.........
示例3: GetOrders
//.........这里部分代码省略.........
detail.BeginningBalance = Convert.ToInt32(rrfLine["BeginingBalance"]);
//DaysOutOfStock daysOfStockOut = new DaysOutOfStock() { NumberOfDaysOutOfStock = 1 };
//detail.DaysOutOfStocks.Add(daysOfStockOut);//Convert.ToInt32(rrfLine["DaysOutOfStock"]);
int eBalance = Convert.ToInt32(rrfLine["SOH"]);
detail.EndingBalance = eBalance == 0 ? 1 : eBalance; //To make sure ending balance is not zero.
//detail.ItemId = Convert.ToInt32(rrfLine["ID"]); //Needs to come from the Code column of Items table.
detail.QuantityReceived = Convert.ToInt32(rrfLine["Received"]);
detail.QuantityOrdered = Convert.ToInt32(rrfLine["Quantity"]);
detail.LossAdjustment = Convert.ToInt32(rrfLine["LossAdj"]);
if (rrFormPharmaceutical != null)
detail.ItemId = rrFormPharmaceutical.ItemId;
else
throw new Exception("Item ID Mismatch");
var rdDoc = new ReceiveDoc();
var lossAndAdjustment = new LossAndAdjustment();
rdDoc.GetAllWithQuantityLeft(hcmisItemID, _storeID);
lossAndAdjustment.GetLossAdjustmentsForLastRRFPeriod(hcmisItemID, _storeID, periods[0].StartDate,
periods[0].EndDate);
int receiveDocEntries = rdDoc.RowCount;
int disposalEntries = lossAndAdjustment.RowCount;
rdDoc.Rewind();
for (var j = 0; j < receiveDocEntries; j++)
{
var exp = new Expiry
{
Amount = Convert.ToInt32(rdDoc.QuantityLeft),
BatchNo = rdDoc.BatchNo,
ExpiryDate = rdDoc.ExpDate
};
detail.Expiries.Add(exp);
rdDoc.MoveNext();
}
lossAndAdjustment.Rewind();
for (var j = 0; j < disposalEntries; j++)
{
var adj = new Adjustment
{Amount = Convert.ToInt32(lossAndAdjustment.Quantity), TypeId = 11, ReasonId = 39};
detail.Adjustments.Add(adj);
lossAndAdjustment.MoveNext();
}
var stockoutIndexedLists = StockoutIndexBuilder.Builder.GetStockOutHistory(hcmisItemID, _storeID);
for (int j = 0; j < stockoutIndexedLists.Count; j++)
{
var dos = new DaysOutOfStock
{
NumberOfDaysOutOfStock = stockoutIndexedLists[j].NumberOfDays,
StockOutReasonId = 5
};
detail.DaysOutOfStocks.Add(dos);
}
details.Add(detail);
}
}
order.OrderDetails = details;
orders.Add(order);
示例4: SaveCostCoefficientAndTotalValue
public void SaveCostCoefficientAndTotalValue(int userID)
{
ReceiveDoc grvFullDetail = new ReceiveDoc();
grvFullDetail.FlushData();
grvFullDetail.LoadAllByReceiptID(GRV.ID);
while (!grvFullDetail.EOF)
{
//Insurance here is costCoefficient
ReceiveDoc receivedoc = new ReceiveDoc();
receivedoc.LoadByPrimaryKey(grvFullDetail.ID);
//Use Custom StoreProcedure for Costing
receivedoc.Insurance = CostCoefficient;
receivedoc.Save();
ReceiveDoc.SetUnitCostByReceiveDoc(grvFullDetail.ID,Math.Round(receivedoc.PricePerPack * CostCoefficient,2),userID);
ReceiveDoc.SetAverageCostByReceiveDoc(grvFullDetail.ID,Math.Round(receivedoc.PricePerPack * CostCoefficient,2),userID);
grvFullDetail.MoveNext();
}
}
示例5: btnFixLocationStuff_Click
private void btnFixLocationStuff_Click(object sender, EventArgs e)
{
int storeID = Convert.ToInt32(lkStoreLocation.EditValue);
BLL.ReceiveDoc rd = new BLL.ReceiveDoc();
rd.LoadReceivesForStores(storeID);
while(!rd.EOF)
{
BLL.ReceivePallet rp = new BLL.ReceivePallet();
rp.LoadByReceiveDocID(rd.ID);
decimal receivedQuantity = 0, balance = 0;
if (rp.RowCount==1)// rp.RowCount > 0)
{
while (!rp.EOF)
{
receivedQuantity += rp.IsColumnNull("ReceivedQuantity") ? 0 : rp.ReceivedQuantity;
balance += rp.IsColumnNull("Balance") ? 0 : rp.Balance;
rp.MoveNext();
}
rp.Rewind();
while (!rp.EOF && rp.IsColumnNull("ReceivedQuantity"))
{
rp.MoveNext();
}
if (rd.Quantity != receivedQuantity && rd.Quantity > receivedQuantity)
{
rp.ReceivedQuantity += (rd.Quantity - receivedQuantity);
}
if (rd.QuantityLeft != balance && rd.QuantityLeft > 0)//rd.QuantityLeft > balance)
{
rp.Balance += (rd.QuantityLeft - balance);
}
rp.Save();
}
rd.MoveNext();
}
XtraMessageBox.Show("Completed!");
}
示例6: SaveReceive
//.........这里部分代码省略.........
mergedDataTable = mergedDataTable == null ? shortageOrDamage.Select(string.Format("[Pack Qty] >= 0 "), "[ShortageReasonID] ASC ").CopyToDataTable() : shortageOrDamage;
}
}
foreach (DataRowView dr in mergedDataTable.DefaultView)
{
var shortageReasonID = dr["ShortageReasonID"];
var onlyOneEntryFound = _dtRecGrid.Select(String.Format("GUID = '{0}'", dr["GUID"]));
bool zeroQtyDueTomultipleBatchFound = (Convert.ToDecimal(dr["Pack Qty"]) == 0) && (shortageReasonID == DBNull.Value) && (onlyOneEntryFound.Count() == 1);
bool fullNotReceivedEntry = (Convert.ToDecimal(dr["BU Qty"]) == 0) && (shortageReasonID != DBNull.Value) && (Convert.ToInt32(shortageReasonID) == ShortageReasons.Constants.NOT_RECEIVED) && (onlyOneEntryFound.Count() == 1);
if (fullNotReceivedEntry)
{
dr["Pack Qty"] = 0;
}
var item = new Item();
item.LoadByPrimaryKey(Convert.ToInt32(dr["ID"]));
if (item.NeedExpiryBatch || (shortageReasonID == DBNull.Value && ((dr["Expiry Date"] != DBNull.Value) && (Convert.ToDateTime(dr["Expiry Date"]) <= DateTimeHelper.ServerDateTime))))
{
var expDate = Convert.ToDateTime(dr["Expiry Date"]);
if ((shortageReasonID == DBNull.Value && expDate > DateTimeHelper.ServerDateTime) || zeroQtyDueTomultipleBatchFound)
{
AddNewReceiveDoc(rec, receiptID, dr);
}
else
{
//for physically Damaged receives and expired receives
if ((shortageReasonID != DBNull.Value && Convert.ToInt32(shortageReasonID) == ShortageReasons.Constants.DAMAGED) || (shortageReasonID == DBNull.Value && expDate <= DateTimeHelper.ServerDateTime) || fullNotReceivedEntry)
{
AddNewReceiveDoc(rec, receiptID, dr, true);
if (shortageReasonID == DBNull.Value)
{
dr["ShortageReasonID"] = ShortageReasons.Constants.DAMAGED;
}
}
else
{
HandleReceiveDocShortage(dr, rec);
}
}
}
else
{
if ((shortageReasonID == DBNull.Value) || zeroQtyDueTomultipleBatchFound)
{
AddNewReceiveDoc(rec, receiptID, dr);
}
else
{
//for physically Damaged receives
if (shortageReasonID != DBNull.Value && Convert.ToInt32(shortageReasonID) == ShortageReasons.Constants.DAMAGED || fullNotReceivedEntry)
{
AddNewReceiveDoc(rec, receiptID, dr, true);
}
else
{
HandleReceiveDocShortage(dr, rec);
}
}
}
}
rec.SetStatusAsReceived(CurrentContext.UserId);
BLL.Receipt receiptStatus = new BLL.Receipt();
receiptStatus.LoadByPrimaryKey(receiptID);
receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.RECEIVE_ENTERED, null,
this.GetFormIdentifier(), CurrentContext.UserId, "Received");
if (!BLL.Settings.HandleGRV) //If HandleGRV is true, the price isn't entered in the receive stage meaning
{
rec.Rewind();
while (!rec.EOF)
{
if (!ReceiveDoc.DoesPriceNeedToBeChanged(rec.StoreID, rec.ItemID, rec.UnitID, rec.ManufacturerId) &&
(deliveryNoteType == DeliveryNoteType.NotSet))
{
rec.SellingPrice = rec.Cost;
rec.UnitCost = Convert.ToDecimal(rec.Cost);
// Added by Heny In order to display Unit Cost on Vaccine
rec.Margin = 0;
}
rec.MoveNext();
}
}
rec.Save(); //TODO: To be removed after the ShortageReasonID in receviedoc is discontinued.
//SavePalletization(rdDamaged);
_revDocRelatePalletGuid.Clear();
}
示例7: SetPriceForReceiveDocs
public void SetPriceForReceiveDocs()
{
ReceiveDoc receiveDoc = new ReceiveDoc();
receiveDoc.LoadbyItemUnitManufacturerMovingAverageID(ReceiptID.Value,ItemID,ItemUnitID,ManufacturerID,MovingAverageID);
receiveDoc.Rewind();
while (!receiveDoc.EOF)
{
if(receiveDoc.IsColumnNull("PricePerPack") || !(receiveDoc.PricePerPack > 0))
receiveDoc.PricePerPack = AverageCost;
if(receiveDoc.IsColumnNull("UnitCost") || !(receiveDoc.PricePerPack > 0))
receiveDoc.UnitCost = Convert.ToDecimal(AverageCost);
receiveDoc.Cost = AverageCost;
receiveDoc.Margin = Margin;
receiveDoc.SellingPrice = SellingPrice;
receiveDoc.MoveNext();
}
receiveDoc.Save();
}
示例8: btnCancelReceive_Click
private void btnCancelReceive_Click(object sender, EventArgs e)
{
if (XtraMessageBox.Show(DevExpress.LookAndFeel.UserLookAndFeel.Default, "Are you sure, you want to Cancel the Receipt Document?", "Are you sure:", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == System.Windows.Forms.DialogResult.Yes)
{
try
{
int receiptID = Convert.ToInt32(gridReceiveView.GetFocusedDataRow()["ReceiptID"].ToString());
var receiveDoc = new ReceiveDoc();
receiveDoc.LoadByReceiptID(receiptID);
receiveDoc.Rewind();
while (!receiveDoc.EOF)
{
BLL.ReceiveDoc.DeleteAReceiveDocEntry(receiveDoc.ID, CurrentContext.UserId);
receiveDoc.MoveNext();
}
XtraMessageBox.Show("You have successfully canceled the draft receipt.", "Confirmation");
BindFormContents();
}
catch (Exception exception)
{
XtraMessageBox.Show(exception.Message);
}
}
}
示例9: ConfirmQuantityAndLocation
private void ConfirmQuantityAndLocation()
{
MyGeneration.dOOdads.TransactionMgr transaction = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr();
transaction.BeginTransaction();
try
{
PalletLocation pl = new PalletLocation();
DataRow dr = gridReceiveView.GetFocusedDataRow();
if (dr == null)
{
throw new Exception("Nothing to confirm!");
}
int ReceiptID = Convert.ToInt32(gridReceiveView.GetFocusedDataRow()["ReceiptID"]);
if (gridDetailView.DataSource == null)
return;
BLL.ReceiveDoc receiveDoc = new ReceiveDoc();
receiveDoc.LoadByReceiptIDWithReceivePallet(ReceiptID);
while (!receiveDoc.EOF)
{
int palletLocationID = Convert.ToInt32(receiveDoc.GetColumn("PalletLocationID"));
pl.LoadByPrimaryKey(palletLocationID);
pl.Confirmed = true;
pl.Save();
receiveDoc.MoveNext();
}
BLL.ReceiveDoc recDoc = new ReceiveDoc();
recDoc.LoadByReceiptID(ReceiptID);
recDoc.ConfirmQuantityAndLocation(CurrentContext.UserId);
BLL.Receipt receiptStatus = new BLL.Receipt();
receiptStatus.LoadByPrimaryKey(ReceiptID);
receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.RECEIVE_QUANTITY_CONFIRMED, null, this.GetFormIdentifier(), CurrentContext.UserId, "Receive Confirmed");
transaction.CommitTransaction();
XtraMessageBox.Show("Receipt Confirmed!", "Success", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
BindFormContents();
}
catch (Exception exp)
{
transaction.RollbackTransaction();
XtraMessageBox.Show(exp.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}