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; } }
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; } }
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; } }
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; } }
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; } }
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); }
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; } }
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; } }
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); }