public ttCongMay(string _id_rowindex, qlCongMay _ql) { InitializeComponent(); SetDefault(); ql = _ql; if (!string.IsNullOrEmpty(_id_rowindex)) { idN1 = _id_rowindex.Split('_').GetValue(0).ToString(); rowindex = _id_rowindex.Split('_').GetValue(1).ToString(); btThem.Text = "Cập nhật"; DataTable dt = DA.Load_CongMay(new string[] { idN1 }); dtpNgayCong.Value = DateTime.ParseExact(dt.Rows[0][1].ToString(), "MM/dd/yyyy", CultureInfo.InvariantCulture); ; cbCongviec.SelectedValue = dt.Rows[0][2].ToString(); txtSanpham.Text = dt.Rows[0][3].ToString(); txtDonGia.Text = dt.Rows[0][4].ToString(); cbKhoVai.SelectedValue = dt.Rows[0][5].ToString(); cbTho1.SelectedValue = dt.Rows[0][6].ToString(); txtGio1.Text = dt.Rows[0][7].ToString(); txtGia1.Text = dt.Rows[0][8].ToString(); cbTho2.SelectedValue = dt.Rows[0][9].ToString(); txtGio2.Text = dt.Rows[0][10].ToString(); txtGia2.Text = dt.Rows[0][11].ToString(); txtGhichu.Text = dt.Rows[0][12].ToString(); } }
private void bt_qlCongN1_Click(object sender, EventArgs e) { ActiveForm.Hide(); var ql = new qlCongMay(); ql.Show(); }