private void gridReceiveView_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            // Bind the detail grid
            PalletLocation pl = new PalletLocation();

            try
            {
                String reference = gridReceiveView.GetFocusedDataRow()["RefNo"].ToString();
                lblGRVNo.Text = reference;
                ReceiptID     = Convert.ToInt32(gridReceiveView.GetFocusedDataRow()["ReceiptID"]);
                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"]);

                    Convert.ToInt32(gridReceiveView.GetFocusedDataRow()["SupplierID"]);
                }
                catch
                {
                }
            }

            catch
            {
                gridDetails.DataSource = null;
            }
        }
예제 #2
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;
            }
        }