Example #1
0
        public static Reservation CreateInstance(
            Service service,
            Servicer servicer,
            Address serviceDestination,
            string customerName,
            string customerMobile,
            DateTime appointTime,
            decimal sincerityGoldNeedToPay,
            string operatorId)
        {
            var result = new Reservation
            {
                ReservationNo          = ReservationNoGenerator.GenerateOrderNo(),
                AppointTime            = appointTime,
                CreatedBy              = operatorId,
                CreatedOn              = DateTime.Now,
                CustomerMobile         = customerMobile,
                CustomerName           = customerName,
                LastUpdBy              = operatorId,
                LastUpdOn              = DateTime.Now,
                Service                = service,
                ServiceDestination     = serviceDestination,
                ServiceId              = service?.Id,
                Servicer               = servicer,
                ServicerId             = servicer?.Id,
                SincerityGoldNeedToPay = sincerityGoldNeedToPay,
                OrganizationId         = service?.OrganizationId ?? servicer?.OrganizationId
            };

            result.GenerateId();
            result.InitStatus();
            result.InitAddress();

            return(result);
        }
Example #2
0
        public static Servicer CreateInstance(
            string jobNumber,
            string name,
            string technicalTitle,
            Grade technicalGrade,
            Gender gender,
            DateTime birthDay,
            Address address,
            string personalIntroduction,
            double sincerityGoldRate,
            string operatorId,
            bool isSuspend,
            string organizationId,
            string category,
            string subCategory,
            string portraitImageId,
            DateTime startRelevantWorkTime,
            decimal sincerityGold,
            string userName,
            string applicationId = "GOOIOS001"
            )
        {
            var result = new Servicer
            {
                Address               = address,
                BirthDay              = birthDay,
                CreatedBy             = operatorId,
                CreatedOn             = DateTime.Now,
                Gender                = gender,
                JobNumber             = jobNumber,
                LastUpdBy             = operatorId,
                LastUpdOn             = DateTime.Now,
                Name                  = name,
                PersonalIntroduction  = personalIntroduction,
                SincerityGoldRate     = sincerityGoldRate,
                TechnicalGrade        = technicalGrade,
                TechnicalTitle        = technicalTitle,
                IsSuspend             = isSuspend,
                OrganizationId        = organizationId,
                Category              = category,
                SubCategory           = subCategory,
                PortraitImageId       = portraitImageId,
                StartRelevantWorkTime = startRelevantWorkTime,
                SincerityGold         = sincerityGold,
                ApplicationId         = applicationId,
                UserName              = userName
            };

            result.GenerateId();
            result.InitAddress();

            return(result);
        }