Ejemplo n.º 1
0
        public void TestEditdirector()
        {
            Esigner edirector = new Esigner {
                DirectorID    = 69,
                CustomerID    = 1418,
                FirstName     = "shlomi",
                LastName      = "lastname",
                MiddleName    = "midname",
                BirthDate     = new DateTime(2011, 6, 10),
                Gender        = "M",
                Email         = "*****@*****.**",
                CompanyId     = 1220,
                MobilePhone   = "0547998484",
                IsDirector    = true,
                IsShareholder = false,
                UserId        = 22
            };

            var s = new AddHistoryDirector(edirector);

            s.Execute();

            //this.m_oDB.ExecuteNonQuery("AddHistoryDirector2", CommandSpecies.StoredProcedure,
            //new QueryParameter("@DirectorID", 1),
            //new QueryParameter("@Name", "asdgfa"));
        }
Ejemplo n.º 2
0
        public JsonResult SaveExperianDirector(
            int directorID,
            string email,
            string mobilePhone,
            string line1,
            string line2,
            string line3,
            string town,
            string county,
            string postcode
            )
        {
            Log.Debug("Saving Experian director (E-signatures controller): {0}: {1} {2}, {3} {4} {5} {6} {7} {8}",
                      directorID,
                      email,
                      mobilePhone,
                      line1,
                      line2,
                      line3,
                      town,
                      county,
                      postcode
                      );

            var m = new Esigner {
                DirectorID  = directorID,
                Email       = (email ?? string.Empty).Trim(),
                MobilePhone = (mobilePhone ?? string.Empty).Trim(),
                Line1       = (line1 ?? string.Empty).Trim(),
                Line2       = (line2 ?? string.Empty).Trim(),
                Line3       = (line3 ?? string.Empty).Trim(),
                Town        = (town ?? string.Empty).Trim(),
                County      = (county ?? string.Empty).Trim(),
                Postcode    = (postcode ?? string.Empty).Trim(),
            };

            string sValidation = m.ValidateExperianDirectorDetails();

            if (!string.IsNullOrWhiteSpace(sValidation))
            {
                return(Json(new { success = false, error = sValidation, }));
            }

            try {
                this.serviceClient.Instance.UpdateExperianDirectorDetails(null, this.context.UserId, m);
            }
            catch (Exception e) {
                Log.Warn(e, "Failed to save experian director details.");
                return(Json(new { success = false, error = string.Empty, }));
            }             // try

            return(Json(new { success = true, error = string.Empty, }));
        }         // SaveExperianDirector
Ejemplo n.º 3
0
 public UpdateExperianDirectorDetails(Esigner oDetails)
 {
     m_oSp = new SpUpdateExperianDirectorDetails(DB, Log) {
         DirectorID = oDetails.DirectorID,
         Email = oDetails.Email,
         MobilePhone = oDetails.MobilePhone,
         Line1 = oDetails.Line1,
         Line2 = oDetails.Line2,
         Line3 = oDetails.Line3,
         Town = oDetails.Town,
         County = oDetails.County,
         Postcode = oDetails.Postcode,
     };
 }
Ejemplo n.º 4
0
        public JsonResult EditDirector(int nCustomerID, int nDirectorID, DirectorModel directorModel)
        {
            ms_oLog.Debug("updating director");
            Director director  = this._directorRepository.Get(nDirectorID);
            Esigner  Edirector = directorModel.ToEsigner(director, nCustomerID);

            this.m_oServiceClient.Instance.AddHistoryDirector(Edirector);
            directorModel.UpdateFromModel(ref director);
            var tybReduced = director.Company.TypeOfBusiness.Reduce();

            switch (tybReduced)
            {
            case TypeOfBusinessReduced.Limited:
                var limitedCurrAddress = director.DirectorAddressInfo.LimitedDirectorHomeAddress;
                if (!limitedCurrAddress.Any())
                {
                    limitedCurrAddress = director.DirectorAddressInfo.NonLimitedDirectorHomeAddress;
                }

                MakeAddress(
                    directorModel.DirectorAddress,
                    director.DirectorAddressInfo.LimitedDirectorHomeAddressPrev,
                    CustomerAddressType.LimitedDirectorHomeAddressPrev,
                    limitedCurrAddress,
                    CustomerAddressType.LimitedDirectorHomeAddress
                    );
                break;

            default:
                var nonLimitedCurrAddress = director.DirectorAddressInfo.NonLimitedDirectorHomeAddress;
                if (!nonLimitedCurrAddress.Any())
                {
                    nonLimitedCurrAddress = director.DirectorAddressInfo.LimitedDirectorHomeAddress;
                }
                MakeAddress(
                    directorModel.DirectorAddress,
                    director.DirectorAddressInfo.NonLimitedDirectorHomeAddressPrev,
                    CustomerAddressType.NonLimitedDirectorHomeAddressPrev,
                    nonLimitedCurrAddress,
                    CustomerAddressType.NonLimitedDirectorHomeAddress
                    );
                break;
            }

            this._directorRepository.Update(director);

            return(Json(new { success = true }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 5
0
        public JsonResult Load(int?nCustomerID, bool bPollStatus)
        {
            Log.Debug("Loading e-signatures for customer {0} {1} polling status...", nCustomerID, bPollStatus ? "with" : "without");

            Esignature[] oSignatures;
            Esigner[]    oPotentialSigners;

            try {
                EsignatureListActionResult elar = this.serviceClient.Instance.LoadEsignatures(this.context.UserId, nCustomerID, bPollStatus);
                oSignatures       = elar.Data;
                oPotentialSigners = elar.PotentialSigners;
            }
            catch (Exception e) {
                Log.Warn(e, "Failed to load e-signatures for customer {0} {1} polling status.", nCustomerID, bPollStatus ? "with" : "without");
                oSignatures       = new Esignature[0];
                oPotentialSigners = new Esigner[0];
            }             // try

            Log.Debug("Loading e-signatures for customer {0} {1} polling status complete.", nCustomerID, bPollStatus ? "with" : "without");

            return(Json(new { signatures = oSignatures, signers = oPotentialSigners, }, JsonRequestBehavior.AllowGet));
        }         // Load
Ejemplo n.º 6
0
        public JsonResult SaveExperianDirector(
            string sCustomerID,
            string sContactEmail,
            int directorID,
            string email,
            string mobilePhone,
            string line1,
            string line2,
            string line3,
            string town,
            string county,
            string postcode
            )
        {
            var oIsAuthResult = IsAuth <BrokerForJsonResult>(
                "Save Experian director details for customer " + sCustomerID,
                sContactEmail
                );

            if (oIsAuthResult != null)
            {
                return(oIsAuthResult);
            }

            ms_oLog.Debug(
                "Saving Experian director (BrokerHome controller, broker {9}): {0}: {1} {2}, {3} {4} {5} {6} {7} {8}",
                directorID,
                email,
                mobilePhone,
                line1,
                line2,
                line3,
                town,
                county,
                postcode,
                sContactEmail
                );

            var m = new Esigner {
                DirectorID  = directorID,
                Email       = (email ?? string.Empty).Trim(),
                MobilePhone = (mobilePhone ?? string.Empty).Trim(),
                Line1       = (line1 ?? string.Empty).Trim(),
                Line2       = (line2 ?? string.Empty).Trim(),
                Line3       = (line3 ?? string.Empty).Trim(),
                Town        = (town ?? string.Empty).Trim(),
                County      = (county ?? string.Empty).Trim(),
                Postcode    = (postcode ?? string.Empty).Trim(),
            };

            string sValidation = m.ValidateExperianDirectorDetails();

            if (!string.IsNullOrWhiteSpace(sValidation))
            {
                return(new BrokerForJsonResult(sValidation));
            }

            try {
                this.m_oServiceClient.Instance.UpdateExperianDirectorDetails(null, null, m);
            } catch (Exception e) {
                ms_oLog.Warn(e, "Failed to save Experian director details.");
                return(new BrokerForJsonResult("Failed to save director details."));
            }             // try

            return(new BrokerForJsonResult());
        }         // SaveExperianDirector
Ejemplo n.º 7
0
        }         // LoadApplicationInfo

        public ActionMetaData AddHistoryDirector(Esigner Edirector)
        {
            return(Execute <AddHistoryDirector>(null, null, Edirector));
        }
Ejemplo n.º 8
0
 public ActionMetaData UpdateExperianDirectorDetails(int?nCustomerID, int?nUnderwriterID, Esigner oDetails)
 {
     return(ExecuteSync <UpdateExperianDirectorDetails>(nCustomerID, nUnderwriterID, oDetails));
 }         // UpdateExperianDirectorDetails
Ejemplo n.º 9
0
 public AddHistoryDirector(Esigner edirector)
 {
     this.EDirector = edirector;
 }