private void button_OnOK_Click(object sender, EventArgs e) { this.dataGridView_Data.CurrentCell = null; Class_QC.myAdapter.Update(this.myDataTable_Modified); Class_UpdateLog.UpdateLog(Enum_zwjKindofUpdate.Modify, "Exam_QC", "--", Class_zwjPublic.myClass_CustomUser.UserGUID, "批量修改证书信息"); }
private void button_OnOK_Click(object sender, EventArgs e) { if (this.bool_Update) { this.dataGridView_Data.CurrentCell = null; Class_SubjectPositionResult.myAdapter.Update(this.myDataTable_Modified); Class_UpdateLog.UpdateLog(Enum_zwjKindofUpdate.Modify, "Exam_SubjectPositionResult", this.str_IssueNo, Class_zwjPublic.myClass_CustomUser.UserGUID, "批量输入成绩"); } }
/// <summary> /// 集成数据添加和修改的统一函数 /// </summary> /// <param name="myEnum_zwjKindofUpdate"></param> /// <returns></returns> public bool AddAndModify(Enum_zwjKindofUpdate myEnum_zwjKindofUpdate) { SqlCommand myCmd_Temp = new SqlCommand(null, Class_zwjPublic.myClass_SqlConnection.mySqlConn); myCmd_Temp.CommandText = "SignUp_KindofEmployerStudent_Update"; myCmd_Temp.CommandType = CommandType.StoredProcedure; ParametersAdd(myCmd_Temp.Parameters, myEnum_zwjKindofUpdate); Class_zwjPublic.myClass_SqlConnection.SetConnectionState(true); myCmd_Temp.ExecuteNonQuery(); Class_zwjPublic.myClass_SqlConnection.SetConnectionState(false); this.KindofEmployerStudentID = (int)myCmd_Temp.Parameters["@KindofEmployerStudentID"].Value; Class_UpdateLog.UpdateLog(myEnum_zwjKindofUpdate, "SignUp_KindofEmployerStudent", string.Format("{0}, {1}, {2}", this.KindofEmployerStudentID, this.KindofEmployerIssueID, this.KindofEmployerWelderID), Class_zwjPublic.myClass_CustomUser.UserGUID, ""); return(true); }
private void button_Delete_Click(object sender, EventArgs e) { if (this.comboBox_KindofSynchronization.SelectedIndex == 0) { myClass_KindofEmployer.GetDataTable_Synchronization(Enum_zwjKindofUpdate.Delete, true, true); Class_UpdateLog.UpdateLog(Enum_zwjKindofUpdate.Modify, "Person_WelderBelong", this.myClass_KindofEmployer.KindofEmployer, Class_zwjPublic.myClass_CustomUser.UserGUID, "同步删除数据"); } else { myClass_KindofEmployer.GetDataTable_Synchronization(Enum_zwjKindofUpdate.Delete, false, true); Class_UpdateLog.UpdateLog(Enum_zwjKindofUpdate.Modify, "SignUp_KindofEmployerWelder", this.myClass_KindofEmployer.KindofEmployer, Class_zwjPublic.myClass_CustomUser.UserGUID, "同步删除数据"); } this.InitDataGridView(); this.bool_Updated = true; }
private void button_OnOK_Click(object sender, EventArgs e) { //this.dataGridView_Modified.CurrentCell = this.dataGridView_Modified.Rows[this.dataGridView_Modified.RowCount-1].Cells[this.dataGridView_Modified.Columns.Count - 1]; this.dataGridView_Modified.CurrentCell = null; if (this.bool_GXTheory) { Class_GXTheoryStudent.myAdapter.Update(this.myDataTable_Modified); Class_UpdateLog.UpdateLog(Enum_zwjKindofUpdate.Modify, "Exam_GXTheoryStudent", this.str_IssueNo, Class_zwjPublic.myClass_CustomUser.UserGUID, "批量修改学员信息"); } else { Class_Student.myAdapter.Update(this.myDataTable_Modified); Class_UpdateLog.UpdateLog(Enum_zwjKindofUpdate.Modify, "Exam_Student", this.str_IssueNo, Class_zwjPublic.myClass_CustomUser.UserGUID, "批量修改学员信息"); } }
private void button_Modify_Click(object sender, EventArgs e) { if (this.comboBox_KindofSynchronization.SelectedIndex == 0) { myClass_KindofEmployer.GetDataTable_Synchronization(Enum_zwjKindofUpdate.Modify, true, true); Class_UpdateLog.UpdateLog(Enum_zwjKindofUpdate.Modify, "Person_WelderBelong", this.myClass_KindofEmployer.KindofEmployer, Class_zwjPublic.myClass_CustomUser.UserGUID, "同步修改数据"); } else { myClass_KindofEmployer.GetDataTable_Synchronization(Enum_zwjKindofUpdate.Modify, false, true); Class_UpdateLog.UpdateLog(Enum_zwjKindofUpdate.Modify, "SignUp_KindofEmployerWelder", this.myClass_KindofEmployer.KindofEmployer, Class_zwjPublic.myClass_CustomUser.UserGUID, "同步修改数据"); } this.InitDataGridView(); this.bool_Updated = true; MessageBox.Show("修改数据结束!"); //foreach (DataRow myDataRow in this.myDataTable_Modify.Rows) //{ // if (this.comboBox_KindofSynchronization.SelectedIndex == 0) // { // Class_Welder myClass_Welder = new Class_Welder(myDataRow["IdentificationCard"].ToString()); // myClass_Welder.WelderName = myDataRow["WelderName"].ToString(); // myClass_Welder.myClass_BelongUnit.EmployerHPID = myDataRow["WelderEmployerHPID"].ToString(); // myClass_Welder.myClass_BelongUnit.DepartmentHPID = myDataRow["WelderDepartmentHPID"].ToString(); // myClass_Welder.myClass_BelongUnit.WorkPlaceHPID = myDataRow["WelderWorkPlaceHPID"].ToString(); // myClass_Welder.myClass_BelongUnit.LaborServiceTeamHPID = myDataRow["WelderLaborServiceTeamHPID"].ToString(); // myClass_Welder.myClass_BelongUnit.WorkerID = myDataRow["WelderWorkerID"].ToString(); // myClass_Welder.AddAndModify(Enum_zwjKindofUpdate.Modify); // } // else // { // Class_KindofEmployerWelder myClass_KindofEmployerWelder = new Class_KindofEmployerWelder(Class_KindofEmployerWelder.GetKindofEmployerWelderID(myDataRow["KindofEmployer"].ToString(),myDataRow["IdentificationCard"].ToString())); // myClass_KindofEmployerWelder.WelderName = myDataRow["WelderName"].ToString(); // myClass_KindofEmployerWelder.AddAndModify(Enum_zwjKindofUpdate.Modify); // } //} //this.InitDataGridView(); //this.bool_Updated = true; }
/// <summary> /// 集成数据删除、判断是否可以删除和判断是否存在的统一函数 /// </summary> /// <param name="KindofEmployerStudent"></param> /// <param name="myEnum_zwjKindofUpdate"></param> /// <returns></returns> static public bool ExistAndCanDeleteAndDelete(int KindofEmployerIssueID, Enum_zwjKindofUpdate myEnum_zwjKindofUpdate) { if (myEnum_zwjKindofUpdate == Enum_zwjKindofUpdate.Delete) { Class_KindofEmployerIssue myClass_KindofEmployerIssue = new Class_KindofEmployerIssue(KindofEmployerIssueID); Class_UpdateLog.UpdateLog(myEnum_zwjKindofUpdate, "SignUp_KindofEmployerIssue", string.Format("{0}, {1}, {2}", KindofEmployerIssueID, myClass_KindofEmployerIssue.KindofEmployer, myClass_KindofEmployerIssue.IssueNo), Class_zwjPublic.myClass_CustomUser.UserGUID, ""); } SqlCommand myCmd_Temp = new SqlCommand(null, Class_zwjPublic.myClass_SqlConnection.mySqlConn); myCmd_Temp.CommandText = "SignUp_KindofEmployerIssue_Update"; myCmd_Temp.CommandType = CommandType.StoredProcedure; Class_KindofEmployerIssue.ParametersAdd(myCmd_Temp.Parameters, KindofEmployerIssueID, myEnum_zwjKindofUpdate); Class_zwjPublic.myClass_SqlConnection.SetConnectionState(true); myCmd_Temp.ExecuteNonQuery(); Class_zwjPublic.myClass_SqlConnection.SetConnectionState(false); if ((int)myCmd_Temp.Parameters["@ReturnNum"].Value > 0) { if (myEnum_zwjKindofUpdate == Enum_zwjKindofUpdate.Exist) { return(true); } else { return(false); } } else { if (myEnum_zwjKindofUpdate == Enum_zwjKindofUpdate.Exist) { return(false); } else { return(true); } } }