示例#1
0
        private void cboDstStoreSites_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cboDstStoreSites.SelectedIndex >= 0)
            {
                DstDeliveryStoreSite dstSite = cboDstStoreSites.SelectedItem as DstDeliveryStoreSite;

                GetProductionWorkOrders(dstSite);
            }
        }
示例#2
0
        private void btnDeliver1_Click(object sender, EventArgs e)
        {
            int index = grdvPWOs.GetFocusedDataSourceRowIndex();

            if (index >= 0)
            {
                List <PWOToDeliverByMaterialCode> pwos =
                    grdPWOs.DataSource as List <PWOToDeliverByMaterialCode>;
                if (pwos != null)
                {
                    DstDeliveryStoreSite storeSite = null;
                    for (int i = 0; i < cboDstStoreSites.Properties.Items.Count; i++)
                    {
                        storeSite =
                            cboDstStoreSites.Properties.Items[i] as DstDeliveryStoreSite;
                        if (storeSite.T173LeafID == pwos[index].T173LeafID)
                        {
                            break;
                        }
                        else
                        {
                            storeSite = null;
                        }
                    }

                    if (storeSite == null)
                    {
                        XtraMessageBox.Show(
                            $"您无权向{pwos[index].T173Name}配送该订单",
                            "",
                            MessageBoxButtons.OK,
                            MessageBoxIcon.Error);
                        return;
                    }

                    string opNode = ((MenuInfo)Tag).OpNode;
                    using (frmMaterialsToDeliver showMaterisl =
                               new frmMaterialsToDeliver(
                                   pwos[index].FactID,
                                   pwos[index].AF482PK,
                                   storeSite,
                                   opNode))
                    {
                        showMaterisl.ShowDialog();
                    }

                    btnSearchByMaterialCode.PerformClick();
                }
            }
        }
示例#3
0
        private void btnDeliver_Click(object sender, EventArgs e)
        {
            int index = grdvOrders.GetFocusedDataSourceRowIndex();

            if (index >= 0)
            {
                DstDeliveryStoreSite dstStoreSite = cboDstStoreSites.SelectedItem as DstDeliveryStoreSite;
                string opNode = ((MenuInfo)Tag).OpNode;
                using (frmMaterialsToDeliver showMaterisl =
                           new frmMaterialsToDeliver(
                               orders[index].FactID,
                               orders[index].AF482PK,
                               dstStoreSite,
                               opNode))
                {
                    showMaterisl.ShowDialog();
                }

                btnRefresh.PerformClick();
            }
        }
示例#4
0
        private void btnSyncMO_Click(object sender, EventArgs e)
        {
            if (cboDstStoreSites.SelectedItem != null)
            {
                string strProcedureName =
                    string.Format(
                        "{0}.{1}",
                        className,
                        MethodBase.GetCurrentMethod().Name);

                WriteLog.Instance.WriteBeginSplitter(strProcedureName);
                TWaitting.Instance.ShowWaitForm("正在同步四班的订单");
                try
                {
                    int    errCode = 0;
                    string errText = "";
                    DstDeliveryStoreSite dstSite = cboDstStoreSites.SelectedItem as DstDeliveryStoreSite;

                    try
                    {
                        IRAPAPSClient.Instance.usp_ManualMODispatch(
                            IRAPUser.Instance.CommunityID,
                            dstSite.T173LeafID,
                            IRAPUser.Instance.SysLogID,
                            out errCode,
                            out errText);
                        WriteLog.Instance.Write(string.Format("({0}){1}", errCode, errText), strProcedureName);
                        if (errCode == 0)
                        {
                            GetProductionWorkOrders(dstSite);
                        }
                        else
                        {
                            TWaitting.Instance.CloseWaitForm();
                            XtraMessageBox.Show(
                                errText, "系统信息",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                            return;
                        }
                    }
                    catch (Exception error)
                    {
                        TWaitting.Instance.CloseWaitForm();
                        WriteLog.Instance.Write(error.Message, strProcedureName);
                        WriteLog.Instance.Write(error.StackTrace, strProcedureName);
                        XtraMessageBox.Show(
                            error.Message,
                            "系统信息",
                            MessageBoxButtons.OK,
                            MessageBoxIcon.Error);
                        return;
                    }
                }
                finally
                {
                    TWaitting.Instance.CloseWaitForm();
                    WriteLog.Instance.WriteEndSplitter(strProcedureName);
                }
            }
        }
示例#5
0
        private void GetProductionWorkOrders(DstDeliveryStoreSite dstSite)
        {
            string strProcedureName =
                string.Format(
                    "{0}.{1}",
                    className,
                    MethodBase.GetCurrentMethod().Name);

            WriteLog.Instance.WriteBeginSplitter(strProcedureName);
            TWaitting.Instance.ShowWaitForm("正在获取待配送的制造订单列表");
            try
            {
                int    errCode = 0;
                string errText = "";

                try
                {
                    IRAPSCESClient.Instance.ufn_GetList_ProductionWorkOrdersToDeliverMaterial_N(
                        IRAPUser.Instance.CommunityID,
                        dstSite.T173LeafID,
                        IRAPUser.Instance.SysLogID,
                        0,
                        ref orders,
                        out errCode,
                        out errText);
                    WriteLog.Instance.Write(string.Format("({0}){1}", errCode, errText), strProcedureName);
                    if (errCode == 0)
                    {
                        grdOrders.DataSource = orders;
                        for (int i = 0; i < grdvOrders.Columns.Count; i++)
                        {
                            if (grdvOrders.Columns[i].Visible)
                            {
                                grdvOrders.Columns[i].BestFit();
                            }
                        }
                        grdOrders.MainView.LayoutChanged();
                    }
                    else
                    {
                        XtraMessageBox.Show(
                            errText, "系统信息",
                            MessageBoxButtons.OK,
                            MessageBoxIcon.Error);
                        return;
                    }
                }
                catch (Exception error)
                {
                    WriteLog.Instance.Write(error.Message, strProcedureName);
                    WriteLog.Instance.Write(error.StackTrace, strProcedureName);
                    XtraMessageBox.Show(
                        error.Message,
                        "系统信息",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Error);
                    return;
                }
            }
            finally
            {
                TWaitting.Instance.CloseWaitForm();
                WriteLog.Instance.WriteEndSplitter(strProcedureName);
            }
        }