コード例 #1
0
        private MsCrmResult SendToService(DiscoveryForm discoveryForm)
        {
            MsCrmResult returnValue = new MsCrmResult();

            try
            {
                lotusService.UcretsizKesifService lotus = new WindowsServices.ProcessDiscoveryForms.lotusService.UcretsizKesifService();

                //lotusService.RESPONSE result = lotus.CREATERECORD("A3108", 1, discoveryForm.FirstName, discoveryForm.LastName, discoveryForm.Email, discoveryForm.PhoneNumber
                //             , discoveryForm.VisitHour.Value, discoveryForm.CityId.Name, discoveryForm.TownId.Name, discoveryForm.HomeType.Value
                //             , "", ((DateTime)discoveryForm.VisitDate).ToString("dd.MM.yyyy HH:mm"), discoveryForm.InformedBy.Value);



                FileLogHelper.LogFunction(this.GetType().Name, "DefaultPortalId:" + Globals.DefaultPortalId, @Globals.FileLogPath);
                FileLogHelper.LogFunction(this.GetType().Name, "UserParameter:" + (discoveryForm.UserId != null ? discoveryForm.UserId.Id.ToString() : "No User Info"), @Globals.FileLogPath);

                MsCrmResultObject resultUser = PortalUserHelper.GetPortalUserDetail(new Guid(Globals.DefaultPortalId), discoveryForm.UserId.Id, _sda);

                string userName = "";

                if (resultUser.Success)
                {
                    PortalUser portalUser = (PortalUser)resultUser.ReturnObject;

                    userName = portalUser.ContactInfo.Title;
                }
                else
                {
                    userName = discoveryForm.UserId.Name;
                }

                lotusService.RESPONSE result = lotus.CREATERECORD("A3108", Convert.ToDouble(discoveryForm.FormCode), discoveryForm.FirstName, discoveryForm.LastName, discoveryForm.Email, discoveryForm.PhoneNumber
                                                                  , string.Empty, discoveryForm.CityId.Name, discoveryForm.TownId.Name, string.Empty
                                                                  , "", string.Empty, string.Empty, userName);


                if (result.ERRORCODE == 0)
                {
                    returnValue.Success = true;
                    returnValue.Result  = "Servise Gönderildi.";
                }
                else
                {
                    returnValue.Result = result.ERRORCODE + "|" + result.ERRORDESCRIPTION;
                }
            }
            catch (Exception ex)
            {
                returnValue.Result = ex.StackTrace;
            }

            return(returnValue);
        }
コード例 #2
0
        private MsCrmResult SendToService(DiscoveryForm discoveryForm)
        {
            MsCrmResult returnValue = new MsCrmResult();

            try
            {

                lotusService.UcretsizKesifService lotus = new WindowsServices.ProcessDiscoveryForms.lotusService.UcretsizKesifService();

                //lotusService.RESPONSE result = lotus.CREATERECORD("A3108", 1, discoveryForm.FirstName, discoveryForm.LastName, discoveryForm.Email, discoveryForm.PhoneNumber
                //             , discoveryForm.VisitHour.Value, discoveryForm.CityId.Name, discoveryForm.TownId.Name, discoveryForm.HomeType.Value
                //             , "", ((DateTime)discoveryForm.VisitDate).ToString("dd.MM.yyyy HH:mm"), discoveryForm.InformedBy.Value);

                FileLogHelper.LogFunction(this.GetType().Name, "DefaultPortalId:" + Globals.DefaultPortalId, @Globals.FileLogPath);
                FileLogHelper.LogFunction(this.GetType().Name, "UserParameter:" + (discoveryForm.UserId != null ? discoveryForm.UserId.Id.ToString() : "No User Info"), @Globals.FileLogPath);

                MsCrmResultObject resultUser = PortalUserHelper.GetPortalUserDetail(new Guid(Globals.DefaultPortalId), discoveryForm.UserId.Id, _sda);

                string userName = "";

                if (resultUser.Success)
                {
                    PortalUser portalUser = (PortalUser)resultUser.ReturnObject;

                    userName = portalUser.ContactInfo.Title;
                }
                else
                {
                    userName = discoveryForm.UserId.Name;
                }

                lotusService.RESPONSE result = lotus.CREATERECORD("A3108", Convert.ToDouble(discoveryForm.FormCode), discoveryForm.FirstName, discoveryForm.LastName, discoveryForm.Email, discoveryForm.PhoneNumber
                             , string.Empty, discoveryForm.CityId.Name, discoveryForm.TownId.Name, string.Empty
                             , "", string.Empty, string.Empty, userName);

                if (result.ERRORCODE == 0)
                {
                    returnValue.Success = true;
                    returnValue.Result = "Servise Gönderildi.";
                }
                else
                {
                    returnValue.Result = result.ERRORCODE + "|" + result.ERRORDESCRIPTION;
                }
            }
            catch (Exception ex)
            {
                returnValue.Result = ex.StackTrace;
            }

            return returnValue;
        }