private void btn_dele_Click(object sender, EventArgs e) { string workno; DateTime tempdate; if (!grd_data.has_selectrow()) { MessageBox.Show("请先选择一条 转出 记录"); return; } if (grd_data.get_value(1).ToString().IndexOf("转出") < 0) { MessageBox.Show("请先选择一条 转出 记录"); return; } forms.frm_删除转出 frm = new frm_删除转出(); 转出类DAL mycls = new 转出类DAL(); if (frm.show_window() == true) { string temp_date; temp_date = grd_data.get_value(1).ToString(); //mycls.dele_date(grd_data.get_value(0).ToString(), new DateTime(int.Parse(temp_date.Substring(0, 4)), int.Parse(temp_date.Substring(5, 2)), 15), deptcode); tempdate = new DateTime(int.Parse(temp_date.Substring(0, 4)), int.Parse(temp_date.Substring(5, 2)), 15); workno = grd_data.get_value(0).ToString(); 转出类DAL dal = new 转出类DAL(); dal.del_data(workno, tempdate, deptcode); //mycls.dele_date(grd_data.get_value(0).ToString(), new DateTime(int.Parse(tempdate.Substring(0, 4)), int.Parse(tempdate.Substring(5, 2)), 15)); //button1_Click(sender, e); } }
private void dele_date(string workno, DateTime mydate, int deptcode) { 转出类DAL dal = new 转出类DAL(); dal.del_data(workno, mydate, deptcode); }