本文整理汇总了C#中BLL.ReceiveDoc.AddNew方法的典型用法代码示例。如果您正苦于以下问题:C# ReceiveDoc.AddNew方法的具体用法?C# ReceiveDoc.AddNew怎么用?C# ReceiveDoc.AddNew使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLL.ReceiveDoc
的用法示例。
在下文中一共展示了ReceiveDoc.AddNew方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ComputeStockCalculationsForAnOrderDetail
//.........这里部分代码省略.........
//Checking if the columns from the vwGetAllItems have been filled in.
var fullItemName = orderDetail.GetColumn("FullItemName").ToString();
if (string.IsNullOrEmpty(fullItemName))
{
BLL.Order temp = new Order();
temp.LoadFromRawSql(HCMIS.Repository.Queries.Order.SelectItemDetail(orderDetail.ItemID));
orderDetail.SetColumn("Unit", itemUnit.Text);
orderDetail.SetColumn("FullItemName", temp.GetColumn("FullItemName"));
orderDetail.SetColumn("StockCode", temp.GetColumn("StockCode"));
orderDetail.SetColumn("CategoryType", temp.GetColumn("CategoryType"));
}
}
orderDetail.SetColumn("AvailableQuantity", availableQuantity);
orderDetail.SetColumn("PricedQuantity", usableStock);
if (orderDetail.IsColumnNull("ApprovedQuantity"))
{
if ((orderDetail.Quantity / ((long)qinBu)) < availableQuantity)
{
orderDetail.ApprovedQuantity = orderDetail.Quantity;
}
else
{
orderDetail.ApprovedQuantity = availableQuantity * qinBu;
}
}
if (BLL.Settings.AllowPreferredManufacturers)
{
Manufacturer manuf = new Manufacturer();
manuf.LoadForItem(orderDetail.ItemID, orderDetail.StoreID, orderDetail.UnitID, true);
manuf.AddNew();
manuf.ID = -1;
manuf.Name = "Remove Preference";
orderDetail.SetColumn("AvailableManufacturer", manuf.DefaultView);
orderDetail.SetColumn("HasManufacturers", (manuf.RowCount > 2) ? "*" : "");
if (manuf.RowCount == 2)
{
manuf.Rewind();
orderDetail.PreferredManufacturerID = manuf.ID;
}
}
if (BLL.Settings.AllowPreferredPhysicalStore)
{
PhysicalStore phyStore = new PhysicalStore();
phyStore.LoadForItem(userID, orderDetail.ItemID, orderDetail.StoreID, orderDetail.UnitID);
phyStore.AddNew();
phyStore.Name = "Remove Preference";
phyStore.ID = -1;
orderDetail.SetColumn("AvailablePhysicalStore", phyStore.DefaultView);
orderDetail.SetColumn("HasPhysicalStoreChoice", (phyStore.RowCount > 2) ? "*" : "");
if (phyStore.RowCount == 2)
{
phyStore.Rewind();
orderDetail.PreferredPhysicalStoreID = phyStore.ID;
}
}
if (BLL.Settings.AllowPreferredExpiry)
{
ReceiveDoc rd = new ReceiveDoc();
示例2: btnSave_Click
private void btnSave_Click(object sender, EventArgs e)
{
var rec = new ReceiveDoc();
var itm = new Items();
var itemprogram = new ProgramProduct();
string valid = ValidateFields();
if (valid == "true")
{
if (
XtraMessageBox.Show("Are you sure you want to save this transaction?", "Confirmation",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
try
{
for (int i = 0; i < dtRecGrid.Rows.Count; i++)
{
if (dtRecGrid.Rows[i]["Expiry Date"] != DBNull.Value)
{
if (Convert.ToDateTime(dtRecGrid.Rows[i]["Expiry Date"]) <= DateTime.Now)
{
var dialog =
XtraMessageBox.Show(
"The item " + dtRecGrid.Rows[i]["Item Name"].ToString() +
" has already expired. Are you sure you want to receive it?", "Warning",
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dialog == DialogResult.No)
{
return;
}
}
}
rec.AddNew();
rec.StoreID = Convert.ToInt32(cboStores.EditValue);
rec.RefNo = txtRefNo.Text.Trim();
rec.Remark = txtRemark.Text;
rec.ReceivedBy = txtReceivedBy.Text;
DateTime xx = dtRecDate.Value;
dtRecDate.CustomFormat = "MM/dd/yyyy";
DateTime dtRec = new DateTime();
rec.Date = ConvertDate.DateConverter(dtRecDate.Text);
dtRec = ConvertDate.DateConverter(dtRecDate.Text);
dtRecDate.IsGregorianCurrentCalendar = true;
rec.EurDate = dtRecDate.Value;
dtRecDate.IsGregorianCurrentCalendar = false;
rec.ItemID = Convert.ToInt32(dtRecGrid.Rows[i][0]);
switch (VisibilitySetting.HandleUnits)
{
case 1:
rec.UnitID = 0;
rec.QtyPerPack = Convert.ToInt32(dtRecGrid.Rows[i]["Qty/Pack"]);
break;
case 2:
rec.UnitID = Convert.ToInt32(dtRecGrid.Rows[i]["UnitID"]);
rec.QtyPerPack = 1;
break;
case 3:
rec.UnitID = Convert.ToInt32(dtRecGrid.Rows[i]["UnitID"]);
rec.QtyPerPack = 1;
break;
}
rec.NoOfPack = Convert.ToInt32(dtRecGrid.Rows[i]["Pack Qty"]);
rec.Quantity = rec.NoOfPack * rec.QtyPerPack;
rec.QuantityLeft = rec.Quantity;
if (dtRecGrid.Rows[i]["Price/Pack"] != null &&
dtRecGrid.Rows[i]["Price/Pack"].ToString() != "")
{
double pre = Convert.ToDouble(dtRecGrid.Rows[i]["Price/Pack"]) / rec.QtyPerPack;
rec.Cost = Convert.ToDouble(pre);
}
else
{
rec.Cost = 0;
}
itm.LoadByPrimaryKey(Convert.ToInt32(dtRecGrid.Rows[i]["ID"]));
rec.BatchNo = dtRecGrid.Rows[i][8].ToString();
if (dtRecGrid.Rows[i]["Expiry Date"] != DBNull.Value)
{
rec.ExpDate = Convert.ToDateTime(dtRecGrid.Rows[i]["Expiry Date"]);
}
rec.SupplierID = Convert.ToInt32(cboSupplier.EditValue);
rec.SubProgramID = Convert.ToInt32(cboProgram.EditValue);
string batch = DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() +
DateTime.Now.Minute.ToString() + rec.ItemID.ToString();
rec.LocalBatchNo = batch;
rec.Out = false;
rec.IsApproved = false;
dtRecDate.Value = xx;
rec.Save();
//.........这里部分代码省略.........
示例3: btnSave_Click
private void btnSave_Click(object sender, EventArgs e)
{
var transfer = new Transfer();
var newreceiveDoc = new ReceiveDoc();
var receiveDoc = new ReceiveDoc();
var issuedoc = new IssueDoc();
var valid = ValidateFields();
if (valid == "true")
{
if (XtraMessageBox.Show("Are you sure you want to save this transaction?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
try{
var dtRecGrid = (DataTable)receivingGrid.DataSource;
for (int i = 0; i < dtRecGrid.Rows.Count; i++)
{
transfer.AddNew();
var receiveid = Convert.ToInt32(dtRecGrid.Rows[i]["RecID"]);
transfer.ItemID = _itemID = Convert.ToInt32(dtRecGrid.Rows[i]["ID"]);
transfer.RecID = receiveid;
transfer.BatchNo = dtRecGrid.Rows[i]["Batch No"].ToString();
transfer.FromStoreID = Convert.ToInt32(lkFromStore.EditValue);
transfer.ToStoreID = Convert.ToInt32(lkToStore.EditValue);
transfer.Quantity = Convert.ToInt64(dtRecGrid.Rows[i]["Qty To Transfer"]);
transfer.RefNo = txtRefNo.Text;
transfer.UnitID = VisibilitySetting.HandleUnits == 1 ? 0 : Convert.ToInt32(dtRecGrid.Rows[i]["UnitID"]);
DateTime xx = dtRecDate.Value;
dtRecDate.CustomFormat = "MM/dd/yyyy";
new DateTime();
transfer.Date = ConvertDate.DateConverter(dtRecDate.Text);
ConvertDate.DateConverter(dtRecDate.Text);
dtRecDate.IsGregorianCurrentCalendar = true;
transfer.EurDate = dtRecDate.Value;
dtRecDate.IsGregorianCurrentCalendar = false;
transfer.TransferReason = txtTransferReason.Text;
transfer.ApprovedBy = txtApprovedBy.Text;
transfer.TransferRequestedBy = txtRequestedBy.Text;
transfer.Save();
transfer.GetTransfered(receiveid, _itemID, Convert.ToInt32(lkFromStore.EditValue));
issuedoc.AddNew();
issuedoc.StoreId = transfer.FromStoreID;
issuedoc.ItemID = transfer.ItemID;
issuedoc.Quantity = transfer.Quantity;
issuedoc.Date = transfer.Date;
issuedoc.BatchNo = transfer.BatchNo;
issuedoc.UnitID = transfer.UnitID;
issuedoc.RecievDocID = transfer.RecID;
issuedoc.IsTransfer = true;
issuedoc.RefNo = transfer.RefNo;
var allstores = new Stores();
allstores.LoadByPrimaryKey(transfer.ToStoreID);
issuedoc.ReceivingUnitID = (int) allstores.GetColumn("ReceivingUnitID");
issuedoc.Save();
receiveDoc.GetReceivedItems(receiveid,_itemID, Convert.ToInt32(lkFromStore.EditValue));
receiveDoc.QuantityLeft = receiveDoc.QuantityLeft - transfer.Quantity;
newreceiveDoc.AddNew();
newreceiveDoc.StoreID = transfer.ToStoreID;
newreceiveDoc.RefNo = transfer.RefNo;
newreceiveDoc.BatchNo = transfer.BatchNo;
newreceiveDoc.ItemID = transfer.ItemID;
newreceiveDoc.Quantity = transfer.Quantity;
newreceiveDoc.QuantityLeft = transfer.Quantity;
newreceiveDoc.NoOfPack = Convert.ToInt32(transfer.Quantity) / receiveDoc.QtyPerPack;
newreceiveDoc.QtyPerPack = receiveDoc.QtyPerPack;
newreceiveDoc.Cost = receiveDoc.Cost;
newreceiveDoc.Date = transfer.Date;
newreceiveDoc.UnitID = transfer.UnitID;
newreceiveDoc.Out = false;
newreceiveDoc.ReceivedBy = transfer.ApprovedBy;
newreceiveDoc.ExpDate = receiveDoc.ExpDate;
allstores.LoadByPrimaryKey(transfer.FromStoreID);
newreceiveDoc.SupplierID = (int) allstores.GetColumn("SupplierID");
newreceiveDoc.BoxLevel = 1;
newreceiveDoc.Save();
receiveDoc.Save();
}
XtraMessageBox.Show("Transaction Successfully Saved!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
ResetFields();
}
catch (Exception exp)
{
XtraMessageBox.Show(exp.InnerException.Message ,"Error");
}
}
}
else
{
XtraMessageBox.Show(valid, "Validation", MessageBoxButtons.OK, MessageBoxIcon.Stop);
}
//.........这里部分代码省略.........
示例4: Clone
//This Creates a Clone of the ReceiveDoc
public ReceiveDoc Clone()
{
var receiveDoc = new ReceiveDoc();
receiveDoc.AddNew();
receiveDoc.DataRow.ItemArray = DataRow.ItemArray;
receiveDoc.DataRow["ID"] = DBNull.Value;
return receiveDoc;
}
示例5: ReceiveFromAccountTransfer
/// <summary>
/// Receives from account transfer.
/// </summary>
/// <param name="PicklistID">The picklist ID.</param>
/// <param name="StoreID">The store ID.</param>
/// <param name="User">The user.</param>
/// <param name="UserID">The user ID.</param>
/// <returns></returns>
public static String ReceiveFromAccountTransfer(int PicklistID, int StoreID, string User, int UserID)
{
PickListDetail pickListDetail = new PickListDetail();
pickListDetail.LoadByPickListID(PicklistID);
DataView dv = pickListDetail.DefaultView;
ReceiveDoc NewReceiveDoc = new ReceiveDoc();
String ReferenceID = ReceiveDoc.GetNextRefForTransfer();
foreach (DataRowView dvr in dv)
{
//Get ReceiveDoc information.
int receiveDocID = Convert.ToInt32(dvr["ReceiveDocID"]);
ReceiveDoc receiveDocFromPicklist = new ReceiveDoc();
receiveDocFromPicklist.LoadByPrimaryKey(receiveDocID);
//We have all the Receivedoc information that we want
NewReceiveDoc.AddNew();
if (receiveDocFromPicklist.s_BatchNo == null)
NewReceiveDoc.BatchNo = receiveDocFromPicklist.BatchNo;
NewReceiveDoc.ItemID = receiveDocFromPicklist.ItemID;
NewReceiveDoc.SupplierID = receiveDocFromPicklist.SupplierID;
if (receiveDocFromPicklist.s_ExpDate == null)
NewReceiveDoc.ExpDate = receiveDocFromPicklist.ExpDate;
NewReceiveDoc.StoreID = StoreID;
NewReceiveDoc.ReceivedBy = User;
NewReceiveDoc.Remark = receiveDocFromPicklist.Remark;
NewReceiveDoc.RefNo = "TA" + receiveDocFromPicklist.RefNo;
if (!receiveDocFromPicklist.IsColumnNull("Cost"))
NewReceiveDoc.Cost = receiveDocFromPicklist.Cost;
NewReceiveDoc.ManufacturerId = receiveDocFromPicklist.ManufacturerId;
NewReceiveDoc.Quantity = Convert.ToInt32(dvr["Packs"]) * Convert.ToInt32(dvr["QtyPerPack"]);
NewReceiveDoc.NoOfPack = Convert.ToInt32(dvr["Packs"]);
NewReceiveDoc.QtyPerPack = Convert.ToInt32(dvr["QtyPerPack"]);
if (!receiveDocFromPicklist.IsColumnNull("PricePerPack"))
NewReceiveDoc.PricePerPack = receiveDocFromPicklist.PricePerPack;
if (!receiveDocFromPicklist.IsColumnNull("SellingPrice"))
NewReceiveDoc.SellingPrice = receiveDocFromPicklist.SellingPrice;
NewReceiveDoc.UnitID = receiveDocFromPicklist.UnitID;
NewReceiveDoc.DeliveryNote = receiveDocFromPicklist.DeliveryNote;
//NewReceiveDoc.PricePerPack = receiveDocFromPicklist.PricePerPack;
NewReceiveDoc.QuantityLeft = Convert.ToInt32(dvr["Packs"]) * Convert.ToInt32(dvr["QtyPerPack"]);
NewReceiveDoc.EurDate = DateTimeHelper.ServerDateTime;
NewReceiveDoc.Date = EthiopianDate.EthiopianDate.Now.ToGregorianDate();
NewReceiveDoc.IsDamaged = receiveDocFromPicklist.IsDamaged;
NewReceiveDoc.Save();
NewReceiveDoc.SetStatusAsReceived(UserID);
PalletizeTransfer(NewReceiveDoc);
}
return ReferenceID;
}
示例6: BtnAddBatchClick
private void BtnAddBatchClick(object sender, EventArgs e)
{
if (!dxValidationProvider1.Validate()) return;
var rec = new ReceiveDoc();
var yEnd = new YearEnd();
switch (VisibilitySetting.HandleUnits)
{
case 1:
{
rec.AddNew();
rec.ItemID = _itemid;
rec.BatchNo = txtBatchNo.Text;
rec.StoreID = _storeid;
rec.ExpDate = (DateTime) dateEditExpiryDate.EditValue;
rec.Date = _date;
rec.UnitID = 0;
rec.RefNo = txtRefNo.Text;
rec.Out = false;
rec.EurDate = DateTime.Now.Subtract(TimeSpan.FromDays(35));
rec.NoOfPack = Convert.ToInt32(txtPackQty.Text);
rec.QtyPerPack = Convert.ToInt32(txtQtyPerPack.Text);
rec.Quantity = (Convert.ToInt32(txtPackQty.Text))*(Convert.ToInt32(txtQtyPerPack.Text));
rec.QuantityLeft = (Convert.ToInt32(txtPackQty.Text))*(Convert.ToInt32(txtQtyPerPack.Text));
rec.Cost = Convert.ToDouble(txtPrice.Text);
rec.Save();
yEnd.AddNew();
yEnd.ItemID = _itemid;
yEnd.StoreID = _storeid;
yEnd.Year = _date.Year;
yEnd.AutomaticallyEntered = true;
yEnd.BBalance = 0;
yEnd.EBalance = 0;
yEnd.Save();
}
break;
default:
{
rec.AddNew();
rec.ItemID = _itemid;
rec.BatchNo = txtBatchNo.Text;
rec.StoreID = _storeid;
rec.UnitID = _unitid;
rec.ExpDate = (DateTime) dateEditExpiryDate.EditValue;
rec.NoOfPack = Convert.ToInt32(txtPackQty.Text);
rec.Quantity = Convert.ToInt32(txtPackQty.Text);
rec.QuantityLeft = Convert.ToInt32(txtPackQty.Text);
rec.QtyPerPack = Convert.ToInt32(txtQtyPerPack.Text);
rec.Date = _date;
rec.RefNo = txtRefNo.Text;
rec.Out = false;
rec.EurDate = DateTime.Now.Subtract(TimeSpan.FromDays(35));
rec.Cost = Convert.ToDouble(txtPrice.Text);
rec.Save();
yEnd.AddNew();
yEnd.ItemID = _itemid;
yEnd.StoreID = _storeid;
yEnd.UnitID = _unitid;
yEnd.AutomaticallyEntered = true;
yEnd.BBalance = 0;
yEnd.EBalance = 0;
yEnd.Save();
}
break;
}
XtraMessageBox.Show("New Batch successfully added.", "Success");
Close();
}