Beispiel #1
0
        public void UD26Add(string epicorUserID, string epiorUserPassword, UriBuilder builder,
                            Guid sessionId, ICReceiveUD26 cReceive, string Key)
        {
            try
            {
                EndpointBindingType bindingType = EndpointBindingType.BasicHttp;

                builder.Path = $"{Conn.environment}/Ice/BO/UD26.svc";
                svcUD26.UD26SvcContractClient _svcUD26 = GetClient <svcUD26.UD26SvcContractClient, svcUD26.UD26SvcContract>(
                    builder.Uri.ToString(),
                    epicorUserID,
                    epiorUserPassword,
                    bindingType);

                _svcUD26.Endpoint.EndpointBehaviors.Add(new HookServiceBehavior(sessionId, epicorUserID));

                svcUD26.UD26Tableset dsUD26 = new svcUD26.UD26Tableset();
                _svcUD26.GetaNewUD26(ref dsUD26);
                dsUD26.UD26[0].Key1 = Key;
                dsUD26.UD26[0].UserDefinedColumns["IntQueID_c"]     = cReceive.intQue;
                dsUD26.UD26[0].UserDefinedColumns["RejecComment_c"] = cReceive.RejComment;
                dsUD26.UD26[0].UserDefinedColumns["DateReported_c"] = DateTime.Today;
                dsUD26.UD26[0].UserDefinedColumns["PONum_c"]        = cReceive.PONum;
                dsUD26.UD26[0].UserDefinedColumns["DONum_c"]        = cReceive.DONum;
                _svcUD26.Update(ref dsUD26);
            }
            catch (Exception ex)
            {
                throw new Exception($"Epicor Error : {ex.Message.ToString()}");
            }
        }
        public ICReceive ICReject(ICReceive iCReceive)
        {
            string    msg      = "Success";
            ICReceive ICReturn = iCReceive;
            string    Key      = MaxKeyUD26(iCReceive.Company);

            try
            {
                UD26Services            receipt  = new UD26Services();
                ICReceiveUD26           recDM    = new ICReceiveUD26();
                List <ICReceiveDtlUD26> recDMDtl = new List <ICReceiveDtlUD26>();
                recDM.Company = iCReceive.Company;
                ICReceiveDtlUD26 dtl = new ICReceiveDtlUD26();
                foreach (ICReceiveDtl det in iCReceive.Detail)
                {
                    dtl         = new ICReceiveDtlUD26();
                    dtl.LineNo  = det.LineNo;
                    dtl.LotNum  = det.LotNum;
                    dtl.PartNum = det.PartNum;
                    dtl.Qty     = det.Qty;
                    dtl.SUOM    = det.SUOM;
                    recDMDtl.Add(dtl);
                }
                recDM.Detail     = recDMDtl;
                recDM.DONum      = iCReceive.DONum;
                recDM.intQue     = iCReceive.intQue;
                recDM.PONum      = iCReceive.PONum;
                recDM.RejComment = iCReceive.RejComment;
                recDM.TranStatus = iCReceive.TranStatus;
                recDM.VendorNum  = iCReceive.VendorNum;
                recDM.SupName    = iCReceive.SupName;
                receipt.Begin(recDM, Key);
            }
            catch (Exception ex)
            {
                msg = ex.Message;
            }
            ICReturn.TranStatus = msg;
            return(ICReturn);
        }
Beispiel #3
0
        public void Begin(ICReceiveUD26 cReceive, string Key)
        {
            // assign which company BO to fire


            configCompany = cReceive.Company;

            EndpointBindingType bindingType = EndpointBindingType.BasicHttp;
            string epicorUserID             = userName;
            string epiorUserPassword        = password;
            Guid   sessionId = Guid.Empty;

            svcSessionMod.SessionModSvcContractClient sessionModClient = null;

            string scheme = "https";

            if (bindingType == EndpointBindingType.SOAPHttp)
            {
                scheme = "http";
            }
            UriBuilder builder = new UriBuilder(scheme, Conn.hostName);

            builder.Path = $"{Conn.environment}/Ice/Lib/SessionMod.svc";

            try
            {
                sessionModClient = GetClient <svcSessionMod.SessionModSvcContractClient, svcSessionMod.SessionModSvcContract>
                                   (
                    builder.Uri.ToString(),
                    epicorUserID,
                    epiorUserPassword,
                    bindingType
                                   );

                string siteID = "", siteName = "", workstationID = "", workstationDesc = "";
                string employeeID = "", countryGroupCode = "", countryCode = "", tenantID = "";

                sessionId = sessionModClient.Login();

                builder.Path     = $"{Conn.environment}/Ice/Lib/SessionMod.svc";
                sessionModClient = GetClient <svcSessionMod.SessionModSvcContractClient, svcSessionMod.SessionModSvcContract>(builder.Uri.ToString(), epicorUserID, epiorUserPassword, bindingType);

                sessionModClient.Endpoint.EndpointBehaviors.Add(new HookServiceBehavior(sessionId, epicorUserID));

                //** CHANGE configCompany & configPlant to read from input **//
                sessionModClient.SetCompany(configCompany, out siteID, out siteName, out workstationID,
                                            out workstationDesc, out employeeID, out countryGroupCode,
                                            out countryCode, out tenantID);
                sessionModClient.SetPlant(configPlant);


                if (sessionId != Guid.Empty)
                {
                    UD26Add(epicorUserID, epiorUserPassword, builder, sessionId, cReceive, Key);
                }
                else
                {
                    //Sessionid is Empty!
                }
            }
            catch (Exception ex)
            {
                throw new Exception($"Epicor Error : {ex.Message.ToString()}");
            }
            finally
            {
                if (sessionId != Guid.Empty)
                {
                    sessionModClient.Logout();
                }
            }
        }