private void CampaignFullyQtyAndSaleForm_Load(object sender, EventArgs e)
        {
            dateTimePickerStart.MinDate = DateTime.Now;
            SingletonProduct.Instance();
            SingletonPriority1.Instance();
            using (SSLsEntities db = new SSLsEntities())
            {
                int currentYear  = DateTime.Now.Year;
                int currentMonth = DateTime.Now.Month;
                var pro          = db.PriceSchedule.Where(w => w.CreateDate.Year == currentYear && w.CreateDate.Month == currentMonth).Count() + 1;

                string proCodeGen = SingletonThisBudgetYear.Instance().ThisYear.CodeYear + DateTime.Now.ToString("MM") + Library.GenerateCodeFormCount(pro, 3);
                textBoxProCode.Text = proCodeGen;
            }
        }
 private void textBoxUserCode_KeyUp(object sender, KeyEventArgs e)
 {
     switch (e.KeyCode)
     {
         case Keys.Enter:
             string userCode = textBoxUserCode.Text.Trim();
             var user = SingletonPriority1.Instance().Users.Where(w => w.Enable == true).ToList();
             var getUser = user.SingleOrDefault(w => w.Id == userCode);
             if (getUser == null)
             {
                 _User = null;
                 textBoxUserCode.Text = "";
                 textBoxUserName.Text = "";
                 return;
             }
             _User = getUser.Id;
             textBoxUserCode.Text = getUser.Id;
             textBoxUserName.Text = getUser.Name;
             break;
         default:
             break;
     }
 }