예제 #1
0
        }        //MnuItemAddDiagnosisDetailsClick

        void MnuItemCatogeryListClick(object sender, EventArgs e)
        {
            frmCatogeryList frmTmp = new frmCatogeryList();

            frmTmp.Show();
            frmTmp.setConnectionReferenceNLoadData(this.myConn);
            frmTmp.MdiParent = this;
            frmTmp           = null;
        }        //MnuItemCatogeryListClick
예제 #2
0
        }        //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
예제 #3
0
        }        //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
예제 #4
0
        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
        }
예제 #5
0
 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();
 }
예제 #6
0
 void MnuItemCatogeryListClick(object sender, EventArgs e)
 {
     frmCatogeryList frmTmp = new frmCatogeryList();
     frmTmp.Show();
     frmTmp.setConnectionReferenceNLoadData(this.myConn);
     frmTmp.MdiParent =this;
     frmTmp = null;
 }