예제 #1
0
 public int DeletUser(string userid)
 {
     try
     {
         object intvalue = MySqlDataAccess.ExecuteScalar(MySqlDataAccess.ConnectionString, CommandType.StoredProcedure, "ProDeleteUser", new SqlParameter("@userid", userid));
         return(Convert.ToInt32(intvalue));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
예제 #2
0
 public int UpdateCategory(Int32 categoryid, string categoryname)
 {
     try
     {
         string query  = "update t_Category set CategoryName='" + categoryname + "' where CategoryId='" + categoryid + "'";
         object intVal = MySqlDataAccess.ExecuteScalar(MySqlDataAccess.ConnectionString, CommandType.Text, query);
         return(Convert.ToInt32(intVal));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
예제 #3
0
 public int CreateNewCategory(string categoryname)
 {
     try
     {
         string query  = "insert into t_Category (CategoryName) values('" + categoryname + "')";
         object intVal = MySqlDataAccess.ExecuteScalar(MySqlDataAccess.ConnectionString, CommandType.Text, query);
         return(Convert.ToInt32(intVal));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
예제 #4
0
 public int UpdateCartItemByCoupon(string carid, decimal totalpriceaftercoupon, Int32 finalshippingcharges)
 {
     try
     {
         string query    = @"Update ShopingCart set CouponPrice = '" + totalpriceaftercoupon + "', FinalShippingCharges='" + finalshippingcharges + "' where CartId = '" + carid + "'";
         object intvalue = MySqlDataAccess.ExecuteScalar(MySqlDataAccess.ConnectionString, CommandType.Text, query);
         return(Convert.ToInt32(intvalue));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
예제 #5
0
 public int UpdateCartItem(Int32 quantity, decimal totalprice, string cartid)
 {
     try
     {
         string query    = @"Update ShopingCart set Quantity = '" + quantity + "', TotalPrice = '" + totalprice + "' where CartId = '" + cartid + "'";
         object intvalue = MySqlDataAccess.ExecuteScalar(MySqlDataAccess.ConnectionString, CommandType.Text, query);
         return(Convert.ToInt32(intvalue));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
예제 #6
0
 public int UpdatePassword(string newpassword, string loginid)
 {
     try
     {
         string query    = "Update t_login set Password='******' where LoginID='" + loginid + "'";
         object intvalue = MySqlDataAccess.ExecuteScalar(MySqlDataAccess.ConnectionString, CommandType.Text, query);
         return(Convert.ToInt32(intvalue));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
예제 #7
0
 public int AddVideoUrl(string videotitle, string videourl, string videourlid, string date)
 {
     try
     {
         string query    = "Insert into t_video(videotitle,videourl,videourlid,video_date) values('" + videotitle + "','" + videourl + "','" + videourlid + "', '" + date + "')";
         object intvalue = MySqlDataAccess.ExecuteScalar(MySqlDataAccess.ConnectionString, CommandType.Text, query);
         return(Convert.ToInt32(intvalue));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
예제 #8
0
 public int ActiveWallet(string active, string loginid, int walletpin)
 {
     try
     {
         string query    = "update Wallet set wallStatus='" + active + "', WalletPin='" + walletpin + "' where WalletId=(select WalletId from Wallet where UserId='" + loginid + "')";
         object intvalue = MySqlDataAccess.ExecuteScalar(MySqlDataAccess.ConnectionString, CommandType.Text, query);
         return(Convert.ToInt32(intvalue));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
예제 #9
0
 public int UpdateUserInWishlist(string loginid, string wishid)
 {
     try
     {
         string query    = "update t_Wishlist set UserId='" + loginid + "' where WishId='" + wishid + "'";
         object intvalue = MySqlDataAccess.ExecuteScalar(MySqlDataAccess.ConnectionString, CommandType.Text, query);
         return(Convert.ToInt32(intvalue));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
예제 #10
0
    public string getuserInfo(string Userid, string password)
    {
        DataTable dt_login = new DataTable();
        string    result   = "";

        dt_login = MySqlDataAccess.ExecuteDataTable(MySqlDataAccess.ConnectionString, CommandType.Text, "SELECT loginid, username, loginattempt, password, logintype, Mobile, UserId FROM t_login where username='******' OR Mobile='" + Userid + "' and active='A'");
        if (dt_login.Rows.Count > 0 && password == Convert.ToString(dt_login.Rows[0]["password"]))
        {
            if (Convert.ToInt64(dt_login.Rows[0]["loginattempt"]) >= 10)
            {
                result = "Your Account is Disabled, please contact to administrator";
            }
            else
            {
                result = Convert.ToString(dt_login.Rows[0]["loginid"]) + "~" + Convert.ToString(dt_login.Rows[0]["username"]) + "~" + Convert.ToString(dt_login.Rows[0]["logintype"]) + "~" + Convert.ToString(dt_login.Rows[0]["UserId"]);
                string query          = @"update t_login set loginattempt = 0 where username='******'";
                object intReturnValue = MySqlDataAccess.ExecuteScalar(MySqlDataAccess.ConnectionString, CommandType.Text, query);
            }
        }
        else
        {
            try
            {
                if (dt_login.Rows.Count > 0)
                {
                    if (Convert.ToInt64(dt_login.Rows[0]["loginattempt"]) >= 3)
                    {
                        result = "Your Account is Disabled, please contact to administrator";
                    }
                    else
                    {
                        string query          = @"update t_login set loginattempt =(loginattempt)+1 where username='******'";
                        object intReturnValue = MySqlDataAccess.ExecuteScalar(MySqlDataAccess.ConnectionString, CommandType.Text, query);
                        result = "Invalid username or Password, please try again.";
                    }
                }
                else
                {
                    result = "Invalid username or Password, please try again.";
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        return(result);
    }
예제 #11
0
    public static long OrderDtID(string col, string table)
    {
        int count = 0;

        while (true)
        {
            count = count + 1;
            string query          = "select isnull(max(" + col + "),0) from " + table + "";
            object intReturnValue = MySqlDataAccess.ExecuteScalar(MySqlDataAccess.ConnectionString, CommandType.Text, query);
            if (Convert.ToInt64(intReturnValue) == 0)
            {
                intReturnValue = 1;
            }
            else
            {
                intReturnValue = Convert.ToInt64(intReturnValue) + 1;
            }
            return(Convert.ToInt64(intReturnValue));
        }
    }
예제 #12
0
    public static Int64 GenerateSUK(string col, string table)
    {
        int count = 0;

        while (true)
        {
            count = count + 1;
            string query          = "select isnull(max(" + col + "), 0) from " + table + "";
            object intReturnValue = MySqlDataAccess.ExecuteScalar(MySqlDataAccess.ConnectionString, CommandType.Text, query);
            string values         = Convert.ToString(intReturnValue);
            values = values.Replace(@"NZ", "");
            Int64 intvalue = 0;
            if (Convert.ToInt64(values) == 0)
            {
                intvalue = 1;
            }
            else
            {
                intvalue = Convert.ToInt64(values) + 1;
            }
            return(Convert.ToInt64(intvalue));
        }
    }