本文整理汇总了C#中BLL.ReceiveDoc.LoadByReceiptID方法的典型用法代码示例。如果您正苦于以下问题:C# ReceiveDoc.LoadByReceiptID方法的具体用法?C# ReceiveDoc.LoadByReceiptID怎么用?C# ReceiveDoc.LoadByReceiptID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLL.ReceiveDoc
的用法示例。
在下文中一共展示了ReceiveDoc.LoadByReceiptID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnReturn_Click
private void btnReturn_Click(object sender, EventArgs e)
{
//TODO: finish updating the changed locations
MyGeneration.dOOdads.TransactionMgr transaction = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr();
if (gridGRVs.DataSource == null)
return;
transaction.BeginTransaction();
try
{
PalletLocation pl = new PalletLocation();
BLL.ReceiveDoc recDoc = new ReceiveDoc();
recDoc.LoadByReceiptID(ReceiptID);
recDoc.ConfirmGRNFPrinted(null);
BLL.Receipt receiptStatus = new BLL.Receipt();
receiptStatus.LoadByPrimaryKey(ReceiptID);
receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.GRNF_PRINTED, null, this.GetFormIdentifier(), CurrentContext.UserId, "Return For Price Change");
transaction.CommitTransaction();
this.LogActivity("Return-For-Costing", ReceiptID);
XtraMessageBox.Show("Receipt Returned!", "Success", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
}
catch (Exception exp)
{
transaction.RollbackTransaction();
throw exp;
}
PutAwayListsLoad(null, null);
}
示例2: btnChangeReceiptConfirmationStatus_Click
private void btnChangeReceiptConfirmationStatus_Click(object sender, EventArgs e)
{
int newReceiptConfirmationStatus = int.Parse(lkReceiptConfirmationStatus.EditValue.ToString());
BLL.ReceiveDoc rd = new ReceiveDoc();
rd.LoadByReceiptID(int.Parse(txtReceiptID.Text));
while (!rd.EOF)
{
ReceiveDocConfirmation rdc = new ReceiveDocConfirmation();
rdc.LoadByReceiveDocID(rd.ID);
rdc.ReceiptConfirmationStatusID = newReceiptConfirmationStatus;
rdc.Save();
rd.MoveNext();
}
XtraMessageBox.Show("Successful!");
}
示例3: ReturnFromGRVPrinting
private void ReturnFromGRVPrinting()
{
int ReceiptID = Convert.ToInt32(gridReceiveView.GetFocusedDataRow()["ReceiptID"]); var receiveDoc = new ReceiveDoc();
receiveDoc.LoadByReceiptID(ReceiptID);
receiveDoc.ConfirmGRNFPrinted(null);
BLL.Receipt receiptStatus = new BLL.Receipt();
receiptStatus.LoadByPrimaryKey(ReceiptID);
receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.PRICE_CALCULATED, null, this.GetFormIdentifier(), CurrentContext.UserId, "Return For Price Change");
BindFormContents();
this.LogActivity("Return-SRM-To-Costing", ReceiptID);
}
示例4: PrintReceiptConfirmation
private void PrintReceiptConfirmation(string referenceNumber, int? reprintOfReceiptConfirmationPrintoutID)
{
var rc = new ReceiptConfirmationPrintout();
var srmPrintout = new HCMIS.Desktop.Reports.SRMPrintout(CurrentContext.LoggedInUserName);
int ReceiptID = Convert.ToInt32(gridReceiveView.GetFocusedDataRow()["ReceiptID"]);
var receiveDoc = new ReceiveDoc();
receiveDoc.LoadByReceiptID(ReceiptID);
ReceiptConfirmationPrintout.GetGRNFNo(ReceiptID);
srmPrintout.BranchName.Text = GeneralInfo.Current.HospitalName;
rc.PrepareDataForPrintout(ReceiptID, CurrentContext.UserId, false, 3, null,
reprintOfReceiptConfirmationPrintoutID,FiscalYear.Current);
srmPrintout.DataSource = rc.DefaultView.ToTable();
var rUnit = new Institution();
var idoc = new IssueDoc();
if (!receiveDoc.IsColumnNull("ReturnedFromIssueDocID"))
{
idoc.LoadByPrimaryKey(receiveDoc.ReturnedFromIssueDocID);
rUnit.LoadByPrimaryKey(idoc.ReceivingUnitID);
}
else
{
var po = new PO();
po.LoadByReceiptID(receiveDoc.ReceiptID);
rUnit.LoadByPrimaryKey(int.Parse(po.RefNo));
}
srmPrintout.xrFromValue.Text = rUnit.Name;
srmPrintout.xrWoredaValue.Text = rUnit.WoredaText;
srmPrintout.xrRegionValue.Text = rUnit.Region;
srmPrintout.xrZoneValue.Text = rUnit.ZoneText;
if (!receiveDoc.IsColumnNull("ReturnedFromIssueDocID"))
{
var stvLog = new BLL.Issue();
stvLog.LoadByPrimaryKey(idoc.STVID);
srmPrintout.xrIssueDateValue.Text = idoc.Date.ToString("M/d/yyyy");
var activity = new Activity();
activity.LoadByPrimaryKey(idoc.StoreId);
srmPrintout.xrAccountName.Text = activity.FullActivityName;
var rct = new BLL.Receipt();
rct.LoadByPrimaryKey(ReceiptID);
var rctInvoice = new ReceiptInvoice();
rctInvoice.LoadByPrimaryKey(rct.ReceiptInvoiceID);
srmPrintout.xrSTVNoValue.Text = rctInvoice.STVOrInvoiceNo;
}
else
{
var activity = new Activity();
activity.LoadByPrimaryKey(receiveDoc.StoreID);
srmPrintout.xrAccountName.Text = activity.FullActivityName;
srmPrintout.xrSTVNoValue.Text = receiveDoc.RefNo;
}
var dtDate = new DateTimePickerEx();
dtDate.Value = receiveDoc.EurDate;
srmPrintout.Date.Text = dtDate.Text;
if (srmPrintout.PrintDialog() != DialogResult.OK)
{
throw new Exception("Print cancelled by user!");
}
//Successfully printed
//Release Product
var GRV = new CostCalculator();
GRV.LoadGRV(ReceiptID);
GRV.ReleaseForIssue();
String reference = gridReceiveView.GetFocusedDataRow()["RefNo"].ToString();
var recDoc = new ReceiveDoc();
recDoc.LoadByReferenceNo(reference);
recDoc.ConfirmGRVPrinted(CurrentContext.UserId);
BLL.Receipt receiptStatus = new BLL.Receipt();
receiptStatus.LoadByPrimaryKey(ReceiptID);
receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.GRV_PRINTED, null, this.GetFormIdentifier(), CurrentContext.UserId, "GRV Printed");
BindFormContents();
}
示例5: PrintReceiptConfirmation
private HCMIS.Desktop.Reports.ReceiptConfirmationPrintout PrintReceiptConfirmation(int ReceiptID, int? reprintOfReceiptConfirmationPrintoutID)
{
ReceiptConfirmationPrintout rc = new ReceiptConfirmationPrintout();
HCMIS.Desktop.Reports.ReceiptConfirmationPrintout printout = new HCMIS.Desktop.Reports.ReceiptConfirmationPrintout(CurrentContext.LoggedInUserName);
BLL.ReceiveDoc receiveDoc = new ReceiveDoc();
// receiveDoc.LoadByReferenceNo(reference);
receiveDoc.LoadByReceiptID(ReceiptID);
var activity = new Activity();
activity.LoadByPrimaryKey(receiveDoc.StoreID);
BLL.Supplier supplier = new Supplier();
supplier.LoadByPrimaryKey(receiveDoc.SupplierID);
BLL.Receipt receipt=new BLL.Receipt();
receipt.LoadByPrimaryKey(receiveDoc.ReceiptID);
BLL.ReceiptInvoice receiptInvoice= new ReceiptInvoice();
receiptInvoice.LoadByPrimaryKey(receipt.ReceiptInvoiceID);
BLL.PO po = new PO();
po.LoadByPrimaryKey(receiptInvoice.POID);
BLL.POType poType = new POType();
poType.LoadByPrimaryKey(po.PurchaseType);
int printedID = 0;
string GRNFNo = FiscalYear.Current.GetCode(BLL.ReceiptConfirmationPrintout.GetGRNFNo(ReceiptID));
if (currentMode == Modes.GRVPrinting) //The GRVConfirmation is for reprinting
{
printout.BranchName.Text = GeneralInfo.Current.HospitalName;
PrepareGRVPrintout(printout);
// String reference = gridReceiveView.GetFocusedDataRow()["RefNo"].ToString();
if (poType.PurchaseOrderTypeCode == "LP") printout.xrGRVLabel.Text = "GRV No.";
else printout.xrGRVLabel.Text = "iGRV No.";
if (supplier.SupplierTypeID == SupplierType.CONSTANTS.HOME_OFFICE ||
supplier.SupplierTypeID == SupplierType.CONSTANTS.HUBS ||
supplier.SupplierTypeID == SupplierType.CONSTANTS.ACCOUNTS ||
supplier.SupplierTypeID == SupplierType.CONSTANTS.STORES)
{
//printout.xrGRVLabel.Text = "iGRV No.";
printout.xrAir.Visible = false;
printout.xrAirValue.Visible = false;
printout.xrTransit.Visible = false;
printout.xrTransitValue.Visible = false;
printout.xrInsurance.Visible = false;
printout.xrInsuranceValue.Visible = false;
printout.xrNumberOfCases.Visible = false;
printout.xrNumberOfCasesValue.Visible = false;
printout.xrInvoiceNo.Text = "STV No.";
printout.xrPurchaseOrderNo.Visible = false;
printout.xrPurchaseOrderNoValue.Visible = false;
printout.xrLabelGRNF.Text = GRNFNo;
printout.xrSTV.Visible = false;
printout.xrSTVNoValue.Visible = false;
printedID = rc.PrepareDataForPrintout(ReceiptID, CurrentContext.UserId, false, 4,
null,reprintOfReceiptConfirmationPrintoutID,FiscalYear.Current);
printout.DataSource = rc.DefaultView.ToTable();
CalendarLib.DateTimePickerEx dtDate = new CalendarLib.DateTimePickerEx();
//dtDate.CustomFormat = "dd/MM/yyyy";
dtDate.Value = receiveDoc.EurDate;
printout.Date.Text = dtDate.Text;
}
else
{
// printout.xrGRVLabel.Text = "GRV No.";
printout.xrSTV.Visible = false;
printout.xrSTVNoValue.Visible = false;
printedID = rc.PrepareDataForPrintout(ReceiptID, CurrentContext.UserId, false, 2,
null, reprintOfReceiptConfirmationPrintoutID,FiscalYear.Current);
printout.xrLabelGRNF.Text = GRNFNo;
printout.DataSource = rc.DefaultView.ToTable();
CalendarLib.DateTimePickerEx dtDate = new CalendarLib.DateTimePickerEx();
//dtDate.CustomFormat = "dd/MM/yyyy";
dtDate.Value = receiveDoc.EurDate;
printout.Date.Text = dtDate.Text;
}
}
printout.xrLabelStoreName.Text = activity.FullActivityName;
if (ReceiveDoc.IsThereShortageOrDamage(ReceiptID))
{
HCMIS.Desktop.Reports.ReceiptConfirmationShortagePrintout printoutShortage =
PrintReceiptConfirmationForShortage(ReceiptID, printedID);
if (currentMode == Modes.GRVPrinting)
PrepareGRVPrintout(printoutShortage);
printout.xrShortageReport.ReportSource = printoutShortage;
printout.PrintingSystem.ContinuousPageNumbering = true;
}
else
{
printout.ReportFooter.Visible = false;
}
//Release Product
CostCalculator GRV = new CostCalculator();
//.........这里部分代码省略.........
示例6: btnPrint_Click
private void btnPrint_Click(object sender, EventArgs e)
{
DataRow dataRow = gridReceiveView.GetFocusedDataRow();
if (dataRow != null)
{
if (Convert.ToInt32(dataRow["ReceiptConfirmationStatusID"]) == ReceiptConfirmationStatus.Constants.RECEIVE_QUANTITY_CONFIRMED)
{
ReceiptID = Convert.ToInt32(dataRow["ReceiptID"]);
PrintDialog printDialog = new PrintDialog();
printDialog.PrinterSettings.Copies = BLL.Settings.GRNFCopies;
DialogResult dialogResult = printDialog.ShowDialog();
if (dialogResult != DialogResult.OK)
{
MessageBox.Show("Printing Canceled by user", "Cancel Printint...", MessageBoxButtons.OK,
MessageBoxIcon.Asterisk);
return;
}
TransactionMgr transaction = TransactionMgr.ThreadTransactionMgr();
XtraReport printout;
try
{
transaction.BeginTransaction();
printout = WorkflowReportFactory.CreateGRNFPrintout(ReceiptID, null, false, FiscalYear.Current);
var receipt = new BLL.Receipt(ReceiptID);
var recDoc = new ReceiveDoc();
recDoc.LoadByReceiptID(ReceiptID);
if (receipt.ReceiptInvoice.PO.PurchaseType == BLL.POType.STORE_TO_STORE_TRANSFER || !BLL.Settings.HandleGRV)
{
recDoc.ConfirmGRVPrinted(CurrentContext.UserId);
BLL.Receipt receiptStatus = new BLL.Receipt();
receiptStatus.LoadByPrimaryKey(ReceiptID);
receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.GRV_PRINTED, null, this.GetFormIdentifier(), CurrentContext.UserId, "Transfer Confirmed");
}
else
{
recDoc.ConfirmGRNFPrinted(CurrentContext.UserId);
BLL.Receipt receiptStatus = new BLL.Receipt();
receiptStatus.LoadByPrimaryKey(ReceiptID);
receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.GRNF_PRINTED, null, this.GetFormIdentifier(), CurrentContext.UserId, "GRNF Printed");
}
transaction.CommitTransaction();
}
catch (Exception exception)
{
transaction.RollbackTransaction();
XtraMessageBox.Show(exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
throw;
}
for (int i = 0; i < printDialog.PrinterSettings.Copies; i++)
{
printout.Print( printDialog.PrinterSettings.PrinterName);
}
ReceiptConfirmation_Load(null, null);
}
else
{
XtraMessageBox.Show("The selected receipt has to be confirmed before GRNF is printed!", "ERROR", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
}
}
}
示例7: PrintReceiptConfirmation
private void PrintReceiptConfirmation(string referenceNumber, int? reprintOfReceiptConfirmationPrintoutID)
{
ReceiptConfirmationPrintout rc = new ReceiptConfirmationPrintout();
HCMIS.Desktop.Reports.ReceiptConfirmationPrintout printout = new HCMIS.Desktop.Reports.ReceiptConfirmationPrintout(CurrentContext.LoggedInUserName);
HCMIS.Desktop.Reports.SRMPrintout srmPrintout = new HCMIS.Desktop.Reports.SRMPrintout(CurrentContext.LoggedInUserName);
int ReceiptID = Convert.ToInt32(gridReceiveView.GetFocusedDataRow()["ReceiptID"]);
BLL.ReceiveDoc receiveDoc = new ReceiveDoc();
// receiveDoc.LoadByReferenceNo(reference);
receiveDoc.LoadByReceiptID(ReceiptID);
BLL.Supplier supplier = new Supplier();
supplier.LoadByPrimaryKey(receiveDoc.SupplierID);
int printedID = 0;
int GRNFNo = BLL.ReceiptConfirmationPrintout.GetGRNFNo(ReceiptID);
if (currentMode == Modes.DeliveryNotePrinting)
{
printout.BranchName.Text = GeneralInfo.Current.HospitalName;
printout.xrGRVLabel.Text = "Delivery Note.";
printout.xrAir.Visible = false;
printout.xrAirValue.Visible = false;
printout.xrTransit.Visible = false;
printout.xrTransitValue.Visible = false;
printout.xrInsurance.Visible = false;
printout.xrInsuranceValue.Visible = false;
printout.xrNumberOfCases.Visible = false;
printout.xrNumberOfCasesValue.Visible = false;
printout.xrInvoiceNo.Visible = false;
printout.xrInvoiceNoValue.Visible = false;
printout.xrPurchaseOrderNo.Visible = false;
printout.xrPurchaseOrderNoValue.Visible = false;
printout.xrSTV.Visible = false;
printout.xrSTVNoValue.Visible = false;
printout.DataSource = rc.PrepareDataForPrintout(ReceiptID, CurrentContext.UserId, false, 5, null, reprintOfReceiptConfirmationPrintoutID,FiscalYear.Current);
CalendarLib.DateTimePickerEx dtDate = new CalendarLib.DateTimePickerEx();
//dtDate.CustomFormat = "dd/MM/yyyy";
dtDate.Value = receiveDoc.EurDate;
printout.Date.Text = dtDate.Text;
}
var activity = new Activity();
activity.LoadByPrimaryKey(receiveDoc.StoreID);
printout.xrLabelStoreName.Text = activity.FullActivityName;
if (ReceiveDoc.IsThereShortageOrDamage(ReceiptID))
{
HCMIS.Desktop.Reports.ReceiptConfirmationShortagePrintout printoutShortage =
PrintReceiptConfirmationForShortage(referenceNumber, printedID);
printout.xrShortageReport.ReportSource = printoutShortage;
printout.PrintingSystem.ContinuousPageNumbering = true;
}
else
{
printout.ReportFooter.Visible = false;
}
//Successfully printed
//Release Product
CostCalculator GRV = new CostCalculator();
GRV.LoadGRV(ReceiptID);
GRV.ReleaseForIssue();
String reference = gridReceiveView.GetFocusedDataRow()["RefNo"].ToString();
BLL.ReceiveDoc recDoc = new ReceiveDoc();
recDoc.LoadByReferenceNo(reference);
recDoc.ConfirmGRVPrinted(CurrentContext.UserId);
BindFormContents();
}
示例8: CostAnalysis
public DataView CostAnalysis(string pGRVNo)
{
Receipt receipt = new Receipt(ReceiptID);
PO PO = receipt.ReceiptInvoice.PO;
ReceiptInvoice receiptInvoice = receipt.ReceiptInvoice;
ReceiveDoc receiveDoc = new ReceiveDoc();
receiveDoc.LoadByReceiptID(ReceiptID);
Activity activity = new Activity();
activity.LoadByPrimaryKey(receiveDoc.StoreID);
JournalEntry UnitCostJournal = new JournalEntry(activity.AccountName, activity.SubAccountName, activity.Name, PO.Supplier.CompanyName, "", PO.PONumber, pGRVNo, receiptInvoice.STVOrInvoiceNo, receiptInvoice.TransitTransferNo, receiptInvoice.WayBillNo, receiptInvoice.InsurancePolicyNo);
double SupplierClaim = Convert.ToDouble(GetSupplierClaim());
double InsuranceClaim = Convert.ToDouble(GetInsuranceClaim());
double Provision = Convert.ToDouble(Math.Round(CostBuildUp.Provision, 2));
double GrandTotal = Math.Round(GetGrandTotal(), 2);
double PriceDifference = Math.Round(_PriceDifference, 2);
double Bonus = Convert.ToDouble(Math.Round(_Bonus,2));
//Request from Mery Formula Provide by Phone
//Wednesday October 10
double GIT = Math.Round(GrandTotal + SupplierClaim + InsuranceClaim + _PriceDifference - Provision - Convert.ToDouble(Bonus), 2);
// trying out Sprout Method to Handle
if(receiveDoc.ReturnedStock)
{
double stock = Math.Round(GetGrandTotalForSRM(),2);
return SRMCostAnalysis(UnitCostJournal,_CommodityType, stock, stock,ReceiptID);
}
if(POType.GetModes(PO.PurchaseType) == POType.STANDARD && CostBuildUp.Invoice.InvoiceTypeID != ReceiptInvoiceType.InvoiceType.LOCAL_PURCHASE && CostBuildUp.Invoice.InvoiceTypeID != ReceiptInvoiceType.InvoiceType.CIP)
{
UnitCostJournal.AddNewEntry(String.Format("Stock ({0})", _CommodityType), GrandTotal, null);
UnitCostJournal.AddNewEntry("ClaimFromSupplier", SupplierClaim, null);
UnitCostJournal.AddNewEntry("ClaimFromInsurance", InsuranceClaim, null);
if (PriceDifference < 0)
{
UnitCostJournal.AddNewEntry("Price Difference", null, Math.Abs(PriceDifference));
}
else if (PriceDifference > 0)
{
UnitCostJournal.AddNewEntry("Price Difference", Math.Abs(PriceDifference), null);
}
UnitCostJournal.AddNewEntry("GIT", null, GIT);
UnitCostJournal.AddNewEntry("Provision", null, Provision);
if (Bonus > 0)
{
UnitCostJournal.AddNewEntry("Other Income", null, Math.Abs(Bonus));
}
}
else if (activity.IsHealthProgram())
{
UnitCostJournal.AddNewEntry(String.Format("Stock ({0})", _CommodityType), Math.Round(GrandTotal, Settings.NoOfDigitsAfterTheDecimalPoint), null);
if (PriceDifference < 0)
{
UnitCostJournal.AddNewEntry("Price Difference", null, Math.Abs(PriceDifference));
}
else if (PriceDifference > 0)
{
UnitCostJournal.AddNewEntry("Price Difference", Math.Abs(PriceDifference), null);
}
UnitCostJournal.AddNewEntry(String.Format("Net Asset ({0})", _Supplier), null, Math.Round(GrandTotal - PriceDifference - Bonus, Settings.NoOfDigitsAfterTheDecimalPoint));
if (Bonus > 0)
{
UnitCostJournal.AddNewEntry("Other Income", null, Math.Abs(Bonus));
}
}
else
{
UnitCostJournal.AddNewEntry(String.Format("Stock ({0})", _CommodityType), Math.Round(GrandTotal, Settings.NoOfDigitsAfterTheDecimalPoint), null);
if (PriceDifference > 0)
{
UnitCostJournal.AddNewEntry("Price Difference", null, Math.Abs(PriceDifference));
}
else if (PriceDifference < 0)
{
UnitCostJournal.AddNewEntry("Price Difference", Math.Abs(PriceDifference), null);
}
UnitCostJournal.AddNewEntry(String.Format("Account Payable ({0})", _Supplier), null, Math.Round(GIT - Convert.ToDouble(GetTotalDamagedAndShortlanded())-Bonus, Settings.NoOfDigitsAfterTheDecimalPoint));
if (Bonus > 0)
{
UnitCostJournal.AddNewEntry("Other Income", null, Math.Abs(Bonus));
}
}
return UnitCostJournal.DefaultView();
}
示例9: gridReceiveView_FocusedRowChanged
private void gridReceiveView_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e)
{
// Bind the detail grid
var pl = new PalletLocation();
ReceiptID = Convert.ToInt32(gridReceiveView.GetFocusedDataRow()["ReceiptID"]);
try
{
//B1A data
var SelectGRV = gridReceiveView.GetFocusedDataRow();
String reference = gridReceiveView.GetFocusedDataRow()["RefNo"].ToString();
lblGRVNo.Text = reference;
lblMode.Text = (string)SelectGRV["ModeName"];
lblAccount.Text = (string)SelectGRV["AccountName"];
lblSubAccount.Text = (string)SelectGRV["SubAccountName"];
lblActivity.Text = (string)SelectGRV["ActivityName"];
lblSupplier.Text = (string)SelectGRV["SupplierName"];
lblPoNumber.Text = (string)SelectGRV["PONo"];
lblCluster.Text = (string)SelectGRV["ClusterName"];
lblWarehouse.Text = (string)SelectGRV["WarehouseName"];
lblStore.Text = (string)SelectGRV["PhysicalStoreName"];
lblType.Text = (string)SelectGRV["ReceiptType"];
lblStatus.Text = (string)SelectGRV["ReceiptStatus"];
var logReceiptStatus = new LogReceiptStatus();
var dtHistory = logReceiptStatus.GetLogHistory(ReceiptID, "PRC");
if (dtHistory != null && dtHistory.Count > 0)
{
lblCalculatedBy.Text = (string)dtHistory[0]["FullName"];
lblCalculatedDate.Text = ((DateTime)dtHistory[0]["Date"]).ToShortDateString();
}
else
{
lblCalculatedDate.Text = lblCalculatedBy.Text = "-";
}
var receiveDoc = new ReceiveDoc();
receiveDoc.LoadByReceiptID(Convert.ToInt32(SelectGRV["ReceiptID"]));
lblConfirmedDate.Text = receiveDoc.ConfirmedDateTime.ToString() != "" ? receiveDoc.ConfirmedDateTime.ToShortDateString() : "-";
lblConfirmedBy.Text = SelectGRV["confirmedBy"] != DBNull.Value ? SelectGRV["confirmedBy"].ToString() : "-";
lblGRVNumber.Text = reference;
lblRecivedDate.Text = ((DateTime)SelectGRV["Date"]).ToShortDateString();
// lblConfirmedDate.Text =SelectGRV["confirmedDate"] != DBNull.Value ? Convert.ToDateTime(SelectGRV["confirmedDate"]).ToShortDateString() : "-";
ds = new DataSet();
DataTable dvMaster = pl.GetDetailsOfByReceiptID(ReceiptID);
dvMaster.TableName = "Master";
ds.Tables.Add(dvMaster);
gridDetails.DataSource = ds.Tables[dvMaster.TableName];
int status = Convert.ToInt32(gridReceiveView.GetFocusedDataRow()["Status"]);
try
{
StoreID = Convert.ToInt32(gridReceiveView.GetFocusedDataRow()["StoreID"]);
}
catch
{
}
var receipt = new BLL.Receipt();
receipt.LoadByPrimaryKey(ReceiptID);
int receiptTypeID = receipt.ReceiptTypeID;
}
catch
{
gridDetails.DataSource = null;
}
//reset
btnCancelVoidRequest.Enabled = true;
btnVoidRequest.Enabled = true;
btnVoid.Enabled = true;
btnReprintGRV.Enabled = true;
if (Convert.ToBoolean(gridReceiveView.GetFocusedDataRow()["isreprint"].ToString()))
{
btnReprintGRV.Enabled = false;
}
if (Convert.ToBoolean(gridReceiveView.GetFocusedDataRow()["hasreprint"].ToString()))
{
btnCancelVoidRequest.Enabled = false;
btnVoidRequest.Enabled = false;
btnVoid.Enabled = false;
}
}
示例10: btnCancelReceive_Click
private void btnCancelReceive_Click(object sender, EventArgs e)
{
if (XtraMessageBox.Show(DevExpress.LookAndFeel.UserLookAndFeel.Default, "Are you sure, you want to Cancel the Receipt Document?", "Are you sure:", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == System.Windows.Forms.DialogResult.Yes)
{
try
{
int receiptID = Convert.ToInt32(gridReceiveView.GetFocusedDataRow()["ReceiptID"].ToString());
var receiveDoc = new ReceiveDoc();
receiveDoc.LoadByReceiptID(receiptID);
receiveDoc.Rewind();
while (!receiveDoc.EOF)
{
BLL.ReceiveDoc.DeleteAReceiveDocEntry(receiveDoc.ID, CurrentContext.UserId);
receiveDoc.MoveNext();
}
XtraMessageBox.Show("You have successfully canceled the draft receipt.", "Confirmation");
BindFormContents();
}
catch (Exception exception)
{
XtraMessageBox.Show(exception.Message);
}
}
}
示例11: ReturnToStoreForQuantityEdit
private void ReturnToStoreForQuantityEdit()
{
//TODO: finish updating the changed locations
MyGeneration.dOOdads.TransactionMgr transaction = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr();
transaction.BeginTransaction();
try
{
PalletLocation pl = new PalletLocation();
String reference = gridReceiveView.GetFocusedDataRow()["RefNo"].ToString();
int ReceiptID = Convert.ToInt32(gridReceiveView.GetFocusedDataRow()["ReceiptID"]);
if (gridDetailView.DataSource == null)
return;
BLL.ReceiveDoc recDoc = new ReceiveDoc();
recDoc.LoadByReceiptID(ReceiptID);
recDoc.SetStatusAsDraft(CurrentContext.UserId);
BLL.Receipt receiptStatus = new BLL.Receipt();
receiptStatus.LoadByPrimaryKey(ReceiptID);
receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.DRAFT_RECEIPT, null, this.GetFormIdentifier(), CurrentContext.UserId, "Returned To Draft");
transaction.CommitTransaction();
XtraMessageBox.Show("Receipt Returned!", "Success", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
BindFormContents();
}
catch (Exception exp)
{
transaction.RollbackTransaction();
XtraMessageBox.Show(exp.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
示例12: gridReceiveView_FocusedRowChanged
private void gridReceiveView_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
{
// Bind the detail grid
PalletLocation pl = new PalletLocation();
if (e != null && e.PrevFocusedRowHandle < -1)
return;
string warehouseName = string.Empty;
try
{
var dr = gridReceiveView.GetFocusedDataRow();
if (dr == null)
return;
ReceiptID = Convert.ToInt32(dr["ReceiptID"]);
var receiptDoc = new BLL.Receipt();
var receipt = new BLL.Receipt();
receipt.LoadByPrimaryKey(ReceiptID);
receiptDoc.LoadByPrimaryKey(ReceiptID);
var GRNFDetail = receiptDoc.GetDetailsForGRNF();
if (GRNFDetail.Rows.Count > 0)
{
txtOrderNo.EditValue = dr["PONumber"] == DBNull.Value ? "-" : dr["PONumber"];
lblPONo.Text = (dr["PONumber"] == DBNull.Value ? "-" : dr["PONumber"].ToString());
lblCluster.Text = dr["ClusterName"] == DBNull.Value ? "-" : dr["ClusterName"].ToString();
txtWarehouse.EditValue = lblWarehouse.Text = warehouseName = dr["WarehouseName"] == DBNull.Value ? "-" : dr["WarehouseName"].ToString();
var receiptInvoice = new ReceiptInvoice(receiptDoc.ReceiptInvoiceID);
txtInvoiceNo.EditValue = lblInvoiceNo.Text = String.IsNullOrEmpty(receiptInvoice.STVOrInvoiceNo) ? "-" : receiptInvoice.STVOrInvoiceNo;
txtInsurance.EditValue = lblInsurancePolicy.Text = String.IsNullOrEmpty(receiptInvoice.InsurancePolicyNo) ? "-" : receiptInvoice.InsurancePolicyNo;
txtTransfer.EditValue = lblTransferVoucherNo.Text = String.IsNullOrEmpty(receipt.TransitTransferNo) ? "-" : receipt.TransitTransferNo;
txtWayBill.EditValue = lblWayBill.Text = String.IsNullOrEmpty(receiptInvoice.WayBillNo) ? "-" : receiptInvoice.WayBillNo;
var activity = new Activity();
activity.LoadByPrimaryKey(Convert.ToInt32(dr["StoreID"]));
txtActivity.EditValue = activity.FullActivityName;
lblActivity.Text = String.IsNullOrEmpty(activity.Name) ? "-" : activity.Name;
lblSubAccount.Text = String.IsNullOrEmpty(activity.SubAccountName) ? "-" : activity.SubAccountName;
lblAccount.Text = String.IsNullOrEmpty(activity.AccountName) ? "-" : activity.AccountName;
lblMode.Text = String.IsNullOrEmpty(activity.ModeName) ? "-" : activity.ModeName;
lblReceiveType.Text = dr["ReceiptType"] == DBNull.Value ? "-" : dr["ReceiptType"].ToString();
lblReceiveStatus.Text = dr["Status"] == DBNull.Value ? "-" : dr["Status"].ToString();
lblDocumentType.Text = dr["DocumentType"] == DBNull.Value ? "-" : dr["DocumentType"].ToString();
lblPOType.Text = dr["POType"] == DBNull.Value ? "-" : dr["POType"].ToString();
lblPaymentType.Text = dr["PaymentType"] == DBNull.Value ? "-" : dr["PaymentType"].ToString();
lblReceiptNo.Text = dr["ReceiptNo"] == DBNull.Value ? "-" : dr["ReceiptNo"].ToString();
lblSupplier.Text = dr["Supplier"] == DBNull.Value ? "-" : dr["Supplier"].ToString();
var user = new User();
user.LoadByPrimaryKey(receiptDoc.SavedByUserID);
lblReceivedBy.Text = String.IsNullOrEmpty(user.FullName) ? "-" : user.FullName;
var receiveDoc = new ReceiveDoc();
receiveDoc.LoadByReceiptID(ReceiptID);
lblReceivedDate.Text = receiptDoc.IsColumnNull("DateOfEntry") ? "-" :receiveDoc.EurDate.ToShortDateString();
lblConfirmedDate.Text = receiveDoc.IsColumnNull("ConfirmedDateTime") ? "-" : receiveDoc.ConfirmedDateTime.ToShortDateString();
if (!receiveDoc.IsColumnNull("ConfirmedByUserID"))
{
user.LoadByPrimaryKey(receiveDoc.ConfirmedByUserID);
lblConfirmedBy.Text = String.IsNullOrEmpty(user.FullName) ? "-" : user.FullName;
}
else
{
lblConfirmedBy.Text = "-";
}
var space = string.Empty;
var length = warehouseName.Length;
HeaderGroup.Text = warehouseName + space.PadRight(180 - length) + "Invoice No: " + receiptInvoice.STVOrInvoiceNo;
}
gridDetails.DataSource = GRNFDetail;
gridShortage.DataSource = receiptDoc.GetDiscrepancyForGRNF();
}
catch
{
gridDetails.DataSource = null;
}
}
示例13: ConfirmQuantityAndLocation
private void ConfirmQuantityAndLocation()
{
MyGeneration.dOOdads.TransactionMgr transaction = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr();
transaction.BeginTransaction();
try
{
PalletLocation pl = new PalletLocation();
DataRow dr = gridReceiveView.GetFocusedDataRow();
if (dr == null)
{
throw new Exception("Nothing to confirm!");
}
int ReceiptID = Convert.ToInt32(gridReceiveView.GetFocusedDataRow()["ReceiptID"]);
if (gridDetailView.DataSource == null)
return;
BLL.ReceiveDoc receiveDoc = new ReceiveDoc();
receiveDoc.LoadByReceiptIDWithReceivePallet(ReceiptID);
while (!receiveDoc.EOF)
{
int palletLocationID = Convert.ToInt32(receiveDoc.GetColumn("PalletLocationID"));
pl.LoadByPrimaryKey(palletLocationID);
pl.Confirmed = true;
pl.Save();
receiveDoc.MoveNext();
}
BLL.ReceiveDoc recDoc = new ReceiveDoc();
recDoc.LoadByReceiptID(ReceiptID);
recDoc.ConfirmQuantityAndLocation(CurrentContext.UserId);
BLL.Receipt receiptStatus = new BLL.Receipt();
receiptStatus.LoadByPrimaryKey(ReceiptID);
receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.RECEIVE_QUANTITY_CONFIRMED, null, this.GetFormIdentifier(), CurrentContext.UserId, "Receive Confirmed");
transaction.CommitTransaction();
XtraMessageBox.Show("Receipt Confirmed!", "Success", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
BindFormContents();
}
catch (Exception exp)
{
transaction.RollbackTransaction();
XtraMessageBox.Show(exp.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
示例14: btnSave_Click
private void btnSave_Click(object sender, EventArgs e)
{
GRV.SaveInsurance();
GRV.SaveCostCoefficientAndTotalValue(CurrentContext.UserId);
//ToDo: Remove this When it is safe and Ready for deployement.
GRV.RecordAverageCostAndSellingPrice(CurrentContext.UserId);
print();
BLL.ReceiveDoc recDoc = new ReceiveDoc();
recDoc.LoadByReceiptID(ReceiptID);
BLL.Receipt receiptStatus = new BLL.Receipt();
if (!BLL.Settings.UseReceiveCostConfirmation && PONumber.StartsWith("S2S-"))
{
if (SetFinalCost())
{ recDoc.ConfirmGRVPrinted(CurrentContext.UserId);
receiptStatus.LoadByPrimaryKey(ReceiptID);
receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.GRV_PRINTED, null, this.GetFormIdentifier(), CurrentContext.UserId, "StoreToStore Confirmed");
}
}
else if (BLL.Settings.UseReceiveCostConfirmation)
{
recDoc.SetPrice(CurrentContext.UserId);
receiptStatus.LoadByPrimaryKey(ReceiptID);
receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.PRICE_CALCULATED, null,
this.GetFormIdentifier(), CurrentContext.UserId, "Price Set");
}
else
{ recDoc.ConfirmPrice(CurrentContext.UserId);
receiptStatus.LoadByPrimaryKey(ReceiptID);
receiptStatus.ChangeStatus(ReceiptConfirmationStatus.Constants.PRICE_CONFIRMED, null, this.GetFormIdentifier(), CurrentContext.UserId, "Price Set");
}
XtraMessageBox.Show("Received Cost and Margin Set successfully!", "Success", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
PutAwayListsLoad(null, null);
this.LogActivity("Print-Cost-Analysis", ReceiptID);
}
示例15: btnReturn_Click
private void btnReturn_Click(object sender, EventArgs e)
{
var recDoc = new ReceiveDoc();
recDoc.LoadByReceiptID(receipt.ID);
recDoc.ConfirmGRNFPrinted(CurrentContext.UserId);
receipt.ChangeStatus(ReceiptConfirmationStatus.Constants.GRNF_PRINTED, null,
this.GetFormIdentifier(), CurrentContext.UserId, "Price Set");
MessageBox.Show("The Correction has been return to Pricing", "Success",MessageBoxButtons.OK,MessageBoxIcon.Information);
}