示例#1
0
 private string SinhMaTuDong_San()
 {
     try
     {
         string code = "";
         QueriesTableAdapter queries = new QueriesTableAdapter();
         string numbermax            = queries.GetMaSanMax().ToString();
         if (numbermax != "")
         {
             int temp = int.Parse(numbermax) + 1;
             code = "0000" + temp;
             code = "SA" + code.Substring(code.Length - 4);
         }
         else
         {
             code = "SA0001";
         }
         return(code);
     }
     catch (Exception)
     {
     }
     return(null);
 }
        private string SinhMaTuDong_San()
        {

            try
            {
                string code = "";
                QueriesTableAdapter queries = new QueriesTableAdapter();
                string numbermax = queries.GetMaSanMax().ToString();
                if (numbermax != "")
                {

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

            }
            catch (Exception)
            {
            }
            return null;
        }