Example #1
0
        private void TxtKolCode_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (txtKolName.Text != "")
                {
                    txtSetter.KeyDown(sender, e, btnFinish);
                    return;
                }

                if (e.KeyCode == Keys.Enter)
                {
                    frmShow_Kol f = new frmShow_Kol(true);
                    f.SearchText = txtKolCode.Text.Trim();
                    if (f.ShowDialog() == DialogResult.OK)
                    {
                        kol             = KolBussines.Get(f.SelectedGuid);
                        txtKolCode.Text = kol?.Code ?? "";
                        txtKolName.Text = kol?.Name ?? "";
                        if (moein.Guid == Guid.Empty)
                        {
                            NewCode(kol.Guid);
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                frmMessage frm = new frmMessage(EnumMessageFlag.ShowFlag, Color.Red, exception.Message);
                frm.ShowDialog();
            }
        }
Example #2
0
 private void BtnSearchKol_Click(object sender, EventArgs e)
 {
     try
     {
         frmShow_Kol f = new frmShow_Kol(true);
         if (f.ShowDialog() == DialogResult.OK)
         {
             kol             = KolBussines.Get(f.SelectedGuid);
             txtKolCode.Text = kol?.Code ?? "";
             txtKolName.Text = kol?.Name ?? "";
             if (moein.Guid == Guid.Empty)
             {
                 NewCode(kol.Guid);
             }
         }
     }
     catch (Exception exception)
     {
         frmMessage frm = new frmMessage(EnumMessageFlag.ShowFlag, Color.Red, exception.Message);
         frm.ShowDialog();
     }
 }