protected void Button1_Click(object sender, EventArgs e) { UserClass user1 = new UserClass(); user1.UserEmail = TextBox1.Text; if (!user1.UserExistSignUp()) { string userEmail = this.TextBox1.Text; string userPassword = this.TextBox2.Text; string userFirstName = this.TextBox3.Text; string userLastName = this.TextBox4.Text; string city = this.TextBox5.Text; string Gender = this.TextBox6.Text; string sqlMsgStr2 = "insert into [UserTbl]([userEmail],[userPassword],[userFirstName],[userLastName],[city],[Gender],[userType]) values('"; sqlMsgStr2 += this.TextBox1.Text + "','" + this.TextBox2.Text + "','" + this.TextBox3.Text + "','" + this.TextBox4.Text + "','" + this.TextBox5.Text + "','" + this.TextBox6.Text + "','" + "User" + "')"; DBFunctions.ChangeTable(sqlMsgStr2, "UserDB.accdb"); this.Label1.Visible = true; TextBox1.Text = ""; TextBox2.Text = ""; TextBox3.Text = ""; TextBox4.Text = ""; TextBox5.Text = ""; TextBox6.Text = ""; } else { this.Label2.Visible = true; } }
public void Insertmessage(string message, DateTime date) { string sqlstr = "INSERT INTO [messagesTbl] ([email],[fname],[message],[time])";//time when this message was sent sqlstr += "values ('" + this.Email + "','" + this.UserFirstName + "','" + message + "','" + date + "')"; DBFunctions.ChangeTable(sqlstr, "projectDB.accdb"); }
public bool InsertNewUser() { if (this.UserExistSignUp() == true) { return(false);//can not insert him } string sqlstr = "INSERT INTO [userTbl] ([email], [password], [fname],[birthdate],[type]) "; sqlstr += "values ('" + this.Email + "','" + this.UserPassword + "','" + this.UserFirstName + "','" + this.BirthDate + "','" + this.userType + "')"; DBFunctions.ChangeTable(sqlstr, "projectDB.accdb"); return(true); }
protected void Button1_Click(object sender, EventArgs e) { string messageFrom = this.TextBox2.Text; string messageSubject = this.TextBox4.Text; string messageBody = this.TextBox3.Text; string sqlMsgStr = "insert into [MsgTbl]([messageFrom],[messageSubject],[messageBody],[messageRead]) values('"; sqlMsgStr += this.TextBox2.Text + "' ,'" + this.TextBox4.Text + "','" + this.TextBox3.Text + "', false)"; DBFunctions.ChangeTable(sqlMsgStr, "UserDB.accdb"); this.Label1.Visible = true; TextBox3.Text = ""; TextBox4.Text = ""; }
public void UpdateVisaAccount(int visaNumber, int accountNumber, string visaType, double total) { double cash = 0; string sqlStr = "Select * From [VisaTbl] where [VisaNumber]='" + visaNumber.ToString() + "' and [VisaType]='" + visaType + "'and [AccountNumber]='" + accountNumber.ToString() + "'"; DataTable dt = DBFunctions.SelectFromTable(sqlStr, "shwakat11.accdb"); if (dt.Rows.Count > 0) { cash = Convert.ToDouble(dt.Rows[0]["Cash"]); } double result = cash - total; string SqlStr = "Update [VisaTbl] Set [Cash]='" + result.ToString() + "' Where [VisaNumber]='" + visaNumber.ToString() + "' and [VisaType]='" + visaType + "'and [AccountNumber]='" + accountNumber.ToString() + "'"; DBFunctions.ChangeTable(SqlStr, "shwakat11.accdb"); }
public void UpdatePassword(string newPassword) { string userSqlStr = "Update [UserTbl] Set [userPassword]='" + newPassword + "' where [userEmail]='" + this.userEmail + "'"; DBFunctions.ChangeTable(userSqlStr, "shawkat11.accdb"); }
public void UpdateLname(string newLname) { string userSqlStr = "Update [UserTable] Set [userLastName]='" + newLname + "' where [userEmail]='" + this.userEmail + "'"; DBFunctions.ChangeTable(userSqlStr, "shawkat11.accdb"); }
public void UpdateFname(string newFname) { string userSqlStr = "Update [userTbl] Set [fname]='" + newFname + "'"; DBFunctions.ChangeTable(userSqlStr, "projectDB.accdb"); }
public void DeleteUser() { string userSqlStr = "Delete from [userTbl] where [email]='" + this.email + "'"; DBFunctions.ChangeTable(userSqlStr, "projectDB.accdb"); }
public void UpdatePassword(string newPassword) { string userSqlStr = "Update [userTbl] Set [password]='" + newPassword + "' where [email]='" + this.email + "'"; DBFunctions.ChangeTable(userSqlStr, "projectDB.accdb"); }