private void ClearTextControl() { TxtMobile.Text = TxtEmail.Text = TxtAddr.Text = TxtIdx.Text = TxtNames.Text = ""; CboLevels.SelectedIndex = -1; TxtIdx.ReadOnly = true; TxtNames.Focus(); }
private void TxtDivision_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { TxtNames.Focus(); } }
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(); TxtNames.Text = data.Cells[1].Value.ToString(); //장르 콤보박스 //로맨스, 추리 등 디스플레이되는 글자로 인덱스찾기 //CboDivision.SelectedIndex = CboDivision.FindString(data.Cells[3].Value.ToString()); //코드값을 그대로 할당하는 방법 b001,b002 CboLvDivision.SelectedValue = data.Cells[2].Value; TxtAddr.Text = data.Cells[3].Value.ToString(); //TODO : 출간일 날짜픽커Cells[5] //DtRealeasDate.CustomFormat = "yyyy-MM-dd"; //DtRealeasDate.Format = DateTimePickerFormat.Custom; //DtRealeasDate.Value = DateTime.Parse(data.Cells[5].Value.ToString()); TxtMobile.Text = data.Cells[4].Value.ToString(); TxtEmail.Text = data.Cells[5].Value.ToString(); TxtIdx.ReadOnly = true; //pk값 수정 못하게 막기 TxtNames.Focus(); myMode = BaseMode.UPDATE; //수정모드 변경 } }
private void BtnNew_Click(object sender, EventArgs e) { InitControls(); myMode = BtnMode.INSERT; // 신규입력 모드 TxtNames.Focus(); }
private void ClearTextControls() { TxtIdx.Text = TxtNames.Text = TxtEmail.Text = TxtAddr.Text = TxtMobile.Text = ""; CboLevels.SelectedIndex = -1; //이거 필수 레벨 설정하는거랑 관련해서 -1부터 시작!!!1 TxtIdx.ReadOnly = true; TxtIdx.BackColor = Color.Beige; TxtNames.Focus(); }
private void ClearTextControls() { TxtIdx.Text = TxtNames.Text = Txtaddr.Text = TxtMobile.Text = TxtEmail.Text = ""; CboLevels.SelectedIndex = -1; TxtIdx.ReadOnly = true; // 신규눌렀을때 순번은 신경쓸필요 ㄴ TxtIdx.BackColor = Color.Beige; TxtNames.Focus(); // 그래서 포커스를 이름란으로 가게끔 }
private void ClearTextControls() { TxtIdx.Text = TxtNames.Text = TxtMobile.Text = TxtAddr.Text = TxtEmail.Text = ""; CboLevels.SelectedIndex = -1; TxtIdx.ReadOnly = true; //txtIdx는 자동 증가 TxtIdx.BackColor = Color.Beige; TxtNames.Focus(); }
private void ClearTextControls() { TxtIdx.Text = TxtAdr.Text = TxtMobile.Text = TxtEmail.Text = TxtNames.Text = string.Empty; CboLevels.SelectedIndex = -1; TxtIdx.ReadOnly = true; TxtIdx.BackColor = Color.White; TxtNames.Focus(); }
private void BtnNew_Click(object sender, EventArgs e) { InitControls(); TxtDivision.ReadOnly = false; myMode = BtnMode.INSERT; // 신규입력 모드 TxtNames.Focus(); }
/// <summary> /// 입력창 초기화 /// </summary> private void ClearTextControls() { TxtIdx.Text = ""; TxtNames.Text = ""; TxtAddr.Text = ""; TxtEmail.Text = ""; TxtMobile.Text = ""; CboLevels.SelectedIndex = -1;// 아무것도 선택안함 TxtNames.Focus(); }
private void ClearTextControls() { TxtISBN.Text = TxtNames.Text = TxtPrice.Text = TxtIdx.Text = TxtAuthor.Text = ""; CboDivision.SelectedIndex = -1; TxtIdx.ReadOnly = true; TxtIdx.BackColor = Color.Beige; TxtNames.Focus(); DtpReleaseDate.CustomFormat = " "; DtpReleaseDate.Format = DateTimePickerFormat.Custom; }
/* * private void DeleteProcess() * { * try * { * using (MySqlConnection conn = new MySqlConnection(Commons.CONNSTR)) * { * conn.Open();//커넥션오픈,using쓰면 자동으로 conn.close();해줌 * MySqlCommand cmd = new MySqlCommand(); * cmd.Connection = conn; * cmd.CommandText = "DELETE FROM divtbl " + * " WHERE Division = @Division "; * * MySqlParameter paramDivision = new MySqlParameter("@Division", MySqlDbType.VarChar); * paramDivision.Value = TxtDivision.Text; * cmd.Parameters.Add(paramDivision); * * var result = cmd.ExecuteNonQuery(); * * MetroMessageBox.Show(this, $"{result}건이 삭제되었습니다.", "삭제"); * } * } * catch (Exception ex) * { * MetroMessageBox.Show(this, $"에러발생{ex.Message}", "에러", MessageBoxButtons.OK, MessageBoxIcon.Error); * throw; * } * finally * { * * } * } */ #endregion private void BtnNew_Click(object sender, EventArgs e) { /* * TxtIdx.Text = TxtNames.Text = string.Empty; //모두 빈칸 * TxtIdx.ReadOnly = false; //리드온리 켜뒀던걸 꺼주기, 데이터 입력해야하기때문 */ InitControls(); mymode = BaseMode.INSERT;//신규입력모드 TxtNames.Focus(); }
private void GrdDivTbl_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex > -1) { DataGridViewRow data = GrdDivTbl.Rows[e.RowIndex]; TxtDivision.Text = data.Cells[0].Value.ToString(); TxtNames.Text = data.Cells[1].Value.ToString(); TxtDivision.ReadOnly = true; //pk값 수정 못하게 막기 TxtNames.Focus(); myMode = BaseMode.UPDATE; //수정모드 변경 } }
private void GrdBooksTbl_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex > -1) { DataGridViewRow data = GrdBooksTbl.Rows[e.RowIndex]; TxtIdx.Text = data.Cells[0].Value.ToString(); TxtNames.Text = data.Cells[1].Value.ToString(); //로맨스,추리등 디스플레이되는 글자로 인덱스 찾기 CboLevel.SelectedIndex = CboLevel.FindString(data.Cells[2].Value.ToString()); //코드값을 그대로 할당하는 방법 //CboLevel.SelectedValue = data.Cells[2].Value.ToString(); TxtAddr.Text = data.Cells[3].Value.ToString(); TxtMobile.Text = data.Cells[4].Value.ToString(); TxtEmail.Text = data.Cells[5].Value.ToString(); TxtNames.Focus(); myMode = BaseMode.UPDATE; } }