本文整理汇总了C#中BLL.ReceiveDoc.GetTransactionByRefNo方法的典型用法代码示例。如果您正苦于以下问题:C# ReceiveDoc.GetTransactionByRefNo方法的具体用法?C# ReceiveDoc.GetTransactionByRefNo怎么用?C# ReceiveDoc.GetTransactionByRefNo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLL.ReceiveDoc
的用法示例。
在下文中一共展示了ReceiveDoc.GetTransactionByRefNo方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EditRecieveRefrenceNo_Load
private void EditRecieveRefrenceNo_Load(object sender, EventArgs e)
{
dtRecDate.Value = DateTime.Now;
dtRecDate.CustomFormat = "MM/dd/yyyy";
var rec = new ReceiveDoc();
if(_refno!=null)
{
dtRecDate.ResetValue();
rec.GetTransactionByRefNo(_refno);
refnotextEdit.Text = rec.RefNo;
DateTime dtDate = Convert.ToDateTime(rec.Date.ToString("MM/dd/yyyy"));
txtDate.Text = dtDate.ToShortDateString();
}
}
示例2: btnUpdate_Click
private void btnUpdate_Click(object sender, EventArgs e)
{
var rec = new ReceiveDoc();
DataTable dtbl = rec.GetTransactionByRefNo(_refno);
if (rec.RowCount > 0)
{
foreach (DataRow datarow in dtbl.Rows)
{
datarow["RefNo"] = refnotextEdit.Text;
datarow["Date"] = txtDate.Text;
}
rec.Save();
Close();
XtraMessageBox.Show("Refrence No and Date is successfully updated", "Success");
}
else
{
XtraMessageBox.Show("There is no refrence to edit");
return;
}
this.Close();
}
示例3: btnDeleteWithRfNo_Click
private void btnDeleteWithRfNo_Click(object sender, EventArgs e)
{
CalendarLib.DateTimePickerEx dtDate = new CalendarLib.DateTimePickerEx
{
CustomFormat = "MM/dd/yyyy",
Value = DateTime.Now
};
DateTime dtCurrent = ConvertDate.DateConverter(dtDate.Text);
DataRowView dr = (DataRowView) lstTree.GetDataRecordByNode(lstTree.FocusedNode);
if (dr == null) return;
ReceiveDoc rec = new ReceiveDoc();
DataTable dtRec;
if (dr["ParentID"] == DBNull.Value)
{
int yr = ((dtCurrent.Month > 10) ? dtCurrent.Year : dtCurrent.Year - 1);
DateTime dt1 = new DateTime(Convert.ToInt32(dr["ID"]) - 1, 11, 1);
DateTime dt2 = new DateTime(Convert.ToInt32(dr["ID"]), 11, 1);
dtRec = rec.GetTransactionByDateRange(Convert.ToInt32(cboStores.EditValue), dt1, dt2);
string dateString = dr["RefNo"].ToString();
lblRecDate.Text = dateString;
}
else
{
dtRec = rec.GetTransactionByRefNo(dr["RefNo"].ToString(), Convert.ToInt32(cboStores.EditValue),
dr["Date"].ToString());
lblRecDate.Text = Convert.ToDateTime(dr["Date"]).ToString("MM dd,yyyy");
}
foreach (DataRow recieve in dtRec.Rows)
{
AddDeletedRecieveDocs(recieve);
}
}
示例4: ManageItems_Load
private void ManageItems_Load(object sender, EventArgs e)
{
var stor = new Stores();
stor.GetActiveStores();
cboStores.Properties.DataSource = stor.DefaultView;
cboStores.ItemIndex = 0;
var sup = new Supplier();
var dtSup = sup.GetSuppliersWithTransaction();
cboSupplier.Properties.DataSource = dtSup;
cboSupplier.ItemIndex = -1;
cboSupplier.Text = "Select Supplier";
var itemunit = new ItemUnit();
var units = itemunit.GetAllUnits();
unitsbindingSource.DataSource = units.DefaultView;
// bind the supplier lookup for the grid.
lkEditSupplier.DataSource = dtSup;
var unitcolumn = ((GridView)gridReceives.MainView).Columns[14];
switch (VisibilitySetting.HandleUnits)
{
case 1:
unitcolumn.Visible = false;
break;
case 2:
unitcolumn.Visible = true;
break;
default:
unitcolumn.Visible = true;
break;
}
// bind the current dates
try
{
var dr = (DataRowView) lstTree.GetDataRecordByNode(lstTree.Nodes[0].FirstNode);
if (dr == null) return;
var rec = new ReceiveDoc();
if (dr["ParentID"] == DBNull.Value)
{
// int yr = ((dtCurrent.Month > 10) ? dtCurrent.Year : dtCurrent.Year - 1);
var dt1 = new DateTime(Convert.ToInt32(dr["ID"]) - 1, 11, 1);
var dt2 = new DateTime(Convert.ToInt32(dr["ID"]), 11, 1);
dtRec = rec.GetTransactionByDateRange(Convert.ToInt32(cboStores.EditValue), dt1, dt2);
lblRecDate.Text = dr["RefNo"].ToString();
}
else
{
dtRec = rec.GetTransactionByRefNo(dr["RefNo"].ToString(), Convert.ToInt32(cboStores.EditValue),dr["Date"].ToString());
lblRecDate.Text = Convert.ToDateTime(dr["Date"]).ToString("MM dd,yyyy");
}
gridReceives.DataSource = dtRec;
}
catch (Exception ex)
{
}
}
示例5: lstTree_FocusedNodeChanged
private void lstTree_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e)
{
var dtDate = new CalendarLib.DateTimePickerEx
{
CustomFormat = "MM/dd/yyyy",
Value = DateTime.Now
};
DateTime dtCurrent = ConvertDate.DateConverter(dtDate.Text);
var dr = (DataRowView) lstTree.GetDataRecordByNode(lstTree.FocusedNode);
if (dr == null) return;
var rec = new ReceiveDoc();
DataTable dtRec;
if (dr["ParentID"] == DBNull.Value)
{
int yr = ((dtCurrent.Month > 10) ? dtCurrent.Year : dtCurrent.Year - 1);
DateTime dt1 = new DateTime(Convert.ToInt32(dr["ID"]) - 1, 11, 1);
DateTime dt2 = new DateTime(Convert.ToInt32(dr["ID"]), 11, 1);
dtRec = rec.GetTransactionByDateRange(Convert.ToInt32(cboStores.EditValue), dt1, dt2);
lblRecDate.Text = dr["RefNo"].ToString();
}
else
{
dtRec = rec.GetTransactionByRefNo(dr["RefNo"].ToString(), Convert.ToInt32(cboStores.EditValue),dr["Date"].ToString());
lblRecDate.Text = Convert.ToDateTime(dr["Date"]).ToString("MM dd,yyyy");
}
gridReceives.DataSource = dtRec;
}
示例6: 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;
}
}
示例7: gridViewRefNo_FocusedRowChanged
private void gridViewRefNo_FocusedRowChanged(object sender,
DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
{
DataRow dr = gridViewRefNo.GetFocusedDataRow();
DateTime dt1 = new DateTime();
DateTime dt2 = new DateTime();
dtDate.Value = DateTimeHelper.ServerDateTime;
DateTime dtCurrent = ConvertDate.DateConverter(dtDate.Text);
if (dr == null) return;
lblMode.Text = dr["Mode"] == DBNull.Value ? "-" : Convert.ToString(dr["Mode"]);
lblAccount.Text = dr["Account"] == DBNull.Value ? "-" : Convert.ToString(dr["Account"]);
lblSubAccount.Text = dr["SubAccount"] == DBNull.Value ? "-" : Convert.ToString(dr["SubAccount"]);
lblActivity.Text = dr["Activity"] == DBNull.Value ? "-" : Convert.ToString(dr["Activity"]);
lblSupplier.Text = dr["Supplier"] == DBNull.Value ? "-" : Convert.ToString(dr["Supplier"]);
lblInvoiceNo.Text = dr["STVOrInvoiceNo"] == DBNull.Value ? "-" : Convert.ToString(dr["STVOrInvoiceNo"]);
lblPaymentType.Text = dr["PaymentType"] == DBNull.Value ? "-" : Convert.ToString(dr["PaymentType"]);
lblPONumber.Text = dr["PONumber"] == DBNull.Value ? "-" : Convert.ToString(dr["PONumber"]);
lblPOType.Text = dr["POType"] == DBNull.Value ? "-" : Convert.ToString(dr["POType"]);
lblDocumentType.Text = dr["DocumentType"] == DBNull.Value ? "-" : Convert.ToString(dr["DocumentType"]);
lblCluster.Text = dr["Cluster"] == DBNull.Value ? "-" : Convert.ToString(dr["Cluster"]);
lblWarehouse.Text = dr["Warehouse"] == DBNull.Value ? "-" : Convert.ToString(dr["Warehouse"]);
lblPhysicalStore.Text = dr["PhysicalStore"] == DBNull.Value ? "-" : Convert.ToString(dr["PhysicalStore"]);
lblReceiveType.Text = dr["ReceiptType"] == DBNull.Value ? "-" : Convert.ToString(dr["ReceiptType"]);
lblReceiveStatus.Text = dr["ReceiptStatus"] == DBNull.Value ? "-" : Convert.ToString(dr["ReceiptStatus"]);
lblReceivedDate.Text = dr["ReceivedDate"] == DBNull.Value ? "-" : Convert.ToDateTime(dr["ReceivedDate"]).ToShortDateString();
lblReceivedBy.Text = dr["ReceivedBy"] == DBNull.Value ? "-" : Convert.ToString(dr["ReceivedBy"]);
var receiptConfirmationPrintout = new ReceiptConfirmationPrintout();
var grnfDetail = receiptConfirmationPrintout.GetReceivePrintoutDetail(Convert.ToInt32(dr["ReceiptID"]),"PGRV");
var grvDetail = receiptConfirmationPrintout.GetReceivePrintoutDetail(Convert.ToInt32(dr["ReceiptID"]), "GRV");
if (grnfDetail != null)
{
lblGRNFNo.Text = grnfDetail["IDPrinted"] == DBNull.Value ? "-" : Convert.ToString(grnfDetail["IDPrinted"]);
lblGRNFDate.Text = grnfDetail["PrintedDate"] == DBNull.Value ? "-" : Convert.ToDateTime(grnfDetail["PrintedDate"]).ToShortDateString();
lblGRNFBy.Text = grnfDetail["FullName"] == DBNull.Value ? "-" : Convert.ToString(grnfDetail["FullName"]);
}
if (grvDetail != null)
{
lblGRVDate.Text = grvDetail["PrintedDate"] == DBNull.Value ? "-" : Convert.ToDateTime(grvDetail["PrintedDate"]).ToShortDateString();
lblGRVBy.Text = grvDetail["FullName"] == DBNull.Value ? "-" : Convert.ToString(grvDetail["FullName"]);
}
string ReferenceNo = dr["RefNo"].ToString();
if (ReferenceNo != "")
{
gridTransactions.DataSource = null;
ReceiveDoc rec = new ReceiveDoc();
DataTable dtRec = new DataTable();
if (ReferenceNo == "0")
{
int yr = ((dtCurrent.Month > 10) ? dtCurrent.Year : dtCurrent.Year - 1);
dt1 = new DateTime(yr, 11, 1);
dt2 = new DateTime(dtCurrent.Year, dtCurrent.Month, dtCurrent.Day);
dtRec = rec.GetTransactionByDateRange(Convert.ToInt32(cboStores.EditValue), dt1, dt2);
//lblRecDate.Text = "Current Year";// ( " + dtCurrent.Year + " )";
}
else if (ReferenceNo == "1")
{
int yr = ((dtCurrent.Month > 10) ? dtCurrent.Year : dtCurrent.Year - 1);
dt1 = new DateTime(1980, 11, 1);
dt2 = new DateTime(yr, 10, 30);
dtRec = rec.GetTransactionByDateRange(Convert.ToInt32(cboStores.EditValue), dt1, dt2);
//lblRecDate.Text = "Past Year(s)";
}
else
{
dtRec = rec.GetTransactionByRefNo(ReferenceNo, Convert.ToInt32(cboStores.EditValue),
dr["Date"].ToString());
//lblRecDate.Text = Convert.ToDateTime(ReferenceNo[1]).ToString("MM dd,yyyy");
}
PopulateTransactions(dtRec);
}
}