本文整理汇总了C#中BLL.ReceiveDoc.MarkAsDeleted方法的典型用法代码示例。如果您正苦于以下问题:C# ReceiveDoc.MarkAsDeleted方法的具体用法?C# ReceiveDoc.MarkAsDeleted怎么用?C# ReceiveDoc.MarkAsDeleted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLL.ReceiveDoc
的用法示例。
在下文中一共展示了ReceiveDoc.MarkAsDeleted方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: deleteToolStripMenuItem_Click
private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
{
var us = new User();
var userID = MainWindow.LoggedinId;
us.LoadByPrimaryKey(userID);
var dr = (DataRowView) lstTree.GetDataRecordByNode(lstTree.FocusedNode);
if (dr == null) return;
if (us.UserName != "admin")
{
XtraMessageBox.Show("You don't have the privilege to update reference number!", "Caution");
return;
}
var rec = new ReceiveDoc();
if (XtraMessageBox.Show("Are You Sure, You want to delete this?", "Confirmation", MessageBoxButtons.YesNo,MessageBoxIcon.Question) == DialogResult.Yes)
{
DataTable dtbl = rec.GetTransactionByRefNo((string) dr["RefNo"]);
foreach (DataRow dataRow in dtbl.Rows)
{
// AddReceiveDocDeleted(dataRow);
dataRow.Delete();
}
rec.MarkAsDeleted();
rec.Save();
XtraMessageBox.Show("Item successfully deleted.", "Success");
}
else
{
return;
}
}
示例2: toolStripMenuItem2_Click
private void toolStripMenuItem2_Click(object sender, EventArgs e)
{
var us = new User();
var userID = MainWindow.LoggedinId;
us.LoadByPrimaryKey(userID);
var dr = gridView1.GetFocusedDataRow();
if (dr == null) return;
int tranId = Convert.ToInt32(dr["ID"]);
var rec = new ReceiveDoc();
rec.LoadByPrimaryKey(tranId);
var iss = new IssueDoc();
iss.GetIssueByBatchAndId(rec.ItemID, rec.BatchNo, rec.ID);
_dtDate.CustomFormat = "MM/dd/yyyy";
DateTime dtCurrent = ConvertDate.DateConverter(_dtDate.Text);
if ((rec.Date.Year != dtCurrent.Year && rec.Date.Month < 11) || (iss.RowCount != 0))
{
XtraMessageBox.Show("Unable to Delete, This Transaction has been processed. Try Loss and Adjustment.",
"Unable to Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
}
else
{
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)
{
//AddDeletedRecieveDoc(rec);
rec.MarkAsDeleted();
rec.Save();
_dtDate.Value = DateTime.Now;
_dtDate.CustomFormat = "MM/dd/yyyy";
dtCurrent = ConvertDate.DateConverter(_dtDate.Text);
int yr = ((dtCurrent.Month > 10) ? dtCurrent.Year : dtCurrent.Year - 1);
DateTime dt1 = new DateTime(yr, 11, 1);
DateTime dt2 = new DateTime(dtCurrent.Year, dtCurrent.Month, dtCurrent.Day);
DataTable dtRec = rec.GetTransactionByDateRange(Convert.ToInt32(cboStores.EditValue), dt1, dt2);
gridReceives.DataSource = dtRec;
}
}
}
示例3: HandleReceiveDocDeleting
private static void HandleReceiveDocDeleting(int receiveDocID, int userID, ReceiveDoc rd)
{
//Check if there is a Related Picklists
var pld = new PickListDetail();
pld.LoadByReceiveDocID(receiveDocID);
pld.Rewind();
if(pld.RowCount > 0)
{
var pl = new PickList();
pl.LoadByPrimaryKey(pld.PickListID);
var order = new Order();
order.LoadByPrimaryKey(pl.OrderID);
string printedIDs = "";
var stvs = new BLL.Issue();
stvs.Where.PickListID.Value = pl.ID;
stvs.Query.Load();
stvs.Rewind();
while (!stvs.EOF)
{
printedIDs += stvs.IDPrinted.ToString(CultureInfo.InvariantCulture) + " ,";
stvs.MoveNext();
}
printedIDs = printedIDs.Remove(printedIDs.Length - 1, 1);
throw new Exception(
string.Format("Please cancel/void the following Stvs: Ref No = {0} With PrintedIDs : {1}",
order.RefNo,printedIDs));
}
// Add new record on ReceiveDocDeleted
var recDel = ReceiveDocDeleted.AddNewLog(rd, userID);
// Delete related ReceivePallet
var receivePallet = new BLL.ReceivePallet();
receivePallet.LoadByReceiveDocID(receiveDocID);
receivePallet.Rewind();
while(!receivePallet.EOF)
{
receivePallet.MarkAsDeleted();
receivePallet.MoveNext();
}
// Delete related ReceivePriceConfirmation
var receivePriceConfirmation = new ReceivePriceConfirmation();
receivePriceConfirmation.LoadByReceiveDocID(rd.ID);
receivePriceConfirmation.MarkAsDeleted();
// Delete related ReceiveDocShortage
var rdShr = new ReceiveDocShortage();
rdShr.Where.ReceiveDocID.Value = rd.ID;
rdShr.Query.Load();
rdShr.Rewind();
while(!rdShr.EOF)
{
rdShr.MarkAsDeleted();
rdShr.MoveNext();
}
// Delete related ReceiveDocConfirmation
var rdConf = new ReceiveDocConfirmation();
rdConf.Where.ReceiveDocID.Value = rd.ID;
rdConf.Query.Load();
rdConf.Rewind();
while(!rdConf.EOF)
{
rdConf.MarkAsDeleted();
rdConf.MoveNext();
}
rd.MarkAsDeleted();
var transaction = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr();
transaction.BeginTransaction();
try
{
receivePallet.Save();
receivePriceConfirmation.Save();
rdShr.Save();
rdConf.Save();
recDel.Save();
rd.Save();
transaction.CommitTransaction();
}
catch (Exception exception)
{
transaction.RollbackTransaction();
throw;
}
}