Пример #1
0
 public static void UpdatePassword(LoginModel _model)
 {
     try
     {
         wlSQL objWLSql = new wlSQL();
         objWLSql.AddParameter("@UserID", DbType.Int64, ParameterDirection.Input, 0, _model.UserID);
         objWLSql.AddParameter("@Password", DbType.String, ParameterDirection.Input, 0, _model.LoginPassword);
         objWLSql.ExecuteNonQuery("p_Users_ChangePassword");
     }
     catch (Exception ex)
     {
         throw wlLogging.HandleEx(ex);
     }
 }
Пример #2
0
 public static void UpdateProfileImage(Users user)
 {
     try
     {
         wlSQL objWLSql = new wlSQL();
         objWLSql.AddParameter("@UserID", DbType.Int64, ParameterDirection.Input, 0, user.UserID);
         objWLSql.AddParameter("@ImageName", DbType.String, ParameterDirection.Input, 0, user.ImageName);
         objWLSql.AddParameter("@ModifiedBy", DbType.Int64, ParameterDirection.Input, 0, user.ModifiedBy);
         objWLSql.ExecuteNonQuery("p_Users_UpdateImage");
     }
     catch (Exception ex)
     {
         throw wlLogging.HandleEx(ex);
     }
 }
Пример #3
0
 public static void UpdateUserRoles(UserRoles _Userrole)
 {
     try
     {
         wlSQL objWLSql = new wlSQL();
         objWLSql.AddParameter("@UserID", DbType.Int64, ParameterDirection.Input, 0, _Userrole.UserID);
         objWLSql.AddParameter("@RoleID", DbType.Int32, ParameterDirection.Input, 0, _Userrole.RoleID);
         objWLSql.AddParameter("@IsRolePermission", DbType.Boolean, ParameterDirection.Input, 0, _Userrole.IsRolePermission);
         objWLSql.AddParameter("@ModifiedBy", DbType.Int32, ParameterDirection.Input, 0, _Userrole.ModifiedBy);
         objWLSql.ExecuteNonQuery("p_UserRoles_upd");
     }
     catch (Exception ex)
     {
         wlLogging.HandleEx(ex);
     }
 }
Пример #4
0
 public static void UpdateUser(Users user)
 {
     try
     {
         wlSQL objWLSql = new wlSQL();
         objWLSql.AddParameter("@UserID", DbType.Int64, ParameterDirection.Input, 0, user.UserID);
         objWLSql.AddParameter("@FirstName", DbType.String, ParameterDirection.Input, 0, user.FirstName);
         objWLSql.AddParameter("@LastName", DbType.String, ParameterDirection.Input, 0, user.LastName);
         objWLSql.AddParameter("@EmailAddress", DbType.String, ParameterDirection.Input, 0, user.EmailAddress);
         objWLSql.AddParameter("@StatusID", DbType.Int32, ParameterDirection.Input, 0, user.StatusID);
         objWLSql.AddParameter("@ModifiedBy", DbType.Int32, ParameterDirection.Input, 0, user.ModifiedBy);
         objWLSql.ExecuteNonQuery("p_Users_upd");
     }
     catch (Exception ex)
     {
         wlLogging.HandleEx(ex);
     }
 }
Пример #5
0
 public static void UpdateProduct(CarsProduct carsProduct)
 {
     try
     {
         wlSQL objWLSql = new wlSQL();
         objWLSql.AddParameter("@CarsProductId", DbType.String, ParameterDirection.Input, 0, carsProduct.CarsProductId);
         objWLSql.AddParameter("@Name", DbType.String, ParameterDirection.Input, 0, carsProduct.CarsProductName1);
         objWLSql.AddParameter("@CarsProductDescription", DbType.String, ParameterDirection.Input, 0, carsProduct.CarsProductDescription);
         objWLSql.AddParameter("@CarsColor", DbType.String, ParameterDirection.Input, 0, carsProduct.CarsColor);
         objWLSql.AddParameter("@CarsDoors", DbType.Int32, ParameterDirection.Input, 0, carsProduct.CarsDoors);
         //objWLSql.AddParameter("@CarsImagesUrl", DbType.String, ParameterDirection.Input, 0, carsProduct.CarsImagesUrl);
         objWLSql.AddParameter("@CarsKilometers", DbType.Int32, ParameterDirection.Input, 0, carsProduct.CarsKilometers);
         objWLSql.AddParameter("@CarsPrice", DbType.Int32, ParameterDirection.Input, 0, carsProduct.CarsPrice);
         objWLSql.ExecuteNonQuery("emi_carproduct");
     }
     catch (Exception ex)
     {
         wlLogging.HandleEx(ex);
     }
 }
Пример #6
0
        public static void RegisterUser(Register obj)
        {
            try
            {
                wlSQL objWLSql = new wlSQL();
                //objWLSql.AddParameter("@FullName", DbType.String, ParameterDirection.Input, 0, obj.FullName);
                objWLSql.AddParameter("@Mobile", DbType.String, ParameterDirection.Input, 0, obj.Mobile);
                objWLSql.AddParameter("@UserName", DbType.String, ParameterDirection.Input, 0, obj.UserName);
                objWLSql.AddParameter("@Password", DbType.String, ParameterDirection.Input, 0, obj.Password);
                objWLSql.AddParameter("@Email", DbType.String, ParameterDirection.Input, 0, obj.Email);
                objWLSql.AddParameter("@CountryID", DbType.Int32, ParameterDirection.Input, 0, obj.CountryID);
                objWLSql.AddParameter("@CityID", DbType.Int32, ParameterDirection.Input, 0, obj.CityID);

                objWLSql.ExecuteNonQuery("p_Users_register");
            }
            catch (Exception ex)
            {
                if (ex.GetBaseException().GetType() == typeof(SqlException))
                {
                    //Violation of primary key/Unique constraint can be handled here. Also you may //check if Exception Message contains the constraint Name
                }
            }
        }