public void AutoCodeGenerate()
        {
            decimal AlreadyExistData = _CategoriesRepository.AlreadyExistData();
            int     code             = 1;

            if (AlreadyExistData >= 1)
            {
                var GetLastCode = _CategoriesRepository.GetLastCode();
                if (GetLastCode != null)
                {
                    code = Convert.ToInt32(GetLastCode.Code);
                    code++;
                }
                txtCode.Text = code.ToString("000");
            }
            else
            {
                txtCode.Text = "001";
            }
        }
Exemple #2
0
 public decimal AlreadyExistData()
 {
     return(_CategoriesRepository.AlreadyExistData());
 }