Ejemplo n.º 1
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
            {
            }
        }
Ejemplo n.º 2
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;
            }
        }
        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;
            }
        }
Ejemplo n.º 4
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);
            }
        }
Ejemplo n.º 5
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;
     }
 }
        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;
            }
        }
        // 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);
            }
        }
        //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);
        }
Ejemplo n.º 9
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);
        }
Ejemplo n.º 10
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);
            }
        }
Ejemplo n.º 11
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;
     }
 }
Ejemplo n.º 12
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);
            }
        }