Example #1
0
    private void ChnagePass(string Newpass, string oldPass)
    {
        try
        {
            clsMySQLCoreApp ObjDAL = new clsMySQLCoreApp();

            DataTable dataTable = ObjDAL.ExecuteSelectStatement("SELECT ID,CAST(AES_DECRYPT(Password, 'UserNameEmailID') AS CHAR(255)) Pass FROM ztech.tblUserDetails;");
            if (dataTable != null && dataTable.Rows.Count > 0)
            {
                string strOldPass = dataTable.Rows[0]["Pass"].ToString();
                int    pID        = Convert.ToInt32(dataTable.Rows[0]["ID"]);
                if (oldPass == strOldPass)
                {
                    ObjDAL.ExecuteNonQuery("UPDATE ztech.tblUserDetails SET Password=AES_ENCRYPT('" + Newpass + "', 'UserNameEmailID'),UpdatedOn=NOW(),UpdatedBy=" + pID + " WHERE 1=1;");
                    NavigationURL.Value = "MyProfile.aspx";
                    ShowMessageBox("Password has been update successfully.");
                }
                else
                {
                    NavigationURL.Value = "MyProfile.aspx";
                    ShowMessageBox("Old password doesn't match with existing old password.", false);
                }
            }
        }
        catch (Exception ex)
        {
            NavigationURL.Value = "MyProfile.aspx";
            ShowMessageBox(ex.Message, false);
        }
    }
Example #2
0
    private void LoadEmail()
    {
        clsMySQLCoreApp ObjDAL    = new clsMySQLCoreApp();
        DataTable       dataTable = ObjDAL.ExecuteSelectStatement("SELECT EmailID FROM ztech.tblUserDetails;");

        if (dataTable != null && dataTable.Rows.Count > 0)
        {
            txtemail.Value = dataTable.Rows[0]["EmailID"].ToString();
        }
    }
Example #3
0
    private void SaveDataIntoDB(string strName, string path, int flag)
    {
        clsMySQLCoreApp ObjDAL = new clsMySQLCoreApp();

        ObjDAL.SetStoreProcedureData("ParmPID", MySql.Data.MySqlClient.MySqlDbType.Int32, ProductID);
        ObjDAL.SetStoreProcedureData("ParmPath ", MySql.Data.MySqlClient.MySqlDbType.VarChar, path);
        ObjDAL.SetStoreProcedureData("ParmFileName  ", MySql.Data.MySqlClient.MySqlDbType.VarChar, strName);
        ObjDAL.SetStoreProcedureData("ParmFlag", MySql.Data.MySqlClient.MySqlDbType.Int32, flag);
        ObjDAL.ExecuteStoreProcedure_DML("spr_InsertProductImages");
    }
Example #4
0
    private void LoadImages()
    {
        clsMySQLCoreApp ObjDAL          = new clsMySQLCoreApp();
        DataTable       dtProductImages = ObjDAL.ExecuteSelectStatement("select * from ztech.tblImages where ProductID=" + ProductID);

        if (dtProductImages != null && dtProductImages.Rows.Count > 0)
        {
            Repeater2.DataSource = dtProductImages;
            Repeater2.DataBind();
        }
    }
    private void LoadCarouselRepeater()
    {
        clsMySQLCoreApp ObjDAL = new clsMySQLCoreApp();

        // dont write db_name.dbo.viewname, it doesn't work in my sq. 1 is hardcode for gate which is fixed

        DataTable dtProduct = ObjDAL.ExecuteSelectStatement("SELECT Path FROM ztech.tblImages WHERE ProductID=4 AND flag=0");

        if (dtProduct != null && dtProduct.Rows.Count > 0)
        {
            CarouselRepeater.DataSource = dtProduct;
            CarouselRepeater.DataBind();
        }
    }
Example #6
0
    private void LoadProductDetails()
    {
        clsMySQLCoreApp ObjDAL           = new clsMySQLCoreApp();
        DataTable       dtProductDetails = ObjDAL.ExecuteSelectStatement("SELECT * FROM View_ProductDetails WHERE ProductID=" + ProductID);

        if (dtProductDetails != null && dtProductDetails.Rows.Count > 0)
        {
            ProductID     = dtProductDetails.Rows[0]["ProductID"].ToString();
            Description   = dtProductDetails.Rows[0]["Description"].ToString();
            ConstFeatures = dtProductDetails.Rows[0]["ConstFeatures"].ToString();
            ProductName   = dtProductDetails.Rows[0]["ProductName"].ToString();
            SizeDetails   = dtProductDetails.Rows[0]["SizeDetails"].ToString();
        }
    }
Example #7
0
    private void LoadCarouselRepeater()
    {
        clsMySQLCoreApp ObjDAL = new clsMySQLCoreApp();

        // dont write db_name.dbo.viewname,  hardcode for gate which is fixed

        DataTable dtProduct = ObjDAL.ExecuteSelectStatement("select * from View_MainSliderDetails");

        if (dtProduct.Rows.Count > 0)
        {
            CarouselRepeater.DataSource = dtProduct;
            CarouselRepeater.DataBind();
        }
    }
Example #8
0
    private void ChagngeEmail(string mail)
    {
        int pID = 0;

        if (Session["User"] != null)
        {
            pID = Convert.ToInt32(Session["User"]);

            clsMySQLCoreApp ObjDAL = new clsMySQLCoreApp();
            ObjDAL.ExecuteNonQuery("UPDATE ztech.tblUserDetails SET EmailID='" + mail + "',UpdatedOn=NOW(),UpdatedBy=" + pID + " WHERE 1=1;");

            ShowMessageBox("Email has been update successfully.");
        }
        else
        {
            ShowMessageBox("Unable to Update Email Address.");
        }
        NavigationURL.Value = "MyProfile.aspx";
    }
Example #9
0
    private void UpdateProductData()
    {
        ProductName = Request["txtProductName"].ToString();
        string strProdDesc    = Request["txtProdDesc"].ToString();
        string strConsFeature = Request["txtConsFeature"].ToString();
        string strSizeDetails = Request["txtSizeDetails"].ToString();
        string strProductName = "";
        int    ProductID      = 0;

        if (Session["ProductName"] != null)
        {
            strProductName = Session["ProductName"].ToString();
        }
        else
        {
            strProductName = "NA";
        }

        if (Session["ProductID"] != null)
        {
            ProductID = Convert.ToInt32(Session["ProductID"]);
        }

        clsMySQLCoreApp ObjDAL = new clsMySQLCoreApp();

        ObjDAL.SetStoreProcedureData("ProductName", MySql.Data.MySqlClient.MySqlDbType.VarChar, ProductName);
        ObjDAL.SetStoreProcedureData("PID", MySql.Data.MySqlClient.MySqlDbType.Int32, ProductID);
        ObjDAL.SetStoreProcedureData("Description", MySql.Data.MySqlClient.MySqlDbType.LongText, strProdDesc);
        ObjDAL.SetStoreProcedureData("ConstFeatures", MySql.Data.MySqlClient.MySqlDbType.LongText, strConsFeature);
        ObjDAL.SetStoreProcedureData("SizeDetails", MySql.Data.MySqlClient.MySqlDbType.LongText, strSizeDetails);
        bool result = ObjDAL.ExecuteStoreProcedure_DML("spr_InsUpdateProductDetails");

        if (!result)
        {
            Response.Write(ObjDAL.strErrorText);
        }
        else
        {
            Session["UpdateStatus"] = "1";
            Response.Redirect("Admin_Manager.aspx");
        }
    }
Example #10
0
    //[System.Web.Services.WebMethod]
    //private string ForgotPass(string mail)
    private void ForgotPass(string mail)
    {
        string result = "";

        try
        {
            clsMySQLCoreApp ObjDAL = new clsMySQLCoreApp();

            string strpass = string.Empty;

            DataTable dt = ObjDAL.ExecuteSelectStatement("SELECT Password FROM ztech.tblUserDetails WHERE EmailID='" + mail + "';");
            if (dt != null && dt.Rows.Count > 0)
            {
                strpass = dt.Rows[0]["Password"].ToString();
                bool b = SendEmail(mail, strpass);
                NavigationURL.Value = "Admin_Login.aspx";
                if (b)
                {
                    ShowMessageBox("Password has been sent to your mail address.");
                    //result = "Password has been sent to your mail address.";
                }
                else
                {
                    ShowMessageBox("Unable to Send Password to your mail address.", false);
                    //result = "Unable to Send Password to your mail address.";
                }
            }
            else
            {
                NavigationURL.Value = "Admin_Login.aspx";
                ShowMessageBox("Unable to Send Password to your mail address.", false);
                //result = "Unable to Send Password to your mail address.";
            }
            //return result;
        }
        catch (Exception ex)
        {
            NavigationURL.Value = "Admin_Login.aspx";
            ShowMessageBox(ex.ToString(), false);
        }
    }
    private void LoadData()
    {
        clsMySQLCoreApp ObjDAL = new clsMySQLCoreApp();

        // dont write db_name.dbo.viewname, it doesn't work in my sq. 4 is hardcode for ball valve which is fixed

        DataTable dtProduct = ObjDAL.ExecuteSelectStatement("SELECT ProductName,ConstFeatures,SizeDetails FROM ztech.View_ProductDetails WHERE ProductID=4");

        if (dtProduct != null && dtProduct.Rows.Count > 0)
        {
            string[] constFeature = dtProduct.Rows[0]["ConstFeatures"].ToString().Split('\n');
            string[] sizeDetails  = dtProduct.Rows[0]["SizeDetails"].ToString().Split('\n');
            ProductName = dtProduct.Rows[0]["ProductName"].ToString();

            Repeater1.DataSource = constFeature;
            Repeater1.DataBind();

            Repeater2.DataSource = sizeDetails;
            Repeater2.DataBind();
        }
    }
Example #12
0
    private void DeleteImage(string imgID, string ImageName)
    {
        try
        {
            clsMySQLCoreApp ObjDAL = new clsMySQLCoreApp();
            ObjDAL.ExecuteNonQuery("DELETE FROM ztech.tblImages WHERE ImageID=" + imgID);

            if (File.Exists(Server.MapPath("~/Uploads/" + ImageName)))
            {
                File.Delete(Server.MapPath("~/Uploads/" + ImageName));
            }
            NavigationURL.Value = "UpdateProductImage.aspx";

            ShowMessageBox("Image has been deleted successfully.");
        }
        catch (Exception ex)
        {
            NavigationURL.Value = "UpdateProductImage.aspx";
            ShowMessageBox(ex.Message, false);
        }
    }
    private void LoadProdcuts()
    {
        clsMySQLCoreApp ObjDAL     = new clsMySQLCoreApp();
        DataTable       dtProducts = ObjDAL.ExecuteSelectStatement("SELECT ProductID,ProductName FROM ztech.tblProductMaster");

        if (dtProducts != null && dtProducts.Rows.Count > 0)
        {
            cmbProduct.DataSource = dtProducts;
            cmbProduct.DataBind();

            cmbProduct.DataTextField  = "ProductName";
            cmbProduct.DataValueField = "ProductID";
            cmbProduct.DataBind();

            //Add a default item at first position.
            cmbProduct.Items.Insert(0, new ListItem("Please select", ""));

            //Set the default item as selected.
            cmbProduct.Items[0].Selected = true;

            //Disable the default item.
            cmbProduct.Items[0].Attributes["disabled"] = "disabled";
        }
    }