Beispiel #1
0
        private string generateRFQNo(RFQModel model)
        {
            var    currentDocument = service.GetAll(AuthenticationHelper.CompanyId.Value, SessionHelper.SOBId).OrderByDescending(rec => rec.Id).FirstOrDefault();
            string newDocNo        = "";

            if (currentDocument != null)
            {
                int  outVal;
                bool isNumeric = int.TryParse(currentDocument.RFQNo, out outVal);
                if (isNumeric && currentDocument.RFQNo.Length == 8)
                {
                    newDocNo = (int.Parse(currentDocument.RFQNo) + 1).ToString();
                    return(newDocNo);
                }
            }

            //Create New DocNum..
            string yearDigit  = model.RFQDate.ToString("yy");
            string monthDigit = model.RFQDate.ToString("MM");
            string docNo      = int.Parse("1").ToString().PadLeft(4, '0');

            return(yearDigit + monthDigit + docNo);
        }
Beispiel #2
0
 public List <RequestForQuotation> GetAll()
 {
     return(_service.GetAll());
 }