本文整理汇总了C#中BLL.ReceiveDoc.GetBatchToIssueByUnit方法的典型用法代码示例。如果您正苦于以下问题:C# ReceiveDoc.GetBatchToIssueByUnit方法的具体用法?C# ReceiveDoc.GetBatchToIssueByUnit怎么用?C# ReceiveDoc.GetBatchToIssueByUnit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLL.ReceiveDoc
的用法示例。
在下文中一共展示了ReceiveDoc.GetBatchToIssueByUnit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PopulatePickList
/// <summary>
/// Populates the picklist based on the selected issue configuration
/// </summary>
private void PopulatePickList()
{
var valid = ValidateFields();
if (valid == "true")
{
var iss = new IssueDoc();
var rec = new ReceiveDoc();
var bal = new Balance();
var itmB = new Items();
var DUs = new ReceivingUnits();
var dtIssueConf = new DataTable();
string[] strr = { "No", "Stock Code", "Item Name", "Quantity", "BatchNo", "Expiry Date", "Pack Price", "Total Price",
"ItemId", "RecId", "Unit Price", "No of Pack", "Qty per pack",
"DUSOH", "DUAMC", "Near Expiry", "DURecomended","SOH Left","UnitID" };
foreach (string col in strr)
{
dtIssueConf.Columns.Add(col);
}
DUs.LoadByPrimaryKey(Convert.ToInt32(cboReceivingUnits.EditValue));
double duMax = 0.5;
try
{
duMax = DUs.Max;
}
catch { }
double duMaxDays = duMax * 30;
lblNearExpiryComment.Text = "*Near Expiry means items that has expiry in the next " + duMaxDays.ToString() + " Days.";
DateTime xx = dtIssueDate.Value;
dtIssueDate.CustomFormat = "MM/dd/yyyy";
DateTime dtIss = ConvertDate.DateConverter(dtIssueDate.Text);
dtIssueDate.Value = DateTime.Now;
DateTime dtCurrent = new DateTime();// Convert.ToDateTime(dtIssueDate.Text);
dtCurrent = ConvertDate.DateConverter(dtIssueDate.Text);
dtIssueDate.Value = xx;
dtIssueDate.CustomFormat = "MMM dd,yyyy";
var dtIssueGrid = (DataTable)issueGrid.DataSource;
for (int i = 0; i < dtIssueGrid.Rows.Count; i++)
{
var unitid = Convert.ToInt32(dtIssueGrid.Rows[i]["UnitID"]);
Int64 expAmount = itmB.GetExpiredQtyItemsByID(Convert.ToInt32(dtIssueGrid.Rows[i]["ID"]), Convert.ToInt32(cboStores.EditValue));
Int64 sohQty = 0;
try
{
switch (VisibilitySetting.HandleUnits)
{
case 1:
sohQty = bal.GetSOH(Convert.ToInt32(dtIssueGrid.Rows[i]["ID"]), Convert.ToInt32(cboStores.EditValue), dtIss.Month, dtIss.Year) - expAmount;
break;
case 2:
sohQty = bal.GetSOHByUnit(Convert.ToInt32(dtIssueGrid.Rows[i]["ID"]), Convert.ToInt32(cboStores.EditValue), dtIss.Month, dtIss.Year, unitid) - expAmount;
break;
case 3:
sohQty = bal.GetSOHByUnit(Convert.ToInt32(dtIssueGrid.Rows[i]["ID"]), Convert.ToInt32(cboStores.EditValue), dtIss.Month, dtIss.Year, unitid) - expAmount;
break;
}
}
catch
{
XtraMessageBox.Show("Please check all the information you have input into the form including the issue date.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (sohQty >= Convert.ToInt64(dtIssueGrid.Rows[i]["Requested Qty"]))
{
var itm = new Items();
itm.LoadByPrimaryKey(Convert.ToInt32(dtIssueGrid.Rows[i]["ID"]));
if (itm.IsColumnNull("NeedExpiryBatch"))
{
itm.NeedExpiryBatch = true;
itm.Save();
}
if (itm.NeedExpiryBatch && VisibilitySetting.HandleUnits == 1)
{
_dtRec = rec.GetBatchToIssue(Convert.ToInt32(cboStores.EditValue),
Convert.ToInt32(dtIssueGrid.Rows[i]["ID"]), dtIss);
}
else if (itm.NeedExpiryBatch && VisibilitySetting.HandleUnits == 2)
{
_dtRec = rec.GetBatchToIssueByUnit(Convert.ToInt32(cboStores.EditValue),
Convert.ToInt32(dtIssueGrid.Rows[i]["ID"]), dtIss ,unitid);
}
else if (itm.NeedExpiryBatch && VisibilitySetting.HandleUnits == 3)
{
_dtRec = rec.GetBatchToIssueByUnit(Convert.ToInt32(cboStores.EditValue),
Convert.ToInt32(dtIssueGrid.Rows[i]["ID"]), dtIss, unitid);
}
else
_dtRec = rec.GetSupplyToIssueWithOutBatch(Convert.ToInt32(cboStores.EditValue),
Convert.ToInt32(dtIssueGrid.Rows[i]["ID"]),
dtIssueDate.Value);
//.........这里部分代码省略.........