コード例 #1
0
 private string SinhMaTuDong()
 {
     try
     {
         string code = "";
         QueriesTableAdapter queries = new QueriesTableAdapter();
         string numbermax            = queries.GetMaBanThangMax().ToString();
         if (numbermax != "")
         {
             int temp = int.Parse(numbermax) + 1;
             code = "000" + temp;
             code = "LBT" + code.Substring(code.Length - 3);
         }
         else
         {
             code = "LBT001";
         }
         return(code);
     }
     catch (Exception)
     {
     }
     return(null);
 }
コード例 #2
0
        private string SinhMaTuDong()
        {
            try
            {
                string code = "";
                QueriesTableAdapter queries = new QueriesTableAdapter();
                string numbermax = queries.GetMaBanThangMax().ToString();
                if (numbermax != "")
                {

                    int temp = int.Parse(numbermax) + 1;
                    code = "0000" + temp;
                    code = "BT" + code.Substring(code.Length - 4);
                }
                else
                {
                    code = "BT0001";
                }
                return code;

            }
            catch (Exception)
            {

            }
            return null;
        }