} //MnuItemAddDiagnosisDetailsClick void MnuItemCatogeryListClick(object sender, EventArgs e) { frmCatogeryList frmTmp = new frmCatogeryList(); frmTmp.Show(); frmTmp.setConnectionReferenceNLoadData(this.myConn); frmTmp.MdiParent = this; frmTmp = null; } //MnuItemCatogeryListClick
} //BtnResetClick void BtnCloseClick(object sender, System.EventArgs e) { if (iWorkMode == ENUM_MODE_ADDNEW_OUTSIDE || iWorkMode == ENUM_MODE_EDIT) { frmCatogeryList frmTmp = new frmCatogeryList(); frmTmp.setConnectionReferenceNLoadData(this.refCon); frmTmp.MdiParent = this.MdiParent; frmTmp.Show(); frmTmp = null; } this.Close(); } //BtnCloseClick
} //BtnCloseClick void BtnOKClick(object sender, System.EventArgs e) { OleDbCommand myCom; string strSQL; if (this.txtCatogeryName.Text.Length <= 0) { MessageBox.Show(ERR_CATEGORY_NAME_EMPTY, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); txtCatogeryName.Focus(); return; } myCom = new OleDbCommand(); myCom.Connection = this.refCon; if (iWorkMode == ENUM_MODE_EDIT) { //edit an existing item frmCatogeryList frmTmp; strSQL = "UPDATE tblMasterInfor SET M_Name= '" + txtCatogeryName.Text.ToString() + "', M_Description ='" + txtCatogeryDescription.Text.ToString() + "' WHERE M_ID= " + strRefID + ";"; myCom.CommandText = strSQL; myCom.Connection = refCon; myCom.ExecuteNonQuery(); this.Close(); frmTmp = new frmCatogeryList(); frmTmp.setConnectionReferenceNLoadData(this.refCon); frmTmp.MdiParent = this.MdiParent; frmTmp.Show(); frmTmp = null; } //Add new mode else { strSQL = "INSERT INTO tblMasterInfor(M_Name, M_Type, M_Description) VALUES('" + txtCatogeryName.Text.ToString() + "', " + cboCatogeryType.SelectedIndex.ToString() + ", "; if (txtCatogeryDescription.Text.Length <= 0) { strSQL += "NULL );"; } else { strSQL += "'" + txtCatogeryDescription.Text.ToString() + "');"; } myCom.CommandText = strSQL; myCom.Connection = refCon; myCom.ExecuteNonQuery(); txtCatogeryName.Text = string.Empty; txtCatogeryDescription.Text = string.Empty; cboCatogeryType.SelectedIndex = this.iMode; } //if - else } //BtnOKClick
void BtnOKClick(object sender, System.EventArgs e) { OleDbCommand myCom ; string strSQL; if (this.txtCatogeryName.Text.Length<=0) { MessageBox.Show(ERR_CATEGORY_NAME_EMPTY, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); txtCatogeryName.Focus(); return; } myCom = new OleDbCommand(); myCom.Connection = this.refCon; if (iWorkMode == ENUM_MODE_EDIT) {//edit an existing item frmCatogeryList frmTmp; strSQL ="UPDATE tblMasterInfor SET M_Name= '"+ txtCatogeryName.Text.ToString() + "', M_Description ='" + txtCatogeryDescription.Text.ToString() + "' WHERE M_ID= " + strRefID + ";"; myCom.CommandText = strSQL; myCom.Connection = refCon; myCom.ExecuteNonQuery(); this.Close(); frmTmp = new frmCatogeryList(); frmTmp.setConnectionReferenceNLoadData(this.refCon); frmTmp.MdiParent =this.MdiParent; frmTmp.Show(); frmTmp = null; }//Add new mode else { strSQL ="INSERT INTO tblMasterInfor(M_Name, M_Type, M_Description) VALUES('" + txtCatogeryName.Text.ToString() + "', " + cboCatogeryType.SelectedIndex.ToString() + ", "; if (txtCatogeryDescription.Text.Length<=0) { strSQL += "NULL );"; }else strSQL+= "'" + txtCatogeryDescription.Text.ToString() + "');"; myCom.CommandText = strSQL; myCom.Connection = refCon; myCom.ExecuteNonQuery(); txtCatogeryName.Text = string.Empty; txtCatogeryDescription.Text = string.Empty; cboCatogeryType.SelectedIndex = this.iMode; }//if - else }
void BtnCloseClick(object sender, System.EventArgs e) { if (iWorkMode==ENUM_MODE_ADDNEW_OUTSIDE || iWorkMode==ENUM_MODE_EDIT) { frmCatogeryList frmTmp = new frmCatogeryList(); frmTmp.setConnectionReferenceNLoadData(this.refCon); frmTmp.MdiParent =this.MdiParent; frmTmp.Show(); frmTmp = null; } this.Close(); }
void MnuItemCatogeryListClick(object sender, EventArgs e) { frmCatogeryList frmTmp = new frmCatogeryList(); frmTmp.Show(); frmTmp.setConnectionReferenceNLoadData(this.myConn); frmTmp.MdiParent =this; frmTmp = null; }