Exemplo n.º 1
0
        protected virtual void SOOrder_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            SOOrder row = (SOOrder)e.Row;

            if (row == null)
            {
                return;
            }
            SOOrderExt sOOrderExt = row.GetExtension <SOOrderExt>();

            this.finalizeDO.SetEnabled(row.OrderType == SOOrderTypeConstants.SalesOrder && row.Status == SOOrderStatus.Completed && row.Hold == false && sOOrderExt.UsrFinalized == false);
        }
Exemplo n.º 2
0
        public virtual IEnumerable createDO(SOOrder sOOrder)
        {
            bool       modifyFlag = false;
            SOOrderExt sOOrderExt = sOOrder.GetExtension <SOOrderExt>();

            if (sOOrder.OrderNbr == null)
            {
                return(null);
            }

            try
            {
                ClientConversation.authenticate(userName, password);
                loggedIn = true;
            }
            catch (Exception ex)
            {
                loggedIn = false;
                throw new PXException(ex.Message);
            }

            if (loggedIn == true)
            {
                string createProjectResult = createProject(sOOrder);
                if (createProjectResult != "OK")
                {
                    if (createProjectResult.Trim().Contains("PROJECT ALREADY EXISTS"))
                    {
                        string modifyProjectResult = modifyProject(sOOrder);
                        modifyFlag = true;
                        if (modifyProjectResult != "OK")
                        {
                            throw new PXException(modifyProjectResult);
                        }
                    }
                    else
                    {
                        throw new PXException(createProjectResult);
                    }
                }

                if (!modifyFlag)
                {
                    string authoriseProjectResult = authoriseProject(sOOrder);
                    if (authoriseProjectResult != "OK")
                    {
                        throw new PXException(authoriseProjectResult);
                    }
                }

                string modifyProjectRefCodesResult = modifyProjectRefCodes(sOOrder);
                if (modifyProjectRefCodesResult != "OK")
                {
                    throw new PXException(modifyProjectRefCodesResult);
                }

                string createProjectEstimateResult = createProjectEstimate(sOOrder);
                if (createProjectEstimateResult != "OK")
                {
                    throw new PXException(createProjectEstimateResult);
                }

                string recordProjectActualsResult = recordProjectActuals(sOOrder);
                if (recordProjectActualsResult != "OK")
                {
                    throw new PXException(recordProjectActualsResult);
                }
            }
            return(null);
        }