示例#1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            foreach (Control obj in pnl_productManager.Controls)
            {
                if (obj is TextBox)
                {
                    if (obj.Text == "")
                    {
                        MessageBox.Show("Action connot be perform. All fields are required to be fill up.", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                }
            }


            sql = "SELECT ITEMID FROM items WHERE ITEMID='" + itemID.Text + "'";
            config.singleResult(sql);
            if (config.dt.Rows.Count > 0)
            {
                sql = "UPDATE items SET qty =qty + '" + quantity.Text + "' WHERE ITEMID ='" + itemID.Text + "'";
                config.Execute_Query(sql);
            }
            else
            {
                sql = "insert into items  (ITEMID,`NAME`, `DESCRIPTION`, `TYPE`, `PRICE`, `QTY`,UNIT)" +
                      "VALUES ('" + itemID.Text + "','" + name.Text + "','" + description.Text + "','" + type.Text
                      + "','" + price.Text + "','" + quantity.Text + "','" + units.Text + "' )";
                config.Execute_CUD(sql, "No data saved.", "Data has been saved in the database.");

                config.update_Autonumber(type.Text);
            }

            btnNew_Click(sender, e);
        }
示例#2
0
        private void btnempsave_Click(object sender, EventArgs e)
        {
            if (txtcode.Text == "" || txtfname.Text == "" || txtlname.Text == "" || txtmname.Text == "" ||
                txtaddress.Text == "" || txtcontact.Text == "" || txtstatus.Text == "" || txtbplace.Text == "" ||
                txtage.Text == "" || txtemerg.Text == "" || txtdrate.Text == "" || txtposition.Text == "")
            {
                MessageBox.Show("One of the box is empty. Data is required.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                if (rdomale.Checked)
                {
                    rdo = "Male";
                }
                else
                {
                    rdo = "Female";
                }


                sql = "INSERT INTO `employee` (`emp_code`, `emp_fname`, `emp_lname`, `emp_mname`"
                      + ", `address`, `contact`, `status`, `birth_date`, `birth_place`, `emp_sex`, `emp_age`"
                      + ", `emerg_contct`) VALUES ('" + txtcode.Text + "','" + txtfname.Text + "','" + txtlname.Text
                      + "','" + txtmname.Text + "','" + txtaddress.Text + "'," + txtcontact.Text + ",'" + txtstatus.Text
                      + "','" + dtpdbirth.Text + "','" + txtbplace.Text + "','" + rdo + "'," + txtage.Text + ",'" + txtcontact.Text + "')";
                config.Execute_CUD(sql, "Error to execute.", "Data has been saved in the database.");

                sql = "INSERT INTO `employee_workinfo` (`emp_code`, `d_rate`, `p_method`, `position`, `w_status`, `d_hired`)"
                      + " VALUES ('" + txtcode.Text + "','" + txtdrate.Text + "','" + txtpmethod.Text + "','" + txtposition.Text
                      + "','" + txtworkstatus.Text + "','" + dtpdhired.Text + "')";
                config.Execute_Query(sql);

                btnempnew_Click(sender, e);
            }
        }
示例#3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txtPassword.Text == "" || txtUsername.Text == "")
            {
                MessageBox.Show("Fields are required", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            sql = "SELECT * FROM useraccounts WHERE USER_ID = '" + txtUserId.Text + "'";
            config.singleResult(sql);
            if (config.dt.Rows.Count > 0)
            {
                sql = "UPDATE `useraccounts` SET `UNAME`='" + txtName.Text + "', `USERNAME`='" + txtUsername.Text +
                      "', `PASS`=sha1('" + txtPassword.Text + "'), `USERTYPE`='" + cboType.Text + "' WHERE USER_ID='" + txtUserId.Text + "'";
                config.Execute_CUD(sql, "no data update.", "Data has been updated.");
            }
            else
            {
                sql = "insert into `useraccounts` (`USER_ID`, `UNAME`, `USERNAME`, `PASS`, `USERTYPE`)" +
                      "values ('" + txtUserId.Text + "','" + txtName.Text + "','" + txtUsername.Text +
                      "',sha1('" + txtPassword.Text + "'),'" + cboType.Text + "')";
                config.Execute_CUD(sql, "no save data", "Data has been saved in the database.");

                sql = "UPDATE `tblauto` SET `AutoEnd`=`AutoEnd`+1 WHERE `autoID`=1";
                config.Execute_Query(sql);
            }
            btnNew_Click(sender, e);
        }
示例#4
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (this.txtUsername.Text == "" || this.txtPassword.Text == "")
            {
                MessageBox.Show("Username and Password must be filled up", "Information !!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                txtUsername.Focus();
            }
            else
            {
                DialogResult dr = MessageBox.Show("Are you sure you want to add  " + txtUsername.Text + "  ?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (dr == DialogResult.Yes)
                {
                    try
                    {
                        rriteid();
                        sql = "insert into Users(Nr,Username,Password) values('" + txtid.Text + "','" + txtUsername.Text + "','" + this.Hash(System.Text.Encoding.UTF8.GetBytes(txtPassword.Text)) + "');";
                        config.Execute_CUD(sql, "Can`t add", "" + txtUsername.Text + " Username has been added");
                        Cursor.Current = Cursors.WaitCursor;
                        Thread.Sleep(800);
                        sql = "SELECT * FROM Users WHERE Username LIKE '%" + txtUsername.Text + "%'";
                        config.Load_DTG(sql, dgvUsernames);
                        designdatagridview();
                        dgvUsernames.Columns[0].Visible = false;
                        dgvUsernames.Columns[2].Visible = false;
                        txtPassword.Text = "";
                        txtUsername.Text = "";
                    }

                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }
            }
        }
示例#5
0
        private void btnadd_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtitemid.Text == "" || txtitemname.Text == "" || txtqty.Text == "" || txtwhole.Text == "" || txtretail.Text == "" || txtsell.Text == "" || txtprofit.Text == "")
                {
                    MessageBox.Show("Fill up all the Fields please!", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                else
                {
                    sql = "SELECT itemID FROM itemlist WHERE itemID='" + txtitemid.Text + "'";
                    config.singleResult(sql);
                    if (config.dt.Rows.Count > 0)
                    {
                        MessageBox.Show("Item exists with this ItemID", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    else
                    {
                        sql = "INSERT INTO itemlist  (`itemID`,`itemName`, `Qty`, `wholePrice`, `retailPrice`, `sellPrice`,`profit`)" +
                              "VALUES ('" + txtitemid.Text + "','" + txtitemname.Text + "','" + txtqty.Text + "','" + txtwhole.Text
                              + "','" + txtretail.Text + "','" + txtsell.Text + "','" + txtprofit.Text + "' )";
                        config.Execute_CUD(sql, "Error while saving!", "Data has been saved in the database.");

                        clear();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error while saving to database..." + Environment.NewLine + ex);
            }
        }
示例#6
0
 private void btnsave_Click(object sender, EventArgs e)
 {
     if (lbl_id.Text == "" ||
         txtname.Text == "" ||
         txtuser.Text == "" || txtpass.Text == "")
     {
         MessageBox.Show("One of the box is empty. Data is required.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     else
     {
         if (btnsave.Text == "Add")
         {
             sql = "INSERT INTO `user` (`name`,`username`, `pass`, `type` ) VALUES ('" + txtname.Text + "','"
                   + txtuser.Text + "',sha('" + txtpass.Text + "'),'" + cbotype.Text + "')";
             config.Execute_CUD(sql, "error to execute.", "Data has been saved in the database.");
         }
         else
         {
             sql = "UPDATE user set name='" + txtname.Text + "',username='******', pass = sha('" + txtpass.Text + "') Where user_id='" + lbl_id.Text + "'";
             config.Execute_CUD(sql, "error to execute.", "Data has been updated in the database.");
         }
         frm_user_Load(sender, e);
     }
 }
 private void tsDelete_Click(object sender, EventArgs e)
 {
     sql          = "DELETE FROM useraccounts WHERE  ACCOUNT_ID='" + dtglist.CurrentRow.Cells[0].Value + "'";
     messageTrue  = "User has beeen deleted.";
     messageFalse = "Failed to delete the user.";
     config.Execute_CUD(sql, messageFalse, messageTrue);
     tsNew_Click(sender, e);
 }
        private void tsSave_Click(object sender, EventArgs e)
        {
            if (rdoMale.Checked)
            {
                radioSEX = "MALE";
            }
            else
            {
                radioSEX = "FEMALE";
            }

            Nyesno = func.checkOption(chkBirthCert);
            Cyesno = func.checkOption(chkCertification);
            Pyesno = func.checkOption(chkPic);
            Ryesno = func.checkOption(chkReportCard);

            //'student(requirements)
            sql = "UPDATE  `tblrequirements` SET `NSO`='" + Nyesno + "', `PICID`='" + Pyesno + "', `REPORTCARD`='" + Ryesno
                  + "', `CERTIFICATE_OF_TRANSFER`='" + Cyesno + "' WHERE IDNO='" + txtStudentId.Text + "'";
            config.Execute_Query(sql);
            //'student basic info
            sql = "UPDATE tblstudent SET   `FNAME`='" + txtFName.Text + "', `LNAME`='" + txtLName.Text + "', `MNAME`='" + txtMName.Text
                  + "', `SEX`='" + radioSEX + "', `BDAY`='" + dtpDbirth.Text + "', `BPLACE`='" + txtPBirth.Text + "', `AGE`='" + txtAge.Text
                  + "', `HOME_ADD`='" + txtAddress.Text + "',GUARDIAN='" + txtguardian.Text + "',GUARDIAN_ADD ='" + txtguardianadd.Text
                  + "',GUARDIAN_TEL ='" + txtguardiantel.Text + "',`LASTSCHOOLATTEND`='" + txtLastSchoolAttend.Text
                  + "', WEIGTH='" + txtWeigth.Text + "',HEIGTH='" + txtHeight.Text + "' WHERE IDNO='" + txtStudentId.Text + "'";
            config.Execute_CUD(sql, "error to update the data", "Student information has been updated.");
        }
示例#9
0
 private void btn_saveuser_Click(object sender, EventArgs e)
 {
     if (txt_name.Text == "" || txt_pass.Text == "" || txt_username.Text == "")
     {
         MessageBox.Show("El campo debe ser llenado", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     else
     {
         sql = "insert into user (name,user_name,pass,type) "
               + "values('" + txt_name.Text + "','" + txt_username.Text
               + "',sha1('" + txt_pass.Text + "'),'" + cbo_type.Text
               + "')";
         config.Execute_CUD(sql, "No se puede guardar", "El Usuario se han regitrado correctamente.");
         frmUsers_Load(sender, e);
     }
 }
示例#10
0
 private void btn_saveuser_Click(object sender, EventArgs e)
 {
     if (txt_name.Text == "" || txt_pass.Text == "" || txt_username.Text == "")
     {
         MessageBox.Show("Field must be filled up", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     else
     {
         sql = "insert into user (name,user_name,pass,type) "
               + "values('" + txt_name.Text + "','" + txt_username.Text
               + "',sha1('" + txt_pass.Text + "'),'" + cbo_type.Text
               + "')";
         config.Execute_CUD(sql, "Unable to saved", "Data has been saved in the database.");
         frmUsers_Load(sender, e);
     }
 }
示例#11
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (txtpass.Text == "" || txtpass1.Text == "" || txtpass2.Text == "")
            {
                MessageBox.Show("Fill up all the Fields please!", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                sql = " SELECT * FROM users WHERE username = '******' ";
                config.singleResult(sql);
                string pass = config.dt.Rows[0].Field <string>("password");

                if (txtpass.Text == pass)
                {
                    if (txtpass1.Text == txtpass2.Text)
                    {
                        sql = "update users set password = '******' ";
                        config.Execute_CUD(sql, "Unable to update", "Data has been updated in the database.");
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Two passwords doesn't match!!", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                }
                else
                {
                    MessageBox.Show("Current password is wrong!", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
        }
 private void tsDelete_Click(object sender, EventArgs e)
 {
     sql          = "DELETE FROM `subject` WHERE `SUBJ_ID`='" + dtgList.CurrentRow.Cells[0].Value + "'";
     messageTrue  = "Subject has been deleted.";
     messageFalse = "Subject failed to delete.";
     config.Execute_CUD(sql, messageFalse, messageTrue);
     frmListofSubject_Load(sender, e);
 }
        private void btnSave_Click(object sender, EventArgs e)
        {
            string id = dtgList.CurrentRow.Cells[0].Value.ToString();
            string level;

            if (txtFullname.Text == "")
            {
                MessageBox.Show("Fill the name of the students.", "Action is Invalid", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            sql = "SELECT * FROM `tblstudupdatelevel` WHERE `IDNO` ='" + id + "'";
            config.singleResult(sql);
            if (config.dt.Rows.Count > 0)
            {
                level = config.dt.Rows[0].Field <string>("LEVEL");



                sql = "UPDATE `tblstudupdatelevel` SET  "
                      + "`LEVEL`='" + cboLevel.Text + "',SECTION = '" + cbosection.Text
                      + "' ,`AY`= '" + cbosy.Text + "' WHERE `IDNO`='" + id + "'";
                config.Execute_Query(sql);
            }
            else
            {
                sql = "INSERT INTO `tblstudupdatelevel` (`IDNO`, `LEVEL`,SECTION, `AY`) "
                      + "VALUES ('" + id + "','" + cboLevel.Text + "','"
                      + cbosection.Text + "','" + cbosy.Text + "')";
                config.Execute_Query(sql);
            }



            //            'for school year of student
            sql = "INSERT INTO `schoolyr` (`AY`, `YR`,SECTION, `IDNO`, `STATUS`) "
                  + "VALUES ('" + cbosy.Text + "','" + cboLevel.Text + "','"
                  + cbosection.Text + "','" + id + "','')";
            config.Execute_CUD(sql, "error to save", "Students has been enrolled.");



            sql = "SELECT * FROM `tblstudupdatelevel` l,`schoolyr`  sy, `subject` s "
                  + "WHERE  l.IDNO=sy.IDNO AND l.LEVEL = sy.YR AND sy.`YR` =s.`YR` AND sy.`IDNO` = '" + id + "'";
            config.singleResult(sql);
            if (config.dt.Rows.Count > 0)
            {
                foreach (DataRow r in config.dt.Rows)
                {
                    sql = "INSERT INTO `grades` (`IDNO`, `SUBJ_ID`, `SYID` ) "
                          + " VALUES ('" + id + "','" + r.Field <int>("SUBJ_ID") + "','" + r.Field <int>("SYID") + "')";
                    config.Execute_Query(sql);
                }
            }

            btnClear_Click(sender, e);
        }
示例#14
0
        private void uploadBtn_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog dialog = new OpenFileDialog()
            {
                Multiselect = false, Filter = "Word Document|*.doc;*.docx"
            })
            {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    byte[] bytes = File.ReadAllBytes(dialog.FileName);

                    string hex = BitConverter.ToString(bytes).Replace("-", String.Empty);

                    config.Execute_CUD("exec sp_AddReport '" + exp_id + "', '" + sct_id + "', '0x" + hex + "' ", "Failed to add report file.", "Report file is successfully added.");
                    config.Load_DTG("exec sp_ShowReportsInExp " + exp_id + " ", reportGridview);
                    reportGridview.Columns["Author"].Visible = false;
                }
            }
        }
示例#15
0
        private void btnsave_Click(object sender, EventArgs e)
        {
            foreach (Control obj in pnl_stockmaster.Controls)
            {
                if (obj is TextBox)
                {
                    if (obj.Text == "")
                    {
                        MessageBox.Show("No se puede realizar ninguna acción. Todos los campos deben completarse.", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                }
            }



            sql = "INSERT INTO  `tblstock_in_out` (`ITEMID`, `QTY`,`TRANSACTIONDATE`, `TOTALPRICE`, `REMARKS`)" +
                  " VALUES ('" + txtitemid.Text + "','" + txtqty.Text + "','" + DateTime.Now.ToString("yyyy-MM-dd") + "','" + txtprice.Text +
                  "','StockIn')";
            config.Execute_Query(sql);


            sql = "SELECT ITEMID FROM tblitems WHERE ITEMID='" + txtitemid.Text + "'";
            config.singleResult(sql);
            if (config.dt.Rows.Count > 0)
            {
                sql = "UPDATE tblitems SET qty =qty + '" + txtqty.Text + "' WHERE ITEMID ='" + txtitemid.Text + "'";
                config.Execute_Query(sql);
            }
            else
            {
                sql = "insert into tblitems  (ITEMID,`NAME`, `DESCRIPTION`, `TYPE`, `PRICE`, `QTY`,UNIT)" +
                      "VALUES ('" + txtitemid.Text + "','" + txtname.Text + "','" + txtdescription.Text + "','" + cbotype.Text
                      + "','" + txtprice.Text + "','" + txtqty.Text + "','" + cbounit.Text + "' )";
                config.Execute_CUD(sql, "No hay datos guardados.", "Los datos se han guardado en la base de datos.");

                config.update_Autonumber(cbotype.Text);
            }

            btnnew_Click(sender, e);
        }
        private void btnsave_Click(object sender, EventArgs e)
        {
            foreach (Control obj in pnl_stockmaster.Controls)
            {
                if (obj is TextBox)
                {
                    if (obj.Text == "")
                    {
                        MessageBox.Show("Action connot be perform. All fields are required to be fill up.", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                }
            }



            sql = "INSERT INTO  `tblstock_in_out` (`ITEMID`, `QTY`,`TRANSACTIONDATE`, `TOTALPRICE`, `REMARKS`)" +
                  " VALUES ('" + txtitemid.Text + "','" + txtqty.Text + "','" + DateTime.Now.ToString("yyyy-MM-dd") + "','" + txtprice.Text +
                  "','StockIn')";
            config.Execute_Query(sql);


            sql = "SELECT ITEMID FROM tblitems WHERE ITEMID='" + txtitemid.Text + "'";
            config.singleResult(sql);
            if (config.dt.Rows.Count > 0)
            {
                sql = "UPDATE tblitems SET qty =qty + '" + txtqty.Text + "' WHERE ITEMID ='" + txtitemid.Text + "'";
                config.Execute_Query(sql);
            }
            else
            {
                sql = "insert into tblitems  (ITEMID,`NAME`, `DESCRIPTION`, `TYPE`, `PRICE`, `QTY`,UNIT)" +
                      "VALUES ('" + txtitemid.Text + "','" + txtname.Text + "','" + txtdescription.Text + "','" + cbotype.Text
                      + "','" + txtprice.Text + "','" + txtqty.Text + "','" + cbounit.Text + "' )";
                config.Execute_CUD(sql, "No data saved.", "Data has been saved in the database.");

                config.update_Autonumber(cbotype.Text);
            }

            btnnew_Click(sender, e);
        }
示例#17
0
 private void tsSave_Click(object sender, EventArgs e)
 {
     if (txtsubjDesc.Text == "" || txtsujCode.Text == "")
     {
         MessageBox.Show("Empty fields must be filled up.", "Invalid Action", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     sql = "UPDATE `subject` SET `SUBJ_CODE`='" + txtsujCode.Text + "', `SUBJ_DESCRIPTION`='" + txtsubjDesc.Text + "', `YR`='"
           + cboYear.Text + "' WHERE SUBJ_ID ='" + txtSubjectID.Text + "'";
     messageTrue  = "Subject has been updated.";
     messageFalse = "Failed to update a sabject.";
     config.Execute_CUD(sql, messageFalse, messageTrue);
 }
示例#18
0
        private void btnsave_Click(object sender, EventArgs e)
        {
            if (txtItem.Text == "")
            {
                MessageBox.Show("Item field are required to be fill up.", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            else
            {
                try
                {
                    rriteid();

                    sql = "insert into tblreg(Nr,Item,Barcode,Serial,Manufacturer,Model,Owner,Comments,Date,Location) values('" + this.txtid.Text + "','" + this.txtItem.Text + "','" + this.txtBarcode.Text + "','" + this.txtSerial.Text + "','" + this.txtManufacturer.Text + "','" + this.txtModel.Text + "','" + this.cmbOwner.Text + "','" + this.txtComment.Text + "','" + this.txtDate.Text + "','" + this.cmbLocation.Text + "');";
                    config.Execute_CUD(sql, "No data saved.", "" + txtItem.Text + " Data has been saved in the database.");

                    Thread.Sleep(200);
                    navi("SELECT Nr from tblreg");
                    if (inc != maxrow)
                    {
                        inc         = maxrow;
                        lblinc.Text = inc.ToString();
                        inc         = maxrow - 1;
                        navi_records(inc);
                        Cursor.Current = Cursors.WaitCursor;
                        Thread.Sleep(100);
                        searchafter();
                    }
                }


                catch (System.Data.SqlClient.SqlException ex)
                {
                    if (ex.Number == 2627) /*  primary key violation */ } {
            }
        }
    }
示例#19
0
        private void tsSave_Click(object sender, EventArgs e)
        {
            if (txtStudentId.Text == "")
            {
                MessageBox.Show("One of the box is empty on the student details,You must fill it", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            //foreach(Control txt in GroupBox1.Controls)
            //{
            //    if(txt is TextBox)
            //    {
            //        MessageBox.Show("One of the box is empty on the student details,You must fill it", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //        return;
            //    }
            //}

            if (rdoMale.Checked)
            {
                radioSEX = "MALE";
            }
            else
            {
                radioSEX = "FEMALE";
            }

            Nyesno = func.checkOption(chkBirthCert);
            Cyesno = func.checkOption(chkCertification);
            Pyesno = func.checkOption(chkPic);
            Ryesno = func.checkOption(chkReportCard);

            sql = "INSERT INTO  `tblrequirements` (`NSO`, `PICID`, `REPORTCARD`, `CERTIFICATE_OF_TRANSFER`, `IDNO`) "
                  + "VALUES ('" + Nyesno + "','" + Pyesno + "','" + Ryesno
                  + "','" + Cyesno + "','" + txtStudentId.Text + "')";
            config.Execute_Query(sql);

            sql = "INSERT INTO tblstudent(`IDNO`, `FNAME`, `LNAME`, `MNAME`, `SEX`, `BDAY`, `BPLACE`, `AGE`, `HOME_ADD`, `GUARDIAN`,`GUARDIAN_ADD`,`GUARDIAN_TEL`,`LASTSCHOOLATTEND`,`HEIGTH`,`WEIGTH`) "
                  + "VALUES ('" + txtStudentId.Text + "','" + txtFName.Text + "','" + txtLName.Text + "','" + txtMName.Text
                  + "','" + radioSEX + "','" + dtpDbirth.Text + "','" + txtPBirth.Text + "','" + txtAge.Text + "','"
                  + txtAddress.Text + "','" + txtguardian.Text + "','" + txtguardianadd.Text + "','" + txtguardiantel.Text
                  + "','" + txtLastSchoolAttend.Text + "','" + txtHeight.Text + "','"
                  + txtWeigth.Text + "')";
            config.Execute_CUD(sql, "error to save the data", "Student has been registered.");


            sql = "Update tblautonumber set EndValue = EndValue + IncrementValue WHERE Remarks='StudentID'";
            config.Execute_Query(sql);

            tsNew_Click(sender, e);
        }
示例#20
0
        private void btnTypesave_Click(object sender, EventArgs e)
        {
            sql = "INSERT INTO tblsettings (DESCRIPTION,PARA) VALUES ('" + txtCategory.Text + "','Category')";
            config.Execute_CUD(sql, "error en los datos guardados", "La nueva Categorìa se han guardado.");


            sql = "INSERT INTO tblautonumber (STRT,END,INCREMENT,DESCRIPTION)" +
                  " VALUES ('" + txtCategory.Text.Substring(0, 1) + "0000" + "',1,1,'" + txtCategory.Text + "')";
            config.Execute_Query(sql);
            btntypeLoad_Click(sender, e);
        }
示例#21
0
        private void btnTypeAdd_Click(object sender, EventArgs e)
        {
            sql = "INSERT INTO settings (DESCRIPTION,PARA) VALUES ('" + Type.Text + "','Category')";
            config.Execute_CUD(sql, "error to saved data", "Data has been saved in the database.");


            sql = "INSERT INTO autonumber (START,END,INCREMENT,DESCRIPTION)" +
                  " VALUES ('" + Type.Text.Substring(0, 1) + "0000" + "',1,1,'" + Type.Text + "')";
            config.Execute_Query(sql);
            btnTypeLoad_Click(sender, e);
        }
        private void tsSave_Click(object sender, EventArgs e)
        {
            string messageTrue, messageFalse;

            if (txtsubjDesc.Text == "" || txtsujCode.Text == "")
            {
                MessageBox.Show("Empty fields must be filled up.", "Invalid Action", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            sql = "INSERT INTO `subject` (`SUBJ_CODE`, `SUBJ_DESCRIPTION`, `YR`)"
                  + " VALUES ('" + txtsujCode.Text + "','" + txtsubjDesc.Text + "','"
                  + cboYear.Text + "')";
            messageTrue  = "Subject has been saved.";
            messageFalse = "Failed to save a sabject.";
            config.Execute_CUD(sql, messageFalse, messageTrue);

            tsNew_Click(sender, e);
        }
示例#23
0
 private void saveBtn_Click(object sender, EventArgs e)
 {
     query = "exec sp_UpdateYourInfo '" + scientist_id + "', '" + cardTextbox.Text + "', '" + addressTextbox.Text + "', '" + phoneTextbox.Text + "', '" + emailTextbox.Text + "' ";
     config.Execute_CUD(query, "No data saved.", "Data has been saved in the database.");
     Close();
 }
示例#24
0
        private void btnItemUpdate_Click(object sender, EventArgs e)
        {
            if (this.txtItems.Text == "")
            {
                MessageBox.Show("Nothing to Update", "Information !!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                txtItems.Focus();
            }
            else
            {
                DialogResult dr = MessageBox.Show("Are you sure you want to Update " + txtItems.Text + " ?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (dr == DialogResult.Yes)
                {
                    try
                    {
                        sql = "update Item set Items='" + this.txtItems.Text + "'where Nr='" + this.idja + "';";
                        config.Execute_CUD(sql, "Can`t update", "" + txtItems.Text + " Data has been updated");
                        Cursor.Current = Cursors.WaitCursor;
                        Thread.Sleep(800);
                        sql = "SELECT * FROM Item WHERE Items LIKE '%" + txtItems.Text + "%'";
                        config.Load_DTG(sql, dgvItems);
                        designdatagridview();
                    }

                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }
            }
        }
示例#25
0
 private void btnDel_Click(object sender, EventArgs e)
 {
     sql = "DELETE FROM tblscannedfiles WHERE ScannedId= " + dtglist.CurrentRow.Cells[0].Value;
     config.Execute_CUD(sql, "No delete data", "Data has been deleted");
     frmListScannedFiles_Load(sender, e);
 }
示例#26
0
 private void saveBtn_Click(object sender, EventArgs e)
 {
     query = "exec sp_ChangePassword '" + scientist_id + "', '" + oldpassTextbox.Text + "', '" + newpassTextbox.Text + "', '" + confirmpassTextbox.Text + "' ";
     config.Execute_CUD(query, "No data saved.", "Data has been saved in the database.");
     Close();
 }
示例#27
0
        private void btnempsave_Click(object sender, EventArgs e)

        {
            string gender;

            if (rdomale.Checked)
            {
                gender = "Male";
            }
            else
            {
                gender = "Female";
            }
            sql = "SELECT * FROM employees e ,employeesworkinfo w WHERE e.EMPLOYEE_ID=w.EMPLOYEE_ID AND e.EMPLOYEE_ID= " + txtempId.Text;
            config.singleResult(sql);

            if (txtfname.Text == "" || txtlname.Text == "" || txtaddress.Text == "" ||
                txtage.Text == "" || txtcontact.Text == "" || cboJobType.Text == "Select" ||
                txtstatus.Text == "" || cboJobStatus.Text == "" || cboJobType.Text == "Select")
            {
                MessageBox.Show("Empty Fields are required.", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (config.dt.Rows.Count > 0)
            {
                sql = "UPDATE `employees` E,`employeesworkinfo` W  SET " +
                      "`FIRST_NAME`='" + txtfname.Text + "', `LAST_NAME`='" + txtlname.Text + "', `MIDDLE_NAME`='" + txtmname.Text +
                      "',  `ADDRESS`='" + txtaddress.Text + "', `PHONE_NUMBER`='" + txtcontact.Text + "', `STATUS`='" + txtstatus.Text +
                      "', `BIRTH_DATE`='" + dtpdbirth.Text + "',`BIRTH_PLACE`='" + txtbplace.Text +
                      "', `GENDER`='" + gender + "', `AGE`='" + txtage.Text +
                      "',`EmailAdd`='" + txtEmailad.Text + "', `SocialAccnt`='" + txtSocialAdd.Text +
                      "',EMPIMAGE = '" + Path.GetFileName(PictureBox1.ImageLocation) +
                      "' WHERE E.`EMPLOYEE_ID`= W.`EMPLOYEE_ID` and E.`EMPLOYEE_ID`= '" + txtempId.Text + "' ";
                config.Execute_CUD(sql, "No data update.", "Data has been updated in the database");


                //sql = "";
                //config.Execute_Query(sql);
            }
            else
            {
                sql = "insert into `employees`  " +
                      "(`EMPLOYEE_ID`, `FIRST_NAME`, `LAST_NAME`, `MIDDLE_NAME`, `ADDRESS`, `PHONE_NUMBER`, `STATUS`, `BIRTH_DATE`," +
                      "`BIRTH_PLACE`, `GENDER`, `AGE`, `EMPIMAGE`,`EmailAdd`, `SocialAccnt`)" +
                      " VALUES " +
                      "('" + txtempId.Text + "','" + txtfname.Text + "','" + txtlname.Text + "','" + txtmname.Text +
                      "','" + txtaddress.Text + "','" + txtcontact.Text + "','" + txtstatus.Text + "','" + dtpdbirth.Text +
                      "','" + txtbplace.Text + "','" + gender + "','" + txtage.Text + "','" + Path.GetFileName(PictureBox1.ImageLocation) +
                      "','" + txtEmailad.Text + "','" + txtSocialAdd.Text + "' )";
                config.Execute_CUD(sql, "No data save.", "Data has been saved in the database");


                sql = "insert into `employeesworkinfo` (`EMPLOYEE_ID`, `JobStatus`, `JobType`, `D_HIRED`,EndDate,`SalaryGrade`, `Salary`, `Position`)" +
                      " values " +
                      " ('" + txtempId.Text + "','" + cboJobStatus.Text + "','" + cboJobType.Text +
                      "','" + dtpdhired.Text + "','" + dtpEndDate.Text +
                      "','" + txtSalaryGrade.Text + "','" + txtSalary.Text + "','" + txtPosition.Text + "')";
                config.Execute_Query(sql);
            }
            if (txtPhoto.Text != "")
            {
                File.Copy(txtPhoto.Text, Application.StartupPath + "/Photo/" + Path.GetFileName(PictureBox1.ImageLocation), true);
            }
            btnNew_Click(sender, e);
        }