Example #1
0
        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      = "חובה למלא שדות חובה!";
            }
        }
Example #2
0
 //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);
     }
 }
Example #3
0
 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      = "חובה למלא שדות חובה!";
     }
 }
Example #4
0
        //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);
        }
Example #5
0
        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);
        }
Example #6
0
 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;
     }
 }
Example #7
0
 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);
            }
        }
Example #9
0
        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;
            }
        }
 //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      = "חובה למלא שדות חובה!";
     }
 }
Example #11
0
        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
            {
            }
        }
        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;
            }
        }
Example #13
0
        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;
            }
        }
Example #15
0
        public DataTable getPart(string teratmentID)
        {
            sql_class sql = new sql_class();

            sql.Where("teratmentID", teratmentID);
            DataTable data = sql.Get("CartModel");

            return(data);
        }
Example #16
0
        //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();
        }
        //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);
        }
Example #18
0
        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);
            }
        }
        //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");
            }
        }
Example #20
0
        //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);
            }
        }
Example #22
0
        public static bool closeRepiarJob(string teratmentID, string amountTime)
        {
            sql_class sql    = new sql_class();
            var       Dblist = new List <DbListAdapter>();

            Dblist.Add(new DbListAdapter("TotalWorkingHours", amountTime));
            sql.Where("teratmentID", teratmentID);
            sql.Update("RepairJob", Dblist);
            RepairJobl jobl       = new RepairJobl();
            bool       closeOrnot = jobl.closeRepiarJob(teratmentID);

            if (closeOrnot)
            {
                CartModel cart = new CartModel();
                cart.cartItemChengaStatus(teratmentID);
                return(true);
            }
            else
            {
                return(false);
            }
        }
 // return customerid
 protected string GetCustomerid()
 {
     try
     {
         sql_class Check = new sql_class();
         Check.Where("UsarName", tbUser.Text);
         DataTable data = Check.Get("Customer", "CustomerID");
         if (data.Rows.Count > 0)
         {
             return(data.Rows[0]["CustomerID"].ToString());
         }
         else
         {
             Response.Redirect("~/error-500.html");
             return(null);
         }
     }
     catch (Exception ex)
     {
         ClientScript.RegisterStartupScript(GetType(), "Error!", "alert('" + ex.Message.Replace("'", @"\'") + "');", true);
         return(null);
     }
 }
        //chack if the code is right
        protected void log_Click(object sender, EventArgs e)
        {
            sql_class sql_new = new sql_class();

            sql_new.Where("Email", Request.QueryString["tb_email"].ToString());
            //sql_new.Where("UserName", Request.QueryString["UserName"].ToString());
            DataTable data = sql_new.Get("Garage");

            if (data.Rows.Count > 0)
            {
                string activshncode = "";
                activshncode = data.Rows[0]["Activecode"].ToString();
                if (activshncode == tb_code.Value)
                {
                    changestatus();
                    Response.Redirect("~/Login.aspx");
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('קוד לא נכון')", true);
                }
            }
            //con.Close();
        }