本文整理汇总了C#中BLL.ReceiveDoc.SetColumn方法的典型用法代码示例。如果您正苦于以下问题:C# ReceiveDoc.SetColumn方法的具体用法?C# ReceiveDoc.SetColumn怎么用?C# ReceiveDoc.SetColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLL.ReceiveDoc
的用法示例。
在下文中一共展示了ReceiveDoc.SetColumn方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ComputeStockCalculationsForAnOrderDetail
/// <summary>
/// Computes the stock calculations for an order detail.
/// </summary>
/// <param name="currentMonth">The current month.</param>
/// <param name="currentYear">The current year.</param>
/// <param name="userID">The user ID.</param>
/// <param name="orderDetail">The order detail.</param>
/// <returns></returns>
public DataRow ComputeStockCalculationsForAnOrderDetail(int currentMonth, int currentYear, int userID, OrderDetail orderDetail)
{
if (!IsOrderDetailTableReady(orderDetail))
{
PrepareOrderDetailTable(orderDetail);
}
int? preferredManufacturer;
int? preferredPhysicalStoreID;
decimal usableStock;
decimal approved;
decimal availableQuantity;
Balance bal = new Balance();
ItemManufacturer imf = new ItemManufacturer();
int? unitid = null;
PriceSettings priceSettings = BLL.Settings.HandleDeliveryNotes ? PriceSettings.BOTH : PriceSettings.PRICED_ONLY;
BLL.Order parentOrder = new Order();
parentOrder.LoadByPrimaryKey(orderDetail.OrderID);
unitid = orderDetail.UnitID;
preferredManufacturer = orderDetail.IsColumnNull("PreferredManufacturerID") ? null : new int?(orderDetail.PreferredManufacturerID);
preferredPhysicalStoreID = orderDetail.IsColumnNull("PreferredPhysicalStoreID") ? null : new int?(orderDetail.PreferredPhysicalStoreID);
if (orderDetail.IsColumnNull("StoreID"))
{
orderDetail.StoreID = BLL.Activity.GetActivityUsingFEFO(this.FromStore, orderDetail.ItemID, orderDetail.UnitID);
orderDetail.Save();
}
Activity storeObject = new Activity();
availableQuantity = storeObject.LoadOptionsForOrderDetail(userID, orderDetail.ID, priceSettings, bal, false, out usableStock, out approved);
orderDetail.SetColumn("AvailableStores", storeObject.DefaultView);
if (storeObject.RowCount == 1)
{
orderDetail.StoreID = storeObject.ID;
// Avoid error if the column IsDeliveryNote doesn't exsit at all.
orderDetail.DeliveryNote = storeObject.DefaultView.Table.Columns.IndexOf("IsDeliveryNote") >= 0 &&
!storeObject.IsColumnNull("IsDeliveryNote") &&
Convert.ToBoolean(storeObject.GetColumn("IsDeliveryNote"));
availableQuantity = Convert.ToDecimal(storeObject.GetColumn("AvailableSKU"));
}
else if (storeObject.RowCount > 1)
{
//TOCLEAN: Lord have mercy.
//
// check if the default activity is selected
// if it has been selected, then do a good job and select it.
storeObject.Rewind();
while (
!storeObject.EOF
&&
(
(
storeObject.ID == orderDetail.StoreID
&& !orderDetail.IsColumnNull("DeliveryNote")
&& orderDetail.DeliveryNote
&& !Convert.ToBoolean(storeObject.GetColumn("IsDeliveryNote"))
)
||
storeObject.ID != orderDetail.StoreID
)
)
{
storeObject.MoveNext();
}
// the selected store is found, don't worry.
if (!storeObject.EOF)
{
availableQuantity = Convert.ToDecimal(storeObject.GetColumn("AvailableSKU"));
}
else
{
// the selected store is not found, please do select the first store.
storeObject.Rewind();
orderDetail.StoreID = storeObject.ID;
orderDetail.DeliveryNote = (storeObject.DefaultView.Table.Columns.IndexOf("IsDeliveryNote") >= 0 &&
!storeObject.IsColumnNull("IsDeliveryNote") &&
Convert.ToBoolean(storeObject.GetColumn("IsDeliveryNote")));
availableQuantity = Convert.ToDecimal(storeObject.GetColumn("AvailableSKU"));
}
}
orderDetail.SetColumn("HasStores", (storeObject.RowCount > 1) ? "*" : "");
// Precaution ... to hide -ve available quantity.
if (availableQuantity < 0)
{
availableQuantity = 0;
//.........这里部分代码省略.........
示例2: FillInReceiveDocInformation
/// <summary>
/// Needs to be the first function to be called when saving a new receive doc entry.
/// </summary>
/// <param name="rec"></param>
/// <param name="receiptID"></param>
/// <param name="dr"></param>
private void FillInReceiveDocInformation(ReceiveDoc rec, int receiptID, DataRowView dr)
{
try
{
rec.GetColumn("GUID");
}
catch
{
rec.AddColumn("GUID", typeof(string));
//rec.AddColumn("IsDamaged", typeof(bool));
//This is only used if the Check box is used to receive damaged receives (For SRM only)
}
rec.StoreID = Convert.ToInt32(lkAccounts.EditValue);
rec.RefNo = txtRefNo.Text;
rec.Remark = txtRemark.Text;
rec.ReceivedBy = CurrentContext.LoggedInUserName;
DateTime xx = dtRecDate.Value;
dtRecDate.CustomFormat = "MM/dd/yyyy";
DateTime dtRec = new DateTime();
rec.Date = ConvertDate.DateConverter(dtRecDate.Text);
dtRec = ConvertDate.DateConverter(dtRecDate.Text);
rec.EurDate = BLL.DateTimeHelper.ServerDateTime;
rec.ItemID = Convert.ToInt32(dr["ID"]);
rec.NoOfPack = Convert.ToDecimal(dr["Pack Qty"]);
rec.SetColumn("GUID", dr["GUID"].ToString());
rec.IsDamaged = Convert.ToBoolean(dr["IsDamaged"]);
if (standardRecType == StandardReceiptType.iGRVOnline)
{
rec.SetColumn("PricePerPack", dr["Price/Pack"]);
rec.SetColumn("Margin", dr["Margin"]);
rec.SetColumn("UnitCost", dr["Price/Pack"]);
}
//TODO: This if is a garbage. Remove
if (dr["InvoicedQty"] == DBNull.Value)
{
rec.InvoicedNoOfPack = rec.NoOfPack;
}
rec.InvoicedNoOfPack = srm ? Convert.ToDecimal(dr["IssuedQty"]) : Convert.ToDecimal(dr["OriginalInvoicedQty"]);
rec.ManufacturerId = Convert.ToInt32(dr["Manufacturer"]);
BLL.ItemManufacturer im = new BLL.ItemManufacturer();
im.LoadIMbyLevel(rec.ItemID, rec.ManufacturerId, 0);
if (dr["UnitID"] != DBNull.Value)
{
// if unit has been set, pick the qty per pack from the unit
rec.UnitID = Convert.ToInt32(dr["UnitID"]);
ItemUnit itemUnit = new ItemUnit();
itemUnit.LoadByPrimaryKey(rec.UnitID);
rec.QtyPerPack = itemUnit.QtyPerUnit;
}
else
{
rec.QtyPerPack = im.QuantityInBasicUnit;
}
rec.Quantity = rec.QuantityLeft = rec.NoOfPack * rec.QtyPerPack;
try
{
if ((deliveryNoteType == DeliveryNoteType.NotSet))
{
if (!BLL.Settings.HandleGRV && !srm)
{
rec.PricePerPack = Convert.ToDouble(dr["Price/Pack"]);
double pre = (Convert.ToDouble(dr["Price/Pack"]) / 1); //rec.QtyPerPack);
rec.Cost = pre;
}
rec.DeliveryNote = false;
}
else
{
rec.DeliveryNote = true;
if (deliveryNoteType == DeliveryNoteType.Automatic)
{
rec.SetColumn("PricePerPack", dr["Price/Pack"]);
rec.SetColumn("Margin", dr["Margin"]);
rec.SetColumn("UnitCost", dr["Price/Pack"]);
}
}
}
catch
{
// catch the error if the recieve doesn't have cost information
// NOTE: this shall never happen.
}
if (dr["Batch No"] != DBNull.Value)
//.........这里部分代码省略.........