本文整理汇总了C#中BLL.ReceiveDoc.GetTransactionByBatch方法的典型用法代码示例。如果您正苦于以下问题:C# ReceiveDoc.GetTransactionByBatch方法的具体用法?C# ReceiveDoc.GetTransactionByBatch怎么用?C# ReceiveDoc.GetTransactionByBatch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLL.ReceiveDoc
的用法示例。
在下文中一共展示了ReceiveDoc.GetTransactionByBatch方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSave_Click
private void btnSave_Click(object sender, EventArgs e)
{
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)
{
IssueDoc iss = new IssueDoc();
ReceiveDoc rec = new ReceiveDoc();
iss.LoadByPrimaryKey(_tranId);
string batchNo = iss.BatchNo;
Int64 qty = iss.Quantity;
rec.GetTransactionByBatch(iss.ItemID, iss.BatchNo, iss.StoreId);
iss.RefNo = txtRefNo.Text;
iss.BatchNo = txtBatchNo.Text;
iss.NoOfPack = Convert.ToInt32(txtPack.Text);
iss.QtyPerPack = Convert.ToInt32(txtQtyPack.Text);
iss.Quantity = Convert.ToInt32(txtPack.Text) * Convert.ToInt32(txtQtyPack.Text);
iss.StoreId = Convert.ToInt32(cboStores.SelectedValue);
iss.ReceivingUnitID = Convert.ToInt32(cboReceivingUnit.SelectedValue);
iss.Remark = txtRemark.Text;
iss.IssuedBy = txtReceivedBy.Text;
iss.Save();
Int64 newQty = 0;
if(qty > iss.Quantity)
newQty = rec.QuantityLeft + (qty - iss.Quantity);
else
newQty = rec.QuantityLeft - (iss.Quantity - qty);
rec.QuantityLeft = newQty;
if(rec.QuantityLeft >0)
rec.Out = false;
rec.Save();
XtraMessageBox.Show("Transaction Succsfully Saved!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.Close();
}
}
else
{
XtraMessageBox.Show(valid, "Validation", MessageBoxButtons.OK, MessageBoxIcon.Stop);
}
}
示例2: ReceiveDoc
//.........这里部分代码省略.........
else if (Convert.ToDateTime(dvRec["Date"]) <= dtCurrent && Convert.ToDateTime(dvRec["Date"]) >= dtCurrent.Subtract(TimeSpan.FromDays(360)))
{
cBelowMin[2]++;
}
}
else if (balanceAmount > 0 && balanceAmount < eopcon)
{
if (Convert.ToDateTime(dvRec["Date"]) <= dtCurrent && Convert.ToDateTime(dvRec["Date"]) >= dtCurrent.Subtract(TimeSpan.FromDays(90)))
{
cNearStockOut[0]++;
}
else if (Convert.ToDateTime(dvRec["Date"]) <= dtCurrent && Convert.ToDateTime(dvRec["Date"]) >= dtCurrent.Subtract(TimeSpan.FromDays(180)))
{
cNearStockOut[1]++;
}
else if (Convert.ToDateTime(dvRec["Date"]) <= dtCurrent && Convert.ToDateTime(dvRec["Date"]) >= dtCurrent.Subtract(TimeSpan.FromDays(360)))
{
cNearStockOut[2]++;
}
}
}else if(Convert.ToInt32(dvRec["Transact"]) == 0)
{
//DateTime dteIss = Convert.ToDateTime(drIss["Date"]);
//DateTime dteRec = Convert.ToDateTime(dvRec["Date"]);
//DateTime dTomorow = new DateTime(dtCurrent.Year, dtCurrent.Month, dtCurrent.Day + 1);
//DateTime dteNextRec = (i <= dtRec.Rows.Count - 1) ? Convert.ToDateTime(dtRec.Rows[i]["Date"]) : dTomorow;
iss.LoadByPrimaryKey(Convert.ToInt32(dvRec["ID"]));
try
{
rec.LoadByPrimaryKey(iss.RecievDocID);
}
catch
{
rec.GetTransactionByBatch(itemId, dvRec["BatchNo"].ToString(), storeId);
}
ReceivingUnits recUnit = new ReceivingUnits();
recUnit.LoadByPrimaryKey(iss.ReceivingUnitID);
string issuedTo = recUnit.Name;
balanceAmount = balanceAmount - Convert.ToInt64(dvRec["Quantity"]);
balanceAm = (balanceAmount > 0) ? balanceAmount.ToString("#,###") : "0";
itm.LoadByPrimaryKey(iss.ItemID);
if (itm.NeedExpiryBatch)
{
ddDate = ((rec.RowCount > 0) ? rec.ExpDate.ToString("MMM dd,yyyy") : ""); ;
batNo = dvRec["BatchNo"].ToString(); //rec.BatchNo;
}
else
{
ddDate = "";
batNo = "";
}
object[] obj = { Convert.ToDateTime(dvRec["Date"]).ToString("MM dd,yyyy"), dvRec["RefNo"], "", Convert.ToInt64(dvRec["Quantity"]).ToString("#,###"), Convert.ToDouble(dvRec["Cost"]).ToString("C"), balanceAm,batNo, ddDate,issuedTo};
dtbin.Rows.Add(obj);
//For stock Out
dtT = Convert.ToDateTime(dvRec["Date"]);
//int monb1 = (dtT.Month < 11) ? dtT.Month + 2 : ((dtT.Month == 11) ? 1 : 2);
//int yer1 = (dtT.Month < 11) ? dtT.Year : dtT.Year - 1;
Int64 bBal = bal.GetSOH(itemId, storeId, dtT.Month, dtT.Year);
Int64 bAmc = bal.CalculateAMC(itemId, storeId, dtT.Month, dtT.Year);
mincon = bAmc * info.Min;
maxcon = bAmc * info.Max;
eopcon = bAmc * info.EOP;
示例3: toolStripMenuItem2_Click
private void toolStripMenuItem2_Click(object sender, EventArgs e)
{
var us = new User();
var userID = MainWindow.LoggedinId;
us.LoadByPrimaryKey(userID);
DataRow dr = gridView1.GetFocusedDataRow();
if (dr == null) return;
int tranId = Convert.ToInt32(dr["ID"]);
var rec = new ReceiveDoc();
var iss = new IssueDoc();
iss.LoadByPrimaryKey(tranId);
string batchNo = iss.BatchNo;
try
{
if (iss.RecievDocID.ToString() != "")
rec.LoadByPrimaryKey(iss.RecievDocID);
else
rec.GetTransactionByBatch(iss.ItemID, iss.BatchNo, iss.StoreId);
}
catch
{
rec.GetTransactionByBatch(iss.ItemID, iss.BatchNo, iss.StoreId);
}
if ( batchNo != rec.BatchNo && batchNo !=string.Empty)
{
XtraMessageBox.Show("Unable to Delete, This Transaction has been processed. Try Loss and Adjustment.", "Unable to Delete", MessageBoxButtons.OK, MessageBoxIcon.Stop);
}
else if (batchNo == string.Empty || batchNo ==rec.BatchNo)
{
if (XtraMessageBox.Show("Are You Sure, You want to delete this Transaction? You will not be able to restore this data.", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
rec.QuantityLeft = rec.QuantityLeft + iss.Quantity;
if (rec.QuantityLeft > 0)
rec.Out = false;
rec.Save();
AddIssueLodDelete(iss);
iss.MarkAsDeleted();
iss.Save();
DataTable dtRec = iss.GetAllTransaction(Convert.ToInt32(cboStores.EditValue));
gridIssues.DataSource = dtRec;
}
}
}