private void toolEdit_Click(object sender, EventArgs e) { /* * DateTime d1 = dateTimePicker1.Value; * DateTime d2 = getDate( ).AddDays( -1 ); * if ( !( DateTime.Now.AddDays( -1 ) <= dateTimePicker1.Value ) ) * { * MessageBox.Show( "只能编辑当天及前一天的记录" ); * return; * } */ if (string.IsNullOrEmpty(gridView1.GetFocusedRowCellValue("idx").ToString())) { MessageBox.Show("请选择需要编辑的内容"); return; } //if ( !_bll.ExistsOfMax( lookUpEdit3.Text ,textBox30.Text ) ) //{ // MessageBox.Show( "只允许更改本工单最后一道工序" ); // return; //} toolEdit.Enabled = toolQuery.Enabled = toolAdd.Enabled = false; toolSave.Enabled = toolCancel.Enabled = true; StateOfControl.SpliEnableTrue(splitContainer1); dateTimePicker1.Enabled = false; sign = "2"; }
private void toolAdd_Click(object sender, EventArgs e) { toolEdit.Enabled = toolQuery.Enabled = toolAdd.Enabled = false; toolClear.Enabled = toolSave.Enabled = toolCancel.Enabled = true; StateOfControl.SpliEnableTrue(splitContainer1); StateOfControl.SpliClear(splitContainer1); dateTimePicker1.Enabled = false; dateTimePicker1.Value = getDate( ); sign = "1"; button11_Click(null, null); }