private string GenerateEstimationNumber(EstimationModel model)
        {
            string NextRegistrationID;
            string AppCode;
            IApplicationService appService = new ApplicationService(new ApplicationRepository(new UnitOfWork()));

            NextRegistrationID = GetNextRegistrationID(model);
            AppCode            = appService.GetApplicationCode(model.ApplicationId);
            return(Helper.GenerateUniqueID(AppCode, NextRegistrationID));
        }
        private string GenerateEstimationNumber(long appid)
        {
            string              RegistrationIdNext;
            string              Today, AppCode;
            StringBuilder       buffer     = new StringBuilder();
            IApplicationService appService = new ApplicationService(new ApplicationRepository(new UnitOfWork()));

            RegistrationIdNext = GetNextRegistrationID();
            AppCode            = appService.GetApplicationCode(appid);
            Today = DateTime.Now.ToString("yyyyMMdd", CultureInfo.CurrentCulture);
            buffer.Append(Today);
            buffer.Append(AppCode);
            buffer.Append(RegistrationIdNext);
            return(buffer.ToString());
        }
        public string GetEstimationProjectNextNumber(BaseViewModel model)
        {
            string NexrProjectNumer = string.Empty;

            try
            {
                IUnitOfWork           uwork = new UnitOfWork();
                IEstimationRepository estimationRepository = new EstimationRepository(uwork);
                IApplicationService   appService           = new ApplicationService(new ApplicationRepository(uwork));
                //var NextID = estimationRepository.GetEstimationProjectNextNumber(model);
                var NextID = 1;
                NextID           = NextID == null ? 0 : NextID;
                NextID           = NextID + 1;
                NexrProjectNumer = Helper.GenerateUniqueID(appService.GetApplicationCode(model.ApplicationId), NextID.ToString());
            }
            catch (Exception ex)
            {
            }
            return(NexrProjectNumer);
        }
Ejemplo n.º 4
0
        public string GetNextStaffNumber(BaseViewModel model)
        {
            string StaffNo = string.Empty;

            try
            {
                IUnitOfWork         unitWork   = new UnitOfWork();
                IApplicationService appService = new ApplicationService(new ApplicationRepository(unitWork));

                long?NextID = _StaffRepository.GetStaffNextRegistrationID(model);
                NextID  = NextID == null ? 0 : NextID;
                NextID  = NextID + 1;
                StaffNo = Helper.GenerateUniqueID(appService.GetApplicationCode(model.ApplicationId), NextID.ToString());
            }
            catch (Exception ex)
            {
            }

            return(StaffNo);
        }