public GetDCNumberForScSendingResponseDto GetDCNumberForSCSending(int DcNumberFor)
        {
            GetDCNumberForScSendingResponseDto response = new GetDCNumberForScSendingResponseDto();

            try
            {
                response = rSubContractProvider.GetDCNumber(DcNumberFor);
                response.ServiceResponseStatus = 1;
            }
            catch (SSException applicationException)
            {
                response = new GetDCNumberForScSendingResponseDto
                {
                    ServiceResponseStatus = 0,
                    ErrorMessage          = applicationException.Message,
                    ErrorCode             = applicationException.ExceptionCode
                };
            }
            catch (Exception exception)
            {
                response = new GetDCNumberForScSendingResponseDto
                {
                    ServiceResponseStatus = 0,
                    ErrorCode             = ExceptionAttributes.ExceptionCodes.InternalServerError,
                    ErrorMessage          = exception.Message
                };
            }

            return(response);
        }
        public GetDCNumberForScSendingResponseDto GetDCNumber(int DcNumberFor)
        {
            var response = new GetDCNumberForScSendingResponseDto();

            var model = subContractRepository.GetSCSendingDCNumber(DcNumberFor);

            var currentYear = Helper.CurrentFiniancialYear();

            if (DcNumberFor == 1)
            {
                if (!string.IsNullOrEmpty(model))
                {
                    var savedYear = Convert.ToString(model.ToString().Substring(2, 2));
                    //var currentYear = Convert.ToString(DateTime.UtcNow.Year.ToString().Substring(2, 2));

                    if (!savedYear.Equals(currentYear))
                    {
                        response.DCNumber = "SS" + Convert.ToString(currentYear + "0001");
                    }
                    else
                    {
                        var dcType       = "SS";
                        var workOrderInc = Int32.Parse(model.ToString().Substring(2, 6)) + 1;
                        response.DCNumber = Convert.ToString(dcType + workOrderInc);
                    }
                }
                else
                {
                    response.DCNumber = "SS" + Convert.ToString(currentYear + "0001");
                }
            }
            else if (DcNumberFor == 2)
            {
                if (!string.IsNullOrEmpty(model))
                {
                    var savedYear = Convert.ToString(model.ToString().Substring(2, 2));
                    //var currentYear = Convert.ToString(DateTime.UtcNow.Year.ToString().Substring(2, 2));

                    if (!savedYear.Equals(currentYear))
                    {
                        response.DCNumber = "SR" + Convert.ToString(currentYear + "0001");
                    }
                    else
                    {
                        var dcType       = "SR";
                        var workOrderInc = Int32.Parse(model.ToString().Substring(2, 6)) + 1;
                        response.DCNumber = Convert.ToString(dcType + workOrderInc);
                    }
                }
                else
                {
                    response.DCNumber = "SR" + Convert.ToString(currentYear + "0001");
                }
            }

            return(response);
        }