Example #1
0
        private static void CheckEvent_Amendment(List <EventInfo> lstEvent, Notification_Dep_user dep, int nCurrSnapshotId, int nPrevSnapshotId)
        {
            if (lstEvent.Count > 0)
            {
                AMP_Common.initDB(nCurrSnapshotId, nPrevSnapshotId, lstEvent);
                AMP_EventDAL.dep = dep;

                foreach (EventInfo evt in lstEvent)
                {
                    AMP_EventDAL.evt  = evt;
                    AMP_EventDAL.eMsg = new EventAccountMessage();

                    if (AMP_EventDAL.checkEventCancelled())
                    {
                        AMP_EventDAL.SendMSG();
                    }
                    else if (AMP_EventDAL.checkEventNewOrShortLead())
                    {
                        AMP_EventDAL.SendMSG();
                    }
                    else if (evt.Status != "80" && evt.Status != "86" && AMP_EventDAL.rule.ShortLeadStatusList.IndexOf(evt.Status.ToString()) > -1)
                    {
                        AMP_EventDAL.getEventAmendmentHead();
                        AMP_EventDAL.checkEventStatusChange();
                        AMP_EventDAL.checkEventUpdate();
                        AMP_EventDAL.checkEventNotesChange();

                        EventAccountMessage function_amendment = checkFunction_Amendment(evt, dep, nCurrSnapshotId, nPrevSnapshotId);

                        if (function_amendment.FuncUpdated)
                        {
                            AMP_EventDAL.eMsg.EventUpdated = true;
                            AMP_EventDAL.eMsg.MSGText     += function_amendment.MSGText;
                            AMP_EventDAL.eMsg.MSGHTML     += function_amendment.MSGHTML;
                        }

                        AMP_EventDAL.checkDocumentChange();
                        if (AMP_EventDAL.eMsg.EventUpdated)
                        {
                            AMP_EventDAL.SendMSG();
                        }
                    }
                }
            }
        }
Example #2
0
        private static EventAccountMessage checkOrder_Amendment(EventInfo evt, Function_Info finfo, Notification_Dep_user dep, int nCurrSnapshotId, int nPrevSnapshotId)
        {
            AMP_OrderDAL.dep   = dep;
            AMP_OrderDAL.evt   = evt;
            AMP_OrderDAL.finfo = finfo;
            AMP_OrderDAL.nSnapshotCurrentID  = nCurrSnapshotId;
            AMP_OrderDAL.nSnapshotPreviousID = nPrevSnapshotId;

            EventAccountMessage order_amendment_msg = new EventAccountMessage();

            List <Order_Info> lstCurrentOrders = AMP_OrderDAL.getCurrentFunctionOrders();

            foreach (Order_Info ord in lstCurrentOrders)
            {
                AMP_OrderDAL.oinfo = ord;

                AMP_OrderDAL.getOrderHeader();

                if (finfo.isOrdersChange)
                {
                    AMP_OrderDAL.checkOrderChange();
                }

                if (finfo.isOrdersNotesChange)
                {
                    AMP_OrderDAL.checkOrderNotesChange();
                }

                if (finfo.isOrderItemsChange)
                {
                    AMP_OrderDAL.checkOrderItemChange();
                }

                if (finfo.isOrderItemsNotesChange)
                {
                    AMP_OrderDAL.checkOrderItemNotesChange();
                }

                if (AMP_OrderDAL.eMsg.OrderUpdated)
                {
                    order_amendment_msg.OrderUpdated = true;
                    order_amendment_msg.MSGText     += AMP_OrderDAL.eMsg.MSGText;
                    order_amendment_msg.MSGHTML     += AMP_OrderDAL.eMsg.MSGHTML;
                }
            }

            List <Order_Info> lstDelOrders = AMP_OrderDAL.getDeletedOrders();

            foreach (Order_Info delord in lstDelOrders)
            {
                AMP_OrderDAL.oinfo = delord;

                AMP_OrderDAL.getOrderHeader();

                AMP_OrderDAL.checkDeltedOrderItems();

                if (AMP_OrderDAL.eMsg.OrderUpdated)
                {
                    order_amendment_msg.OrderUpdated = true;
                    order_amendment_msg.MSGText     += AMP_OrderDAL.eMsg.MSGText;
                    order_amendment_msg.MSGHTML     += AMP_OrderDAL.eMsg.MSGHTML;
                }
            }
            return(order_amendment_msg);
        }
Example #3
0
        private static EventAccountMessage checkFunction_Amendment(EventInfo evt, Notification_Dep_user dep, int nCurrSnapshotId, int nPrevSnapshotId)
        {
            AMP_FunctionDAL.dep = dep;
            AMP_FunctionDAL.evt = evt;
            AMP_FunctionDAL.nSnapshotCurrentID  = nCurrSnapshotId;
            AMP_FunctionDAL.nSnapshotPreviousID = nPrevSnapshotId;

            EventAccountMessage function_amendment = new EventAccountMessage();

            //List<Function_Info> lstFunctions = AMP_FunctionDAL.getAll_Related_Function();
            List <Function_Info> lstFunctions = AMP_FunctionDAL.getCurrentChangeFunctions();

            //loop functions
            foreach (Function_Info function in lstFunctions)
            {
                AMP_FunctionDAL.finfo = function;

                AMP_FunctionDAL.getFunctionHeader();

                if (function.isFunctionChange)
                {
                    AMP_FunctionDAL.checkFunctionChange();
                }

                if (function.isFunctionNotesChange)
                {
                    AMP_FunctionDAL.checkFunctionNotesChange();
                }

                if (function.isFunctionNotesChange)
                {
                    AMP_FunctionDAL.checkFunctionSignage();
                }

                EventAccountMessage order_amendment = new EventAccountMessage();
                if (function.isOrdersChange || function.isOrdersNotesChange || function.isOrderItemsChange || function.isOrderItemsNotesChange)
                {
                    order_amendment = checkOrder_Amendment(evt, function, dep, nCurrSnapshotId, nPrevSnapshotId);
                }


                if (AMP_FunctionDAL.eMsg.FuncUpdated || order_amendment.OrderUpdated)
                {
                    function_amendment.FuncUpdated = true;
                    function_amendment.MSGText    += AMP_FunctionDAL.eMsg.MSGText + order_amendment.MSGText;
                    function_amendment.MSGHTML    += AMP_FunctionDAL.eMsg.MSGHTML + order_amendment.MSGHTML;
                }
            }

            List <Function_Info> lstDeletedFunctions = AMP_FunctionDAL.getDelFunctions();

            foreach (Function_Info function in lstDeletedFunctions)
            {
                AMP_FunctionDAL.finfo = function;

                AMP_FunctionDAL.getFunctionHeader();

                AMP_FunctionDAL.getDeletedFunctionItems();

                if (AMP_FunctionDAL.eMsg.FuncUpdated)
                {
                    function_amendment.FuncUpdated = true;
                    function_amendment.MSGText    += AMP_FunctionDAL.eMsg.MSGText;
                    function_amendment.MSGHTML    += AMP_FunctionDAL.eMsg.MSGHTML;
                }
            }

            return(function_amendment);
        }