Esempio n. 1
0
 private string SinhMaTuDong()
 {
     try
     {
         string code = "";
         QueriesTableAdapter queries = new QueriesTableAdapter();
         string numbermax            = queries.GetMaTranDauMax().ToString();
         if (numbermax != "")
         {
             int temp = int.Parse(numbermax) + 1;
             code = "0000" + temp;
             code = "TD" + code.Substring(code.Length - 4);
         }
         else
         {
             code = "TD0001";
         }
         return(code);
     }
     catch (Exception)
     {
     }
     return(null);
 }