private void btnSave_Click(object sender, EventArgs e) { cdha_hen_Oracle O_henData = new cdha_hen_Oracle(); string s_thuchien = "0"; string s_noithuchien = cbarea.SelectedValue.ToString(); foreach (DataGridViewRow dr in ddsdaduyet.Rows) { s_thuchien = "0"; try { DataGridViewCell oCell = dr.Cells["TRAKQ"]; bool check = Convert.ToBoolean(oCell.Value); if (check == true && dr.Visible == true) { s_thuchien = "1"; } } catch { } string s_thoigian = dr.Cells["NGAY_HEN"].Value.ToString() + " " + mformat.f_GetTime(dr.Cells["GIO_HEN"].Value.ToString()); string s_id = dr.Cells["id_"].Value.ToString(); O_henData.f_update_thoigianhen(s_thoigian, s_thuchien, s_id, s_noithuchien); } f_loadDS(); }
private void btLuuChuyen_Click(object sender, EventArgs e) { cdha_hen_Oracle O_henData = new cdha_hen_Oracle(); string s_thuchien = "0"; string s_noithuchien = cbNoiChuyen.SelectedValue.ToString(); foreach (DataGridViewRow dr in ddsdaduyet.Rows) { DataGridViewCell oCellChon = dr.Cells["chon_"]; bool checkchon = false; try{ checkchon = Convert.ToBoolean(oCellChon.Value); }catch {} if (checkchon == true && dr.Visible == true) { s_thuchien = "0"; DataGridViewCell oCell = dr.Cells["TRAKQ"]; bool check = false; try { check = Convert.ToBoolean(oCell.Value); } catch { } if (check == true && dr.Visible == true) { s_thuchien = "1"; } string s_thoigian = string.Format("{0:dd/MM/yyyy} 00:00", dngaychuyen.Value); string s_id = dr.Cells["id_"].Value.ToString(); O_henData.f_update_thoigianhen(s_thoigian, s_thuchien, s_id, s_noithuchien); } } f_loadDS(); pnchuyen.Visible = false; }