示例#1
0
        public void CreateBuyDetails(int adpostId, int historyId, int userId, decimal totalprice, int delitype, int cityId,
                                     string currentstatus, int viewcount, string chargeName, int chargeType, double chargeAmount)
        {
            try
            {
                DALComponent dalComponent = new DALComponent();
                dalComponent.SetParameters("@adpostId", SqlDbType.Int, 4, adpostId);
                dalComponent.SetParameters("@historyId", SqlDbType.Int, 4, historyId);
                dalComponent.SetParameters("@userId", SqlDbType.Int, 4, userId);
                dalComponent.SetParameters("@totalprice", SqlDbType.Decimal, 9, totalprice);
                dalComponent.SetParameters("@delitype", SqlDbType.Int, 4, delitype);
                dalComponent.SetParameters("@cityId", SqlDbType.Int, 4, cityId);
                dalComponent.SetParameters("@currentstatus", SqlDbType.VarChar, 50, currentstatus);
                dalComponent.SetParameters("@viewcount", SqlDbType.Int, 4, viewcount);
                dalComponent.SetParameters("@chargeName", SqlDbType.VarChar, 50, chargeName);
                dalComponent.SetParameters("@chargeType", SqlDbType.Int, 4, chargeType);
                dalComponent.SetParameters("@chargeAmount", SqlDbType.Float, 9, chargeAmount);
                dalComponent.SetParameters("@idvalue", SqlDbType.Int, true);

                dalComponent.SqlCommandText = "[CreateBuyDetails]";
                int x = dalComponent.CreateRecord();

                object y = dalComponent.GetParameters("@idvalue");
            }
            catch (Exception ex)
            {
                throw;
            }
        }
示例#2
0
        public void CreateAdImageDetails(int imageId, int adpostId, string imagePath, string videoLink)
        {
            try
            {
                dalComponent = new DALComponent();
                dalComponent.SetParameters("@imageId", SqlDbType.Int, 4, imageId);
                dalComponent.SetParameters("@adpostId", SqlDbType.Int, 4, adpostId);
                dalComponent.SetParameters("@imagePath", SqlDbType.VarChar, 1000, imagePath);
                dalComponent.SetParameters("@videoLink", SqlDbType.VarChar, 1000, videoLink);
                dalComponent.SetParameters("@idvalue", SqlDbType.Int, true);

                dalComponent.SqlCommandText = "CreateAdImageDetails";
                int x = dalComponent.CreateRecord();

                object y = dalComponent.GetParameters("@idvalue");
                //int adpost_id = Int32.Parse(y.ToString());

                //if (imageId != 0)
                //    return imageId;
                //else
                //    return Int32.Parse(y.ToString());
            }
            catch (Exception ex)
            {
                throw;
            }
        }
示例#3
0
        public void CreateUserCart(int cartId, int userId, int adpostId)
        {
            try
            {
                DALComponent dalComponent = new DALComponent();
                dalComponent.SetParameters("@cartId", SqlDbType.Int, 4, cartId);
                dalComponent.SetParameters("@userId", SqlDbType.Int, 4, userId);
                dalComponent.SetParameters("@adpostId", SqlDbType.Int, 4, adpostId);
                dalComponent.SetParameters("@idvalue", SqlDbType.Int, true);

                dalComponent.SqlCommandText = "CreateUserCart";
                int x = dalComponent.CreateRecord();

                object y = dalComponent.GetParameters("@idvalue");
            }
            catch (Exception ex)
            {
                throw;
            }
        }
示例#4
0
        public int CreateAdPost(int adpostId, string adpostTitle, string description, string keywords, int userId, int categoryId, decimal price,
                                int stateId, int cityId, int countryId, string zipCode, DateTime adtillDate, string adStatus, int paidStatus)
        {
            try
            {
                dalComponent = new DALComponent();
                dalComponent.SetParameters("@adpostId", SqlDbType.Int, 4, adpostId);
                dalComponent.SetParameters("@adpostTitle", SqlDbType.VarChar, 500, adpostTitle);
                dalComponent.SetParameters("@description", SqlDbType.VarChar, 1000, description);
                dalComponent.SetParameters("@keywords", SqlDbType.VarChar, 1000, keywords);
                dalComponent.SetParameters("@userId", SqlDbType.Int, 4, userId);
                dalComponent.SetParameters("@categoryId", SqlDbType.Int, 4, categoryId);
                dalComponent.SetParameters("@price", SqlDbType.Decimal, 9, price);
                dalComponent.SetParameters("@stateId", SqlDbType.Int, 4, stateId);
                dalComponent.SetParameters("@cityId", SqlDbType.Int, 4, cityId);
                dalComponent.SetParameters("@countryId", SqlDbType.Int, 4, countryId);
                dalComponent.SetParameters("@zipCode", SqlDbType.VarChar, 50, zipCode);
                dalComponent.SetParameters("@adtillDate", SqlDbType.SmallDateTime, 4, adtillDate);
                dalComponent.SetParameters("@adStatus", SqlDbType.VarChar, 50, adStatus);
                dalComponent.SetParameters("@paidStatus", SqlDbType.Int, 4, paidStatus);
                dalComponent.SetParameters("@idvalue", SqlDbType.Int, true);

                dalComponent.SqlCommandText = "CreateAdPost";
                int x = dalComponent.CreateRecord();

                object y = dalComponent.GetParameters("@idvalue");

                if (adpostId != 0)
                {
                    return(adpostId);
                }
                else
                {
                    return(Int32.Parse(y.ToString()));
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
示例#5
0
 public int CreateUserInfo(UserProfile userDo)
 {
     try
     {
         dalComponent.SetParameters("@UserId", SqlDbType.Int, 4, userDo.UserId);
         dalComponent.SetParameters("@UserName", SqlDbType.VarChar, 100, userDo.UserName);
         dalComponent.SetParameters("@FirstName", SqlDbType.VarChar, 100, userDo.FirstName);
         dalComponent.SetParameters("@LastName", SqlDbType.VarChar, 100, userDo.LastName);
         dalComponent.SetParameters("@Gender", SqlDbType.Int, 4, userDo.Gender);
         dalComponent.SetParameters("@UserPassword", SqlDbType.VarChar, 50, userDo.UserPassword);
         dalComponent.SetParameters("@Email", SqlDbType.VarChar, 50, userDo.Email);
         dalComponent.SetParameters("@Mobile", SqlDbType.VarChar, 50, userDo.Mobile);
         dalComponent.SetParameters("@Address", SqlDbType.VarChar, 100, userDo.Address);
         dalComponent.SetParameters("@StreetName", SqlDbType.VarChar, 50, userDo.StreetName);
         dalComponent.SetParameters("@CityId", SqlDbType.Int, 4, userDo.CityId);
         dalComponent.SetParameters("@StateId", SqlDbType.Int, 4, userDo.StateId);
         dalComponent.SetParameters("@CountryId", SqlDbType.Int, 4, userDo.CountryId);
         dalComponent.SetParameters("@ZipCode", SqlDbType.VarChar, 50, userDo.ZipCode);
         dalComponent.SetParameters("@idvalue", SqlDbType.Int, true);
         dalComponent.SqlCommandText = "CreateUser";
         int    x = dalComponent.CreateRecord();
         object y = dalComponent.GetParameters("@idvalue");
         if (userDo.UserId != 0)
         {
             return(userDo.UserId);
         }
         else
         {
             return(Int32.Parse(y.ToString()));
         }
     }
     catch (System.Data.SqlClient.SqlException sqlEx)
     {
         throw;
     }
     catch (Exception ex)
     {
         throw;
     }
 }