예제 #1
0
        public Response CreateCustomerClass(string line_of_business, string policy_type, string vehicle_type, string zone,
                                            string country, string channel, string supervisor, int supervisor_code, string custclass, string GpProductID)
        {
            RMCustomerClass rmcustclass = new RMCustomerClass();
            AccountBuilder  aBuilder    = new AccountBuilder();
            Response        response;
            Customers       custom = new Customers();

            string taxid      = ConfigKey.ReadSetting("TAXID");
            string accountREC = ConfigKey.ReadSetting("IDREC");
            string company    = ConfigKey.ReadSetting("Company");

            try
            {
                rmcustclass.CLASSID             = custclass;
                rmcustclass.CLASDSCR            = custclass;
                rmcustclass.CRLMTTYP            = 1;
                rmcustclass.TAXSCHID            = taxid;
                rmcustclass.STMTCYCL            = 5;
                rmcustclass.CUSTPRIORITY        = 1;
                rmcustclass.ORDERFULFILLDEFAULT = 1;
                rmcustclass.ACCTRECACCT         = aBuilder.BuildARAccount(Convert.ToInt32(accountREC), line_of_business, policy_type, vehicle_type, country, channel, supervisor, supervisor_code, GpProductID);

                response = custom.CreateCustomerClass(rmcustclass, company);
                return(response);
            }
            catch (Exception ex)
            {
                log.LogExeption("Ocurrió un error: ", 2, ex);
                throw;
            }
        }
예제 #2
0
        public Response CustomerClassCreate(RMCustomerClass customerClass, string company)
        {
            var    response = new Response();
            string CustomerCLassXML;
            string server   = ConfigKey.ReadSetting("SERVER");
            string CNX      = "data source=" + server + ";initial catalog=" + company + ";integrated security=SSPI;persist security info=False;packet size=4096";
            var    eConnect = new eConnectRequest();
            taCreateCustomerClass rmCustomerClass;

            try
            {
                rmCustomerClass  = SetCustomerClassValues(customerClass);
                CustomerCLassXML = SerializeCustomerClass(rmCustomerClass);
                response         = eConnect.CreateGPMaster(CNX, CustomerCLassXML);

                return(response);
            }
            catch (Exception ex)
            {
                response         = new Response();
                response.SUCCESS = false;
                response.MESSAGE = ex.Message;
                response.STACK   = ex.StackTrace;
                return(response);
            }
        }
예제 #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="custclass"></param>
        /// <param name="company"></param>
        /// <returns></returns>
        public Response CreateCustomerClass(RMCustomerClass custclass, string company)
        {
            var      gpservices = new RMTransactionClient();
            Response response;

            response = gpservices.CreateCustomerClass(custclass, company);
            gpservices.Close();

            return(response);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="customerclass"></param>
        /// <param name="company"></param>
        /// <returns></returns>
        public Response CreateCustomerClass(RMCustomerClass customerclass, string company)
        {
            RMCustomerClassCreate createclass = new RMCustomerClassCreate();

            return(createclass.CustomerClassCreate(customerclass, company));
        }
예제 #5
0
        private taCreateCustomerClass SetCustomerClassValues(RMCustomerClass customerClass)
        {
            taCreateCustomerClass rmCustomerClass = new taCreateCustomerClass();

            try
            {
                rmCustomerClass.CLASSID             = customerClass.CLASSID;
                rmCustomerClass.CLASDSCR            = customerClass.CLASDSCR;
                rmCustomerClass.CRLMTTYP            = customerClass.CRLMTTYP.GetValueOrDefault();
                rmCustomerClass.CRLMTAMT            = customerClass.CRLMTAMT.GetValueOrDefault();
                rmCustomerClass.CRLMTPER            = customerClass.CRLMTPER.GetValueOrDefault();
                rmCustomerClass.CRLMTPAM            = customerClass.CRLMTPAM.GetValueOrDefault();
                rmCustomerClass.DEFLTCLS            = customerClass.DEFLTCLS.GetValueOrDefault();
                rmCustomerClass.BALNCTYP            = customerClass.BALNCTYP.GetValueOrDefault();
                rmCustomerClass.CHEKBKID            = customerClass.CHEKBKID;
                rmCustomerClass.TAXSCHID            = customerClass.TAXSCHID;
                rmCustomerClass.SHIPMTHD            = customerClass.SHIPMTHD;
                rmCustomerClass.PYMTRMID            = customerClass.PYMTRMID;
                rmCustomerClass.CUSTDISC            = customerClass.CUSTDISC.GetValueOrDefault();
                rmCustomerClass.MINPYTYP            = customerClass.MINPYTYP.GetValueOrDefault();
                rmCustomerClass.MINPYDLR            = customerClass.MINPYDLR.GetValueOrDefault();
                rmCustomerClass.MINPYPCT            = customerClass.MINPYPCT.GetValueOrDefault();
                rmCustomerClass.MXWOFTYP            = customerClass.MXWOFTYP.GetValueOrDefault();
                rmCustomerClass.MXWROFAM            = customerClass.MXWROFAM.GetValueOrDefault();
                rmCustomerClass.FNCHATYP            = customerClass.FNCHATYP.GetValueOrDefault();
                rmCustomerClass.FINCHDLR            = customerClass.FINCHDLR.GetValueOrDefault();
                rmCustomerClass.FNCHPCNT            = customerClass.FNCHPCNT.GetValueOrDefault();
                rmCustomerClass.PRCLEVEL            = customerClass.PRCLEVEL;
                rmCustomerClass.CURNCYID            = customerClass.CURNCYID;
                rmCustomerClass.RATETPID            = customerClass.RATETPID;
                rmCustomerClass.DEFCACTY            = customerClass.DEFCACTY.GetValueOrDefault();
                rmCustomerClass.CASHACCT            = customerClass.CASHACCT;
                rmCustomerClass.ACCTRECACCT         = customerClass.ACCTRECACCT;
                rmCustomerClass.SALESACCT           = customerClass.SALESACCT;
                rmCustomerClass.COSTOFSALESACCT     = customerClass.COSTOFSALESACCT;
                rmCustomerClass.IVACCT              = customerClass.IVACCT;
                rmCustomerClass.TERMDISCTAKENACCT   = customerClass.TERMDISCTAKENACCT;
                rmCustomerClass.TERMDISCAVAILACCT   = customerClass.TERMDISCAVAILACCT;
                rmCustomerClass.FINCHRGACCT         = customerClass.FINCHRGACCT;
                rmCustomerClass.SALESORDERRETACCT   = customerClass.SALESORDERRETACCT;
                rmCustomerClass.SALSTERR            = customerClass.SALSTERR;
                rmCustomerClass.SLPRSNID            = customerClass.SLPRSNID;
                rmCustomerClass.STMTCYCL            = customerClass.STMTCYCL.GetValueOrDefault();
                rmCustomerClass.KPCALHST            = customerClass.KPCALHST.GetValueOrDefault();
                rmCustomerClass.KPDSTHST            = customerClass.KPDSTHST.GetValueOrDefault();
                rmCustomerClass.KPERHIST            = customerClass.KPERHIST.GetValueOrDefault();
                rmCustomerClass.KPTRXHST            = customerClass.KPTRXHST.GetValueOrDefault();
                rmCustomerClass.DISGRPER            = customerClass.DISGRPER.GetValueOrDefault();
                rmCustomerClass.DUEGRPER            = customerClass.DUEGRPER.GetValueOrDefault();
                rmCustomerClass.Revalue_Customer    = customerClass.Revalue_Customer.GetValueOrDefault();
                rmCustomerClass.Post_Results_To     = customerClass.Post_Results_To.GetValueOrDefault();
                rmCustomerClass.ORDERFULFILLDEFAULT = customerClass.ORDERFULFILLDEFAULT.GetValueOrDefault();
                rmCustomerClass.CUSTPRIORITY        = customerClass.CUSTPRIORITY.GetValueOrDefault();
                rmCustomerClass.RMOvrpymtWrtoffAcct = customerClass.RMOvrpymtWrtoffAcct;
                rmCustomerClass.RequesterTrx        = customerClass.RequesterTrx.GetValueOrDefault();

                return(rmCustomerClass);
            }
            catch (Exception)
            {
                throw;
            }
        }