private void gridOrderListView_FocusedRowChanged(object sender,
                                                         DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            DataRow dr = gridOrderListView.GetFocusedDataRow();

            if (dr != null)
            {
                int        receiptID  = Convert.ToInt32(dr["ID"]);
                ReceiveDoc receiveDoc = new ReceiveDoc();
                receiveDoc.LoadAllByReceiptID(receiptID);
                DataTable         tbl = receiveDoc.DefaultView.ToTable();
                ReceiveDocDeleted receiveDocDeleted = new ReceiveDocDeleted();
                receiveDocDeleted.LoadAllByReceiptID(receiptID);

                LogReceiptStatus logReceiptStatus = new LogReceiptStatus();
                gridHistory.DataSource = logReceiptStatus.GetLogHistory(receiptID);

                if (receiveDocDeleted.RowCount > 0)
                {
                    tbl.Merge(receiveDocDeleted.DefaultView.ToTable());
                    BLL.User user = new User();
                    user.LoadByPrimaryKey(receiveDocDeleted.DeletedBy);
                    if (user.RowCount > 0)
                    {
                        lblDeletedBy.Text = string.Format("Deleted By {0}",
                                                          string.IsNullOrEmpty(user.FullName)
                                                              ? user.UserName
                                                              : user.FullName);
                    }
                }

                gridOrderDetail.DataSource = tbl;
            }
        }
        private void gridGRVs_MouseClick(object sender, MouseEventArgs e)
        {
            DataRow SelectGRV = gridGRVsView.GetFocusedDataRow();

            if (SelectGRV != null)
            {
                ReceiptID = Convert.ToInt32(SelectGRV["ReceiptID"]);
                PONumber  = Convert.ToString(SelectGRV["PONumber"]);
                LoadSelectedGRVDetailForInvoiceEntry(ReceiptID);
                string s = "";

                HeaderSection.Text = "Invoice No: " + (string)SelectGRV["InvoiceNumber"] + s.PadRight(180) + "GRNF No: " + (string)SelectGRV["RefNo"].ToString();

                lblMode.Text          = (string)SelectGRV["Mode"];
                lblAccount.Text       = (string)SelectGRV["AccountName"];
                lblSubAccount.Text    = (string)SelectGRV["SubAccountName"];
                lblActivity.Text      = (string)SelectGRV["ActivityName"];
                lblWarehouse.Text     = (string)SelectGRV["WarehouseName"];
                lblCluster.Text       = (string)SelectGRV["ClusterName"];
                lblReceiptType.Text   = (string)SelectGRV["ReceiveType"];
                lblRecieptStatus.Text = (string)SelectGRV["ReceiveStatus"];
                lblSupplier.Text      = (string)SelectGRV["SupplierName"];
                lblOrderNo.Text       = (string)SelectGRV["PONumber"];

                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 = "-";
                }

                lblConfirmedBy.Text = SelectGRV["ConfirmedBy"] == DBNull.Value ? "-" : (string)SelectGRV["ConfirmedBy"];
                DateTime confirmedTime;

                if (DateTime.TryParse(SelectGRV["ConfirmedTime"] == DBNull.Value ? "-" : SelectGRV["ConfirmedTime"].ToString(), out confirmedTime))
                {
                    lblConfirmedDate.Text = confirmedTime.ToShortDateString();
                }

                lblReceivedBy.Text  = (string)SelectGRV["ReceivedBy"];
                lblRecieptDate.Text = ((DateTime)SelectGRV["ReceivedTime"]).ToShortDateString();
                lblInsurance.Text   = SelectGRV["InsuranceNumber"] == DBNull.Value ? "" : (string)SelectGRV["InsuranceNumber"];
            }
            else
            {
                ResetForm();
            }
        }
예제 #3
0
        private void gridGRVs_MouseClick(object sender, MouseEventArgs e)
        {
            DataRow SelectGRV = gridGRVsView.GetFocusedDataRow();

            if (SelectGRV != null)
            {
                ReceiptID = Convert.ToInt32(SelectGRV["ReceiptID"]);
                PONumber  = Convert.ToString(SelectGRV["PONumber"]);
                LoadSelectedGRVDetailForInvoiceEntry(ReceiptID);

                txtOrderNo.EditValue = SelectGRV["PONumber"];

                txtInvoiceNo.EditValue = SelectGRV["InvoiceNumber"];
                string space  = "";
                int    length = ((string)SelectGRV["InvoiceNumber"]).Length;
                lcgInvoiceNo.Text = "Invoice No: " + (string)SelectGRV["InvoiceNumber"] + space.PadRight(180 - length) + "GRNF No: " + (string)SelectGRV["RefNo"].ToString();


                lblMode.Text       = (string)SelectGRV["Mode"] ?? "-";
                lblAccount.Text    = (string)SelectGRV["AccountName"] ?? "-";
                lblSubAccount.Text = (string)SelectGRV["SubAccountName"] ?? "-";
                lblActivity.Text   = (string)SelectGRV["ActivityName"] ?? "-";
                lblWarehouse.Text  = (string)SelectGRV["WarehouseName"] ?? "-";

                lblCluster.Text       = (string)SelectGRV["ClusterName"] ?? "-";
                lblReceiptType.Text   = (string)SelectGRV["ReceiveType"] ?? "-";
                lblReceiptStatus.Text = (string)SelectGRV["ReceiveStatus"] ?? "-";
                lblSupplier.Text      = (string)SelectGRV["SupplierName"] ?? "-";
                lblOrderNo.Text       = (string)SelectGRV["PONumber"] ?? "-";


                lblConfirmedBy.Text = SelectGRV["ConfirmedBy"] == DBNull.Value ? "-" : (string)SelectGRV["ConfirmedBy"];

                lblConfirmedDate.Text = SelectGRV["ConfirmedTime"] != DBNull.Value
                    ? Convert.ToDateTime(SelectGRV["ConfirmedTime"]).ToShortDateString()
                    : "-";

                lblReceivedBy.Text  = (string)SelectGRV["ReceivedBy"] ?? "-";
                lblReceiptDate.Text = ((DateTime)SelectGRV["ReceivedTime"]).ToShortDateString() ?? "-";
                lblInsurance.Text   = SelectGRV["InsuranceNumber"] == DBNull.Value ? "" : (string)SelectGRV["InsuranceNumber"] ?? "-";


                txtInsuranceNo.EditValue  = SelectGRV["InsuranceNumber"];
                lblInsurancePolicyNo.Text = SelectGRV["InsuranceNumber"].ToString() ?? "-";
                txtTransfer.EditValue     = SelectGRV["TransitNumber"];
                lblTransferNo.Text        = SelectGRV["TransitNumber"].ToString() ?? "-";
                txtWayBill.EditValue      = SelectGRV["WayBillNumber"];
                lblWayBillNo.Text         = SelectGRV["WayBillNumber"].ToString() ?? "-";
                Activity Activity = new Activity();
                Activity.LoadByPrimaryKey(Convert.ToInt32(SelectGRV["StoreID"]));
                txtActivity.EditValue = Activity.FullActivityName;
                lblActivity.Text      = Activity.FullActivityName ?? "-";

                var logReceiptStatus = new LogReceiptStatus();
                var dtHistory        = logReceiptStatus.GetLogHistory(ReceiptID, "PRC");

                if (dtHistory != null && dtHistory.Count > 0)
                {
                    lblCalcuatedBy.Text    = (string)dtHistory[0]["FullName"];
                    lblCalculatedDate.Text = ((DateTime)dtHistory[0]["Date"]).ToShortDateString();
                }
                else
                {
                    lblCalculatedDate.Text = lblCalcuatedBy.Text = "-";
                }
            }
            else
            {
                ResetForm();
            }
        }
예제 #4
0
        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;
            }
        }