protected void SubmitID_Click(object sender, EventArgs e) { if (Page.IsValid) { try { sql_class sql = new sql_class(); sql.Where("codeNumber", Request.QueryString["id"]); sql.Where("GaragID", Request.QueryString["userID"]); sql.Where("active", true.ToString()); DataTable data = sql.Get("RestUserAdmin"); if (data.Rows.Count > 0) { UpdatePassword(); } else { lblmessage.ForeColor = System.Drawing.Color.Red; lblmessage.Text = "קישור זה כבר פג תוקף!"; } } catch { throw; } } else { lblmessage.ForeColor = System.Drawing.Color.Red; lblmessage.Text = "חובה למלא שדות חובה!"; } }
protected void sumbit_Click(object sender, EventArgs e) { if (Page.IsValid) { try { string Encryptedpass = FormsAuthentication.HashPasswordForStoringInConfigFile(OldPasID.Text, "SHA1"); //var ID = Convert.ToInt32(); sql_class sql_ = new sql_class(); sql_.Where("Password", Encryptedpass); sql_.Where("GaragID", Session["UserID"].ToString()); DataTable data = sql_.Get("Garage", "Password"); if (data.Rows.Count > 0) { UpdatePassword(); } else { lblmessage.ForeColor = System.Drawing.Color.Red; lblmessage.Text = "סיסמא שגויה"; } } catch (Exception Error) { lblmessage.Text = Error.ToString(); } } else { lblmessage.ForeColor = System.Drawing.Color.Red; lblmessage.Text = "חובה למלא שדות חובה!"; } }
protected void UpdatePassword() { try { string Encryptedpass = FormsAuthentication.HashPasswordForStoringInConfigFile(ReptPasID.Text, "SHA1"); sql_class sql_ = new sql_class(); sql_.Where("GaragID", Session["UserID"].ToString()); var Dblist = new List <DbListAdapter>(); Dblist.Add(new DbListAdapter("Password", Encryptedpass)); bool data = sql_.Update("Garage", Dblist); if (data) { lblmessage.ForeColor = System.Drawing.Color.Green; lblmessage.Text = "סיסמא הוחלפה בהצלחה!"; } else { lblmessage.ForeColor = System.Drawing.Color.Red; lblmessage.Text = "אירעה שגיאה אנא נסה שוב !"; } } catch { throw; } }
protected void SendProfile_Click(object sender, EventArgs e) { string filename = Path.GetFileName(FileUpload1.PostedFile.FileName); string fileExstenshion = Path.GetExtension(filename); if (fileExstenshion.ToLower() == ".jpg" || fileExstenshion.ToLower() == ".gif" || fileExstenshion.ToLower() == ".png" || fileExstenshion.ToLower() == ".bmp" && FileUpload1.PostedFile != null) { Lblsend.Text = string.Empty; string path = @"\Userimage\" + FileUpload1.FileName; FileUpload1.SaveAs(Server.MapPath("~/Userimage/") + Path.GetFileName(FileUpload1.FileName)); sql_class sql = new sql_class(); sql.Where("GaragID", Session["UserID"].ToString()); var DbList = new List <DbListAdapter>(); DbList.Add(new DbListAdapter("imageURL", path)); if (sql.Update("Garage", DbList)) { Lblsend.Text = "התמונה הועלתה בהצלחה!"; Lblsend.ForeColor = System.Drawing.Color.Green; } } else { Lblsend.Text = "ניתן לעלות תמונות אם סיומת(.jpg,.gif,.png,.bmp) בלבד!"; Lblsend.ForeColor = System.Drawing.Color.Red; } }
//cheack if UserName Exsicte protected bool CheackUserName() { try { sql_class data = new sql_class(); data.Where("IdCard", tbUser.Text); data.Where("GaragID", Session["UserID"].ToString()); DataTable HesRow = data.Get("EmployeModel"); if (HesRow.Rows.Count > 0) { lblusercheck.Text = "תעודת זהות זו כבר בשימוש"; lblusercheck.ForeColor = System.Drawing.Color.Red; tbUser.Text = ""; return(true); } else { lblusercheck.Text = ""; return(false); } } catch (Exception ex) { ClientScript.RegisterStartupScript(GetType(), "Error!", "alert('" + ex.Message.Replace("'", @"\'") + "');", true); return(false); } }
protected void UpdSetting_Click(object sender, EventArgs e) { try { sql_class sql = new sql_class(); var Dblist = new List <DbListAdapter>(); Dblist.Add(new DbListAdapter("pricePerHour", price.Value)); Dblist.Add(new DbListAdapter("Email", emailId.Value)); Dblist.Add(new DbListAdapter("Phone", PhoneId.Value)); Dblist.Add(new DbListAdapter("NameGarga", BisanceID.Value)); Dblist.Add(new DbListAdapter("Address", StreetID.Value)); Dblist.Add(new DbListAdapter("CityID", Request.Form[hfCityid.UniqueID])); sql.Where("GaragID", Session["UserID"].ToString()); bool Updat_result = sql.Update("Garage", Dblist); if (Updat_result) { System.Windows.Forms.MessageBox.Show("הנתונים נשמרו בהצלחה! "); } else { System.Windows.Forms.MessageBox.Show("שגיאה "); } } catch (Exception ex) { ClientScript.RegisterStartupScript(GetType(), "Error!", "alert('" + ex.Message.Replace("'", @"\'") + "');", true); } }
protected void UpdateBtn_Click(object sender, EventArgs e) { try { sql_class sql = new sql_class(); var Dblist = new List <DbListAdapter>(); Dblist.Add(new DbListAdapter("FIRST_NAME", FnameID.Text)); Dblist.Add(new DbListAdapter("LAST_NAME", LnameID.Text)); sql.Where("GaragID", Session["UserID"].ToString()); bool Updat_result = sql.Update("Garage", Dblist); if (Updat_result) { System.Windows.Forms.MessageBox.Show("הנתונים נשמרו בהצלחה! "); } else { System.Windows.Forms.MessageBox.Show("שגיאה "); } } catch (Exception ex) { ClientScript.RegisterStartupScript(GetType(), "Error!", "alert('" + ex.Message.Replace("'", @"\'") + "');", true); Lblsend.Text = ex.Message; } }
//chack if the user exicte protected void RestPassword_Click(object sender, EventArgs e) { if (Page.IsValid) { sql_class sql = new sql_class(); //sql.Where("UserName", userPassinput.Text); sql.Where("Email", useremailinput.Text); DataTable data = sql.Get("Garage", "Email", "FIRST_NAME", "GaragID"); if (data.Rows.Count > 0) { string UserID = data.Rows[0]["GaragID"].ToString(); string ID = RandomPassword(UserID); string addressee = data.Rows[0]["Email"].ToString(); string user = data.Rows[0]["FIRST_NAME"].ToString(); SendMeilRestPassword(addressee, user, ID, UserID); lbmessage.Text = "נשלח קישור לכתובת המייל לצורך איפוס!"; } else { lbmessage.ForeColor = System.Drawing.Color.Red; lbmessage.Text = "לא קיים חשבון כזה במערכת,אנא פנה לצוות הלקוחות!"; } } else { lbmessage.ForeColor = System.Drawing.Color.Red; lbmessage.Text = "חובה למלא שדות חובה!"; } }
public static List <KeyValuePair <string, int> > ReloadCity(string parm) { List <string> City = new List <string>(); List <KeyValuePair <string, int> > dataList = new List <KeyValuePair <string, int> >(); sql_class sqlQuery = new sql_class(); sqlQuery.WhereLIKE("CityName", parm); sqlQuery.Limit(5); DataTable data = sqlQuery.Get("City", "CityName", "CityID"); if (data.Rows.Count == 0) { dataList.Add(new KeyValuePair <string, int>("לא נמצאו התאמות", -1)); } var sizedata = data.Rows.Count; var i = 0; while (sizedata > 0) { dataList.Add(new KeyValuePair <string, int>(data.Rows[i]["CityName"].ToString(), Convert.ToInt32(data.Rows[i]["CityID"]))); sizedata--; i++; } return(dataList); }
protected void UpdateBtn_Click(object sender, EventArgs e) { try { sql_class sql = new sql_class(); var Dblist = new List <DbListAdapter>(); Dblist.Add(new DbListAdapter("FirstName", first_name.Text)); Dblist.Add(new DbListAdapter("LastName", last_name.Text)); Dblist.Add(new DbListAdapter("Email", email.Text)); Dblist.Add(new DbListAdapter("Phone", mobile.Text)); //Dblist.Add(new DbListAdapter("BirthDate", BirthDate.Value)); sql.Where("CustomerID", Request.QueryString["id"].Replace("'", " ")); bool Updat_result = sql.Update("Customer", Dblist); if (Updat_result) { System.Windows.Forms.MessageBox.Show("הנתונים נשמרו בהצלחה! "); } else { System.Windows.Forms.MessageBox.Show("שגיאה "); } } catch (Exception ex) { ClientScript.RegisterStartupScript(GetType(), "Error!", "alert('" + ex.Message.Replace("'", @"\'") + "');", true); lblmessage.Text = ex.Message; } finally { } }
//Func Registraion New_Garge public static bool create_new_garage(List <DbListAdapter> data) { sql_class newsql = new sql_class(); return(newsql.Insert("Garage", data) ? true : false); }
protected void UpdatePassword() { try { string Encryptedpass = FormsAuthentication.HashPasswordForStoringInConfigFile(PasswordID.Text, "SHA1"); sql_class sql = new sql_class(); sql.Where("GaragID", Request.QueryString["userID"]); var Dblist = new List <DbListAdapter>(); Dblist.Add(new DbListAdapter("Password", Encryptedpass)); bool data = sql.Update("Garage", Dblist); if (data) { lblmessage.ForeColor = System.Drawing.Color.Green; lblmessage.Text = "סיסמא הוחלפה בהצלחה!"; DeleteLastCode(); Response.Redirect("~/Login.aspx"); } else { lblmessage.ForeColor = System.Drawing.Color.Red; lblmessage.Text = "אירעה שגיאה !"; } } catch { throw; } }
// send onr more time code to user protected void send_Click(object sender, EventArgs e) { Random random = new Random(); activatoncode = random.Next(1001, 9999).ToString(); try { sql_class sql = new sql_class(); sql.Where("Email", Request.QueryString["tb_email"]); //sql.Where("UserName", Request.QueryString["UserName"]); var Dblist = new List <DbListAdapter>(); Dblist.Add(new DbListAdapter("Activecode", activatoncode)); bool Up = sql.Update("Garage", Dblist); if (Up) { sendemail(); userMessage.Text = "נשלח קוד חדש!"; } else { userMessage.Text = "אירעה שגיאה בעת שליחת הקוד"; } } catch (Exception) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(ex)", true); } }
//Fung Get Name of City public string get_city() { DataTable data = new sql_class().Where("CityID", CityID).Get("City", "CityName", "CityNameEN"); string Name_City = data.Rows[0]["CityName"].ToString(); //Name_Hebrwo = data.Rows[0]["CityName"].ToString(); return(Name_City); }
public DataTable getPart(string teratmentID) { sql_class sql = new sql_class(); sql.Where("teratmentID", teratmentID); DataTable data = sql.Get("CartModel"); return(data); }
//get history off all repairjob public void historyRepairJob(string CustomerID) { sql_class sql = new sql_class(); sql.Where("CustomerID", CustomerID); DataTable data = sql.Get("RepairJob"); shwoHistory.DataSource = data; shwoHistory.DataBind(); }
//Func Login Admin public static DataTable get_data(string user, [Optional] string password, [Optional] string status, params string[] User) { sql_class new_data = new sql_class(); new_data.Where("Email", user); new_data.Where("Password", password); new_data.Where("Status", status); DataTable data = new_data.Get("Garage", User); return(data); }
//cange status user account private void changestatus() { sql_class sql = new sql_class(); sql.Where("Email", Request.QueryString["tb_email"]); //sql.Where("UserName", Request.QueryString["UserName"]); var Dblist = new List <DbListAdapter>(); Dblist.Add(new DbListAdapter("Status", true.ToString())); sql.Update("Garage", Dblist); }
public string Calnder_data() { DataTable data = new sql_class().Where("GaragID", this.GaragID.ToString()).Where("ShwoEvent", "true").Get("EventsModel"); List <EventsModel> list = new List <EventsModel>(); for (int i = 0; i < data.Rows.Count; i++) { EventsModel events = new EventsModel(this.GaragID, i); list.Add(events); } return(JsonConvert.SerializeObject(list)); }
public bool UpdateShowEvent(string idevent) { sql_class sql = new sql_class(); var Dblist = new List <DbListAdapter>(); Dblist.Add(new DbListAdapter("ShwoEvent", false.ToString())); sql.Where("GaragID", this.GaragID.ToString()); sql.Where("EventID", idevent); bool Updat_result = sql.Update("EventsModel", Dblist); return(Updat_result); }
public void annualTreatment() { if (SelectTipol.Value == "1" || SelectTipol.Value == "2") { DateTime today = DateTime.Today; sql_class sql = new sql_class(); var Dblist = new List <DbListAdapter>(); Dblist.Add(new DbListAdapter("Last_annual_treatment", today.ToString(("yyyy-MM-dd")))); sql.Where("License_Number", License_id.Text); sql.Update("Vehicle", Dblist); } }
public List <RepairJobl> GetTeratments() { List <RepairJobl> list = new List <RepairJobl>(); DataTable sql = new sql_class().Where("GaragID", this.GaragID.ToString()).Where("Status", "true").Get("RepairJob", "teratmentID"); for (int i = 0; i < sql.Rows.Count; i++) { RepairJobl Teratment = new RepairJobl(Convert.ToInt32(sql.Rows[i]["teratmentID"])); list.Add(Teratment); } return(list); }
public List <Sticky_Note> GetSticky_Notes() { List <Sticky_Note> list = new List <Sticky_Note>(); DataTable sql = new sql_class().Where("GaragID", this.GaragID.ToString()).Get("StickyModel", "stickyID"); for (int i = 0; i < sql.Rows.Count; i++) { Sticky_Note sticky = new Sticky_Note(Convert.ToInt32(sql.Rows[i]["stickyID"]), i); list.Add(sticky); } return(list); }
//func thet get all Customers public List <CustomerModel> getAllCustomers() { List <CustomerModel> list = new List <CustomerModel>(); DataTable sql = new sql_class().Where("GaragID", this.GaragID.ToString()).Get("Customer", "CustomerID"); for (int i = 0; i < sql.Rows.Count; i++) { CustomerModel customer = new CustomerModel(Convert.ToInt32(sql.Rows[i]["CustomerID"])); list.Add(customer); } return(list); }
//Checks if the account has been approved protected void AccountVefiad() { sql_class sql = new sql_class(); sql.Where("Email", Request.QueryString["tb_email"]); //sql.Where("UserName", Request.QueryString["UserName"]); DataTable data = sql.Get("Garage", "Status"); if (data.Rows[0]["Status"].ToString().ToUpper() == "True".ToUpper()) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('חשבון זה כבר מאושר!')", true); Response.Redirect("~/Login.aspx"); } }
//check if user id is exciste protected static bool CustomerEx(string id) { var gargeid = HttpContext.Current.Session["UserID"].ToString(); DataTable sql = new sql_class().Where("GaragID", gargeid).Where("UsarName", id).Get("Customer"); if (sql.Rows.Count != 0) { return(true); } else { return(false); } }
protected void DeleteLastCode() { try { sql_class sql = new sql_class(); sql.Where("codeNumber", Request.QueryString["id"]); sql.Where(" GaragID", Request.QueryString["userID"]); var Dblist = new List <DbListAdapter>(); Dblist.Add(new DbListAdapter("active", false.ToString())); bool data = sql.Update("RestUserAdmin", Dblist); } catch { throw; } }
public static List <string> ClintInfo(string id) { if (id.Length == 9 & CustomerEx(id)) { List <string> AllData = new List <string>(); var gargeid = HttpContext.Current.Session["UserID"].ToString(); DataTable sql = new sql_class().Where("GaragID", gargeid).Where("UsarName", id).Get("Customer"); var CustmID = sql.Rows[0]["CustomerID"].ToString(); DataTable data = new sql_class().Where("CustomerID", CustmID).Get("Vehicle"); //get the car datels after geting the data from vehicle table var Modelcar = data.Rows[0]["ModelID"].ToString(); var ModelYear = data.Rows[0]["ModelYear"].ToString(); var ManufacthreID = data.Rows[0]["ManufacthreID"].ToString(); DataTable cardata = ModelClass.GeModelName(Modelcar, ModelYear, ManufacthreID); //get model maufathrename var tozar = cardata.Rows[0]["tozeret_cd"].ToString(); string cardataName = ManufacthreModel.GetozarName(tozar); var NumberRow = sql.Columns.Count + data.Columns.Count + cardata.Columns.Count; for (int i = 0; i < NumberRow; i++) { if (sql.Columns.Count > i) { AllData.Add(sql.Rows[0][i].ToString()); } if (data.Columns.Count > i) { AllData.Add(data.Rows[0][i].ToString()); } if (cardata.Columns.Count > i) { AllData.Add(cardata.Rows[0][i].ToString()); } } AllData.Add(cardataName); return(AllData); } else { return(null); } }
//set customer info public void setCustomerInfo(string CustomerID) { sql_class sql = new sql_class(); DataTable date = sql.Where("CustomerID", CustomerID.Replace("'", " ")).Get("Customer"); first_name.Text = date.Rows[0]["FirstName"].ToString(); last_name.Text = date.Rows[0]["LastName"].ToString(); mobile.Text = date.Rows[0]["Phone"].ToString(); email.Text = date.Rows[0]["Email"].ToString(); DateTime added = Convert.ToDateTime(date.Rows[0]["JOINING_DATE"]); joinData.Text = added.ToString("dd/MM/yyyy"); DateTime birth = Convert.ToDateTime(date.Rows[0]["BirthDate"]); birthData.Text = birth.ToString("dd/MM/yyyy"); FullName.Text = first_name.Text + " " + last_name.Text; }
//cheack if email Exsicte public bool CheackUserName() { sql_class sql_data = new sql_class(); sql_data.Where("Email", tb_email.Text); DataTable data = sql_data.Get("Garage"); if (data.Rows.Count > 0) { Label1.Text = "נראה שחשבון מייל זה כבר נמצא בשימוש"; Label1.ForeColor = System.Drawing.Color.Red; tb_email.Text = ""; return(true); } else { Label1.Text = ""; return(false); } }