示例#1
0
        private void btn_update_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Are you sure that you want to update this member ?");
            string NIC_forqr  = textBoxNIC.Text;
            string Name_forqr = textboxName.Text;
            string mail_db    = memEmail_tb.Text;

            Id = textbox_Members_Id.Text;
            string NIC                      = textBoxNIC.Text;
            string name                     = textboxName.Text;
            string Gender                   = textboxGender.Text;
            string Body_Type                = textboxBodyType.Text;
            string Email                    = memEmail_tb.Text;
            string Address                  = richTextBoxAddress.Text;
            string Mobile_Number            = textboxMobileNumber.Text;
            string Health_Condition         = richTextBoxHealthCondition.Text;
            string Emergency_Contact_Name   = textboxEmergencyContactName.Text;
            string Emergency_Contact_Number = (textboxEmergencyContactPhoneNumber.Text);
            string qrimgpath                = Application.StartupPath.Substring(0, Application.StartupPath.Length - 10) + "\\Images\\Member QR\\" + Id + "memQR.jpg";

            DB_Connection dB_Connection = new DB_Connection();
            string        query         = "UPDATE Members SET NICorDL='" + NIC + "', MemberName='" + name + "' , Gender='" + Gender + "' , Body_Type='" + Body_Type + "' , Address='" + Address + "' , Mobile_Number='" + Mobile_Number + "' , Health_Condition='" + Health_Condition + "' , Emergency_Contact_Name='" + Emergency_Contact_Name + "' , Emergency_Contact_Number='" + Emergency_Contact_Number + "', Member_dp='" + Member_dp_path + "' , Email = '" + Email + "' , QR_img_path='" + qrimgpath + "' WHERE Id='" + Id + "'";

            dB_Connection.update(query);


            if (NIC_forqr != NIC || Name_forqr != name || Email != mail_db)
            {
                QRmailSender qRmailSender = new QRmailSender();
                string       qrsubject    = (Id.ToString() + NIC + name).ToString();
                qRmailSender.qrgen(qrsubject, qrimgpath);
                qRmailSender.Emailgen(name, "member");
                qRmailSender.Emailsend(Email, qrimgpath);
            }
        }
示例#2
0
        private void btnupdate_emod_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Are you sure that you want to update this Equipment ?");
            equipId = txtmodeid.Text;
            string Name   = txtmodename.Text;
            string Type   = txtmodetype.Text;
            string Amount = txtmodeamount.Text;

            DB_Connection dB_Connection = new DB_Connection();
            string        query         = "UPDATE Equipment SET Equip_Name='" + Name + "', Equip_Type='" + Type + "', Equip_Amount='" + Amount + "', Equip_img1='" + equip_imgpath1 + "',Equip_img2='" + equip_imgpath2 + "',Equip_img3='" + equip_imgpath3 + "',Equip_img4='" + equip_imgpath4 + "' WHERE Equip_ID='" + equipId + "'";

            dB_Connection.update(query);
        }
示例#3
0
        private void btn_update_Click(object sender, EventArgs e)
        {
            DialogResult dialog = MessageBox.Show("Are you sure that you want to change this?", "Reset Administrator", MessageBoxButtons.YesNo);

            if (dialog == DialogResult.Yes)
            {
                string Username      = un_tb.Text;
                string Company_name  = cn_tb.Text;
                string Password      = p_tb.Text;
                string Password_Hint = ph_tb.Text;
                string Pin_Number    = pn_tb.Text;
                string Email         = e_tb.Text;

                string        qry           = "UPDATE Usertb SET Username='******', Company_Name='" + Company_name + "', Password='******', Password_Hint='" + Pin_Number + "' WHERE Id='" + id + "'";
                DB_Connection dB_Connection = new DB_Connection();
                dB_Connection.update(qry);
            }
        }
示例#4
0
        private void btn_update_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Are you sure that you want to update this member ?");
            Id = textbox_Staff_Members_Id.Text;
            string NIC_forqr        = textBoxNIC.Text;
            string Name_forqr       = textboxName.Text;
            string NIC              = textBoxNIC.Text;
            string Name             = textboxName.Text;
            string JobType          = textboxJobType.Text;
            string p_qualifications = txt_boxProQuli.Text;


            string Address_living       = txt_boxAddressLivg.Text;
            string PN_private           = txt_boxPN_private.Text;
            string PN_public            = txt_boxPubN.Text;
            string Home_Address         = home_Address_tb.Text;
            string EmergencyContactName = txt_boxEmergencyContactNme.Text;
            string EmergencyContactPN   = txt_boxEmergencyContactPNo.Text;
            string Email     = txt_boxMail.Text;
            string Gender    = txt_boxGender.Text;
            string qrimgpath = Application.StartupPath.Substring(0, Application.StartupPath.Length - 10) + "\\Images\\Member QR\\" + Id + "memQR.jpg";

            DB_Connection dB_Connection = new DB_Connection();
            string        query         = "UPDATE Staff_Member SET Capture_path ='" + Staff_Member_dp_path + "', QR_img_path='" + qrimgpath + "', NIC = '" + NIC + "', Name = '" + Name + "' , Job_Type='" + JobType + "', Professional_qualifications='" + p_qualifications + "', Address_living='" + Address_living + "', Mobile_no_public='" + PN_public + "', Mobile_no_private='" + PN_private + "', Home_address='" + Email + "', Emergency_Contact_Name='" + EmergencyContactName + "', Emergency_Contact_Number='" + EmergencyContactPN + "', Email='" + Email + "', Gender='" + Gender + "' ";

            dB_Connection.update(query);

            QRmailSender qRmailSender = new QRmailSender();

            if (NIC_forqr != NIC || Name_forqr != Name || Email != mail_db)
            {
                string qrsubject = (Id.ToString() + NIC + Name).ToString();

                qRmailSender.qrgen(qrsubject, qrimgpath);
                qRmailSender.Emailgen(Name, "member");
                qRmailSender.Emailsend(Email, qrimgpath);
            }
        }