Ejemplo n.º 1
0
 private void TxtDivision_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 13)
     {
         TxtAuthor.Focus();
     }
 }
Ejemplo n.º 2
0
        private void GrdDivTbl_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex > -1)
            {
                DataGridViewRow data = GrdBooksTbl.Rows[e.RowIndex];
                //TODO : 클릭 시 입력컨트롤에 데이터 할당
                TxtIdx.Text    = data.Cells[0].Value.ToString();
                TxtAuthor.Text = data.Cells[1].Value.ToString();

                //장르 콤보박스
                //로맨스, 추리 등 디스플레이되는 글자로 인덱스찾기
                //CboDivision.SelectedIndex = CboDivision.FindString(data.Cells[3].Value.ToString());
                //코드값을 그대로 할당하는 방법 b001,b002
                CboDivision.SelectedValue = data.Cells[2].Value;

                TxtNames.Text = data.Cells[4].Value.ToString();

                //TODO : 출간일 날짜픽커Cells[5]
                DtRealeasDate.CustomFormat = "yyyy-MM-dd";
                DtRealeasDate.Format       = DateTimePickerFormat.Custom;
                DtRealeasDate.Value        = DateTime.Parse(data.Cells[5].Value.ToString());


                TxtIsbn.Text  = data.Cells[6].Value.ToString();
                TxtPrice.Text = data.Cells[7].Value.ToString();

                TxtIdx.ReadOnly = true;        //pk값 수정 못하게 막기
                TxtAuthor.Focus();

                myMode = BaseMode.UPDATE;   //수정모드 변경
            }
        }
Ejemplo n.º 3
0
        private void InitControls()
        {
            TxtIdx.Clear();
            TxtAuthor.Clear();
            TxtNames.Clear();
            TxtIsbn.Clear();
            TxtPrice.Clear();
            CboDivision.SelectedIndex = 0;
            DtReleaseDate.Value       = DateTime.Today;

            TxtIdx.Focus();

            baseMode = BaseMode.NONE;

            #region comboBox Dictionary

            /*Dictionary<string, string> dic = new Dictionary<string, string>
             * {
             *  { "선택", "00" },
             *  { "서울특별시", "11" },
             *  { "부산광역시", "21" },
             *  { "대구광역시", "22" },
             *  { "인천광역시", "23" },
             *  { "광주광역시", "24" },
             *  { "대전광역시", "25" }
             * };
             *
             * CboDivision.DataSource = new BindingSource(dic, null);
             * CboDivision.DisplayMember = "Key";
             * CboDivision.ValueMember = "Value";*/
            #endregion
        }
 private void Clear()
 {
     TxtBookName.Clear();
     TxtAuthor.Clear();
     TxtCount.Clear();
     TxtRentalPrice.Clear();
     CmbGenre.SelectedItem = null;
 }
Ejemplo n.º 5
0
 private void ClearTextControls()
 {
     TxtIdx.Text = TxtAuthor.Text = TxtNames.Text = TxtISBN.Text = "";
     CboDivision.SelectedIndex = -1;
     TxtIdx.ReadOnly           = true; //txtIdx는 자동 증가
     TxtIdx.BackColor          = Color.Beige;
     TxtAuthor.Focus();
 }
Ejemplo n.º 6
0
        private void BtnNew_Click(object sender, EventArgs e)
        {
            InitControls();

            myMode = BtnMode.INSERT; // 신규입력 모드

            TxtAuthor.Focus();
        }
Ejemplo n.º 7
0
 private void ClearTextControls()
 {
     TxtPrice.Text             = TxtISBN.Text = TxtNames.Text = TxtIdx.Text = TxtAuthor.Text = "";
     TxtIdx.ReadOnly           = true;
     CboDivision.SelectedIndex = -1;
     TxtIdx.BackColor          = Color.Beige;
     TxtAuthor.Focus();
     DtpReleaseDate.CustomFormat = " ";
     DtpReleaseDate.Format       = DateTimePickerFormat.Custom;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 입력창 초기화
 /// </summary>
 private void ClearTextControls()
 {
     TxtIdx.Text                 = "";
     TxtAuthor.Text              = "";
     TxtNames.Text               = "";
     TxtISBN.Text                = "";
     TxtPrice.Text               = "";
     CboDivision.SelectedIndex   = -1;  // 아무것도 선택안함
     DtpReleaseDate.CustomFormat = " "; //  공백이 한칸 들어가야함
     DtpReleaseDate.Format       = DateTimePickerFormat.Custom;
     TxtAuthor.Focus();
 }
Ejemplo n.º 9
0
        private void ClearTextControls()
        {
            TxtIdx.Text            = TxtAuthor.Text = TxtISBN.Text = TxtNames.Text = DtpReleaseDate.Text = "";
            TxtPrice.Text          = "";
            CboNames.SelectedIndex = -1; //이거 필수 레벨 설정하는거랑 관련해서 -1부터 시작!!!1
            TxtIdx.ReadOnly        = true;
            TxtIdx.BackColor       = Color.Beige;

            DtpReleaseDate.CustomFormat = " ";
            DtpReleaseDate.Format       = DateTimePickerFormat.Custom; // 값을 리셋해주는 방법

            TxtAuthor.Focus();
        }