示例#1
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;
            }
        }
示例#2
0
 public DataTable GetAdDetails(int adpostId, int userId)
 {
     dalComponent = new DALComponent();
     dalComponent.SetParameters("@adpostId", SqlDbType.Int, 4, adpostId);
     dalComponent.SetParameters("@userId", SqlDbType.Int, 4, userId);
     dalComponent.SqlCommandText = "[GetAdDetails]";
     return(dalComponent.SelectRecord());
 }
示例#3
0
 public DataTable SelectReportsByDate(DateTime FromDate, DateTime ToDate)
 {
     dalComponent = new DALComponent();
     dalComponent.SetParameters("@fromdate", SqlDbType.SmallDateTime, 4, FromDate);
     dalComponent.SetParameters("@todate", SqlDbType.SmallDateTime, 4, ToDate);
     dalComponent.SqlCommandText = "[SelectReportsByDate]";
     return(dalComponent.SelectRecord());
 }
示例#4
0
 public void UpdateCartStatus(int adpostId, int userid)
 {
     try
     {
         DALComponent dalComponent = new DALComponent();
         dalComponent.SetParameters("@adpostid", SqlDbType.Int, 4, adpostId);
         dalComponent.SetParameters("@userid", SqlDbType.Int, 4, userid);
         dalComponent.SqlCommandText = "[UpdateCartStatus]";
         int x = dalComponent.CreateRecord();
     }
     catch (Exception ex)
     {
         throw;
     }
 }
示例#5
0
 public DataTable SelectUserAds(int userId)
 {
     dalComponent = new DALComponent();
     dalComponent.SetParameters("@userId", SqlDbType.Int, 4, userId);
     dalComponent.SqlCommandText = "[SelectUserAds]";
     return(dalComponent.SelectRecord());
 }
示例#6
0
 public DataTable SelectReportsByCity(string cityname)
 {
     dalComponent = new DALComponent();
     dalComponent.SetParameters("@cityname", SqlDbType.VarChar, 50, cityname);
     dalComponent.SqlCommandText = "[SelectReportsByCity]";
     return(dalComponent.SelectRecord());
 }
示例#7
0
        public DataTable SelectChargeDetailsByID(int chargeId)
        {
            DALComponent dalComponent = new DALComponent();

            dalComponent.SetParameters("@chargeId", SqlDbType.Int, 4, chargeId);
            dalComponent.SqlCommandText = "[SelectChargeDetailsByID]";
            return(dalComponent.SelectRecord());
        }
示例#8
0
        public DataTable SelectCityById(int cityid)
        {
            DALComponent dalCom = new DALComponent();

            dalCom.SetParameters("@cityid", SqlDbType.Int, 4, cityid);
            dalCom.SqlCommandText = "[SelectCityById]";
            return(dalCom.SelectRecord());
        }
示例#9
0
        public DataTable SelectCityByName(string cityname)
        {
            DALComponent dalCom = new DALComponent();

            dalCom.SetParameters("@cityname", SqlDbType.VarChar, 50, cityname);
            dalCom.SqlCommandText = "[SelectCityByName]";
            return(dalCom.SelectRecord());
        }
示例#10
0
        public int CategoryGroupUpdate(int catid, string catname)
        {
            try
            {
                DALComponent dalComponent = new DALComponent();

                dalComponent.SetParameters("@categoryGroupId", SqlDbType.Int, 4, catid);
                dalComponent.SetParameters("@categoryGroupName", SqlDbType.VarChar, 100, catname);
                dalComponent.SqlCommandText = "CategoryGroupUpdate";
                int x = dalComponent.CreateRecord();
                return(x);
            }
            catch (Exception)
            {
                throw;
            }
            return(0);
        }
示例#11
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;
            }
        }
示例#12
0
 public void AdPostDeleteById(int adpostId)
 {
     try
     {
         dalComponent = new DALComponent();
         dalComponent.SetParameters("@adpostId", SqlDbType.Int, 4, adpostId);
         dalComponent.SqlCommandText = "AdPostDeleteById";
         int x = dalComponent.DeleteRecord();
     }
     catch (Exception)
     {
         throw;
     }
 }
示例#13
0
 public DataTable SearchUsers(string Keyword)
 {
     try
     {
         dalComponent = new DALComponent();
         dalComponent.SetParameters("@Keyword", SqlDbType.VarChar, 200, Keyword);
         dalComponent.SqlCommandText = "SearchUsers";
         return(dalComponent.SelectRecord());
     }
     catch (Exception ex)
     {
         throw;
     }
 }
示例#14
0
 public void ChargeDetailsDelete(int chargeId)
 {
     try
     {
         DALComponent dalComponent = new DALComponent();
         dalComponent.SetParameters("@chargeId", SqlDbType.Int, 4, chargeId);
         dalComponent.SqlCommandText = "[ChargeDetailsDelete]";
         int x = dalComponent.DeleteRecord();
     }
     catch (Exception)
     {
         throw;
     }
 }
示例#15
0
 public DataTable AvailableCategoryGroup(string groupName)
 {
     try
     {
         DALComponent dalComponent = new DALComponent();
         dalComponent.SetParameters("@groupname", SqlDbType.VarChar, 50, groupName);
         dalComponent.SqlCommandText = "[AvailableCategoryGroup]";
         return(dalComponent.SelectRecord());
     }
     catch (Exception ex)
     {
         throw;
     }
 }
示例#16
0
 public void CategoryGroupDelete(int catid)
 {
     try
     {
         DALComponent dalComponent = new DALComponent();
         dalComponent.SetParameters("@categoryGroupId", SqlDbType.Int, 4, catid);
         dalComponent.SqlCommandText = "CategoryGroupDelete";
         int x = dalComponent.DeleteRecord();
     }
     catch (Exception)
     {
         throw;
     }
 }
示例#17
0
 public void UpdateAdImagePath(int imageid, string imagepath)
 {
     try
     {
         dalComponent.SetParameters("@imageid", SqlDbType.Int, 4, imageid);
         dalComponent.SetParameters("@imagepath", SqlDbType.VarChar, 1000, imagepath);
         dalComponent.SqlCommandText = "UpdateImagePath";
         int x = dalComponent.CreateRecord();
     }
     catch (Exception ex)
     {
         throw;
     }
 }
示例#18
0
        public int CreateChargeDetails(int chargeId, int userId, string chargeName, int chargeType, double amtorpercent)
        {
            try
            {
                DALComponent dalComponent = new DALComponent();

                dalComponent.SetParameters("@userId", SqlDbType.Int, 4, userId);
                dalComponent.SetParameters("@chargeId", SqlDbType.Int, 4, chargeId);
                dalComponent.SetParameters("@chargeName", SqlDbType.VarChar, 50, chargeName);
                dalComponent.SetParameters("@chargeType", SqlDbType.Int, 4, chargeType);
                dalComponent.SetParameters("@amtorpercent", SqlDbType.Float, 18, amtorpercent);
                dalComponent.SetParameters("@idvalue", SqlDbType.Int, true);
                dalComponent.SqlCommandText = "[CreateChargeDetails]";
                int x = dalComponent.CreateRecord();
                return(x);
            }
            catch (Exception)
            {
                throw;
            }
            return(0);
        }
示例#19
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;
     }
 }
示例#20
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;
            }
        }
示例#21
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;
            }
        }