public int InsertAdPostByAdmin(AdDetailsEntity Obj) { int AddId = 0; try { using (DbCommand objDbCommand = DBAccessHelper.GetDBCommand(ConnectionManager.DatabaseToConnect.RaiteRajuDefaultInstance, StoredProcedures.SPAdPostByAdmin)) { DBAccessHelper.AddInputParametersWithValues(objDbCommand, DataAccessConstants.ParamAdCategory, DbType.String, Obj.Category); DBAccessHelper.AddInputParametersWithValues(objDbCommand, DataAccessConstants.ParamAdDescription, DbType.String, Obj.AdDescription); DBAccessHelper.AddInputParametersWithValues(objDbCommand, DataAccessConstants.ParamSubCategoryName, DbType.String, Obj.txtSubCategoryName); DBAccessHelper.AddInputParametersWithValues(objDbCommand, DataAccessConstants.ParamPrice, DbType.Int32, Obj.Price); DBAccessHelper.AddInputParametersWithValues(objDbCommand, DataAccessConstants.ParamQuantity, DbType.Int32, Obj.Quantity); DBAccessHelper.AddInputParametersWithValues(objDbCommand, DataAccessConstants.ParamSellingUnit, DbType.String, Obj.SellingUnit); DBAccessHelper.AddInputParametersWithValues(objDbCommand, DataAccessConstants.ParamPhoneNumber, DbType.String, Obj.MobileNumber); IDataReader dr = DBAccessHelper.ExecuteReader(objDbCommand); while (dr.Read()) { AddId = Convert.ToInt32(dr[DataAccessConstants.ParamAdId]); } } } catch (Exception ex) { ExceptionLoggin("ManagementDal", "InsertAddPostDetails", ex.Message); return(0); } return(AddId); }
internal AdDetailsModel MapAdDetailsEntityToAdDetailsModel(AdDetailsEntity AdEntity) { AdDetailsModel AdObj; if (AdEntity != null) { AdObj = new AdDetailsModel(); AdObj.AdID = AdEntity.AdID; AdObj.txtAddTitle = AdEntity.Title; AdObj.Category = AdEntity.Category; AdObj.txtSubCategoryName = AdEntity.txtSubCategoryName; AdObj.txtAdDescription = AdEntity.AdDescription; AdObj.txtPrice = AdEntity.Price; AdObj.txtQuantity = AdEntity.Quantity; AdObj.SellingUnit = AdEntity.SellingUnit; AdObj.Image = AdEntity.Image; AdObj.Location = AdEntity.Location; AdObj.Name = AdEntity.Name; AdObj.MobileNuber = AdEntity.MobileNumber; AdObj.PostedDate = AdEntity.PostedDate; return(AdObj); } else { return(null); } }
public int UploadImage(AdDetailsEntity Obj) { int AddId = 0; try { using (DbCommand objDbCommand = DBAccessHelper.GetDBCommand(ConnectionManager.DatabaseToConnect.RaiteRajuDefaultInstance, StoredProcedures.SPUPLOADIMAGE)) { DBAccessHelper.AddInputParametersWithValues(objDbCommand, DataAccessConstants.PARAMPHOTO, DbType.Binary, Obj.Image); DBAccessHelper.AddInputParametersWithValues(objDbCommand, DataAccessConstants.ParamAdId, DbType.Int32, Obj.AdID); DBAccessHelper.AddInputParametersWithValues(objDbCommand, DataAccessConstants.ParamUserId, DbType.Int32, Obj.UserID); IDataReader dr = DBAccessHelper.ExecuteReader(objDbCommand); while (dr.Read()) { AddId = Convert.ToInt32(dr[DataAccessConstants.ParamAdId]); } } } catch (Exception ex) { ExceptionLoggin("ManagementDal", "UploadImage", ex.Message); return(0); } return(AddId); }
public void UpdateAdDetails(AdDetailsModel Obj) { ManagementObjectMapper objMapper = new ManagementObjectMapper(); AdDetailsEntity Entity = new AdDetailsEntity(); Entity = objMapper.MapAddPostModelToAddPostEntity(Obj); ServiceLayer.ManagementService ManObj = new ManagementService(); ManObj.UpdateAdDetails(Entity); }
public int UploadImage(AdDetailsModel obj) { ManagementObjectMapper objMapper = new ManagementObjectMapper(); AdDetailsEntity Entity = new AdDetailsEntity(); Entity = objMapper.MapAddPostModelToAddPostEntity(obj); ServiceLayer.ManagementService ManObj = new ManagementService(); return(ManObj.UploadImage(Entity)); }
public int InsertAdPostByAdmin(AdDetailsModel ModelObj) { ManagementObjectMapper objMapper = new ManagementObjectMapper(); AdDetailsEntity Entity = new AdDetailsEntity(); Entity = objMapper.MapAddPostModelToAddPostEntity(ModelObj); ServiceLayer.ManagementService ManObj = new ManagementService(); return(ManObj.InsertAdPostByAdmin(Entity)); }
public AdDetailsModel SPRRGetAdDisplayDetails(Int32 AdId) { AdDetailsModel Model = new AdDetailsModel(); AdDetailsEntity Entity = new AdDetailsEntity(); ServiceLayer.InformationService obj = new InformationService(); InformationObjectMapper ObjMapper = new InformationObjectMapper(); Entity = obj.SPRRGetAdDisplayDetails(AdId); Model = ObjMapper.MapAdDetailsEntityToAdDetailsModel(Entity); return(Model); }
public AdDetailsModel FetchAdDetails(int AdId) { AdDetailsModel modelObj = new AdDetailsModel(); AdDetailsEntity EntityObj = new AdDetailsEntity(); ServiceLayer.InformationService obj = new InformationService(); InformationObjectMapper ObjMapper = new InformationObjectMapper(); EntityObj = obj.FetchAdDetails(AdId); modelObj = ObjMapper.MapAdDetailsEntityToModel(EntityObj); return(modelObj); }
public AdDetailsModel GetImage(AdDetailsModel Detobj) { AdDetailsModel modelObjoutPut = new AdDetailsModel(); AdDetailsEntity EntityObj1 = new AdDetailsEntity(); AdDetailsEntity EntityObj2 = new AdDetailsEntity(); ServiceLayer.InformationService obj = new InformationService(); InformationObjectMapper ObjMapper = new InformationObjectMapper(); EntityObj1 = ObjMapper.MapAdDetailsModelToEntity(Detobj); EntityObj2 = obj.GetImage(EntityObj1); modelObjoutPut = ObjMapper.MapAdDetailsEntityToModel(EntityObj2); return(modelObjoutPut); }
internal AdDetailsEntity MapAddPostModelToAddPostEntity(AdDetailsModel Model) { AdDetailsEntity Entity = new AdDetailsEntity(); Entity.AdID = Model.AdID; Entity.Title = Model.txtAddTitle; Entity.Category = Model.Category; Entity.txtSubCategoryName = Model.txtSubCategoryName; Entity.AdDescription = Model.txtAdDescription; Entity.Price = Model.txtPrice; Entity.Quantity = Model.txtQuantity; Entity.UserID = Model.UserID; Entity.SellingUnit = Model.SellingUnit; Entity.MobileNumber = Model.MobileNuber; Entity.Image = Model.Image; return(Entity); }
internal AdDetailsModel MapAdDetailsEntityToModel(AdDetailsEntity Entity) { if (Entity != null) { AdDetailsModel MODEL = new AdDetailsModel(); MODEL.AdID = Entity.AdID; MODEL.txtAddTitle = Entity.Title; MODEL.txtAdDescription = Entity.AdDescription; MODEL.Category = Entity.Category; MODEL.txtSubCategoryName = Entity.txtSubCategoryName; MODEL.txtPrice = Entity.Price; MODEL.txtQuantity = Entity.Quantity; MODEL.SellingUnit = Entity.SellingUnit; MODEL.Image = Entity.Image; return(MODEL); } else { return(null); } }
public void UpdateAdDetails(AdDetailsEntity Obj) { try { using (DbCommand objDbCommand = DBAccessHelper.GetDBCommand(ConnectionManager.DatabaseToConnect.RaiteRajuDefaultInstance, StoredProcedures.SPUPDATEADDETAILS)) { DBAccessHelper.AddInputParametersWithValues(objDbCommand, DataAccessConstants.ParamAdId, DbType.String, Obj.AdID); // DBAccessHelper.AddInputParametersWithValues(objDbCommand, DataAccessConstants.ParamAdTitle, DbType.String, Obj.Title); DBAccessHelper.AddInputParametersWithValues(objDbCommand, DataAccessConstants.ParamAdCategory, DbType.String, Obj.Category); DBAccessHelper.AddInputParametersWithValues(objDbCommand, DataAccessConstants.ParamSubCategoryName, DbType.String, Obj.txtSubCategoryName); DBAccessHelper.AddInputParametersWithValues(objDbCommand, DataAccessConstants.ParamAdDescription, DbType.String, Obj.AdDescription); DBAccessHelper.AddInputParametersWithValues(objDbCommand, DataAccessConstants.ParamPrice, DbType.String, Obj.Price); DBAccessHelper.AddInputParametersWithValues(objDbCommand, DataAccessConstants.ParamQuantity, DbType.String, Obj.Quantity); DBAccessHelper.AddInputParametersWithValues(objDbCommand, DataAccessConstants.ParamSellingUnit, DbType.String, Obj.SellingUnit); DBAccessHelper.ExecuteNonQuery(objDbCommand); } } catch (Exception ex) { ExceptionLoggin("ManagementDal", "UpdateAdDetails", ex.Message); } }
public int SPInsertAdViewsStatistics(AdDetailsEntity Entity) { int Success = 0; try { using (DbCommand objDbCommand = DBAccessHelper.GetDBCommand(ConnectionManager.DatabaseToConnect.RaiteRajuDefaultInstance, StoredProcedures.SPInsertAdViewsStatistics)) { DBAccessHelper.AddInputParametersWithValues(objDbCommand, DataAccessConstants.ParamUserId, DbType.Int32, Entity.UserID); DBAccessHelper.AddInputParametersWithValues(objDbCommand, DataAccessConstants.ParamPhoneNumber, DbType.Int64, Entity.MobileNumber); DBAccessHelper.AddInputParametersWithValues(objDbCommand, DataAccessConstants.ParamAdId, DbType.Int32, Entity.AdID); Success = DBAccessHelper.ExecuteNonQuery(objDbCommand); } } catch (Exception ex) { ExceptionLoggin("ManagementDal", "SPInsertAdViewsStatistics", ex.Message); Success = 0; } return(Success); }
public int InsertAddPostDetails(AdDetailsEntity obj) { ManagementBusinessLayerInterface ManageObj = new BusinessLayer.ManagementBusinessLayer(); return(ManageObj.InsertAddPostDetails(obj)); }
public int InsertAddPostDetails(AdDetailsEntity Obj) { return(new DAL.ManagementDAL().InsertAddPostDetails(Obj)); }
public void UpdateAdDetails(AdDetailsEntity Obj) { ManagementBusinessLayerInterface ManageObj = new BusinessLayer.ManagementBusinessLayer(); ManageObj.UpdateAdDetails(Obj); }
public int UploadImage(AdDetailsEntity Obj) { ManagementBusinessLayerInterface ManageObj = new BusinessLayer.ManagementBusinessLayer(); return(ManageObj.UploadImage(Obj)); }
public AdDetailsEntity GetImage(AdDetailsEntity obj) { InformationBusinessLayerInterface BusObj = new BusinessLayer.InformationBusinessLayer(); return(BusObj.GetImage(obj)); }
public int InsertAdPostByAdmin(AdDetailsEntity Obj) { ManagementBusinessLayerInterface ManageObj = new BusinessLayer.ManagementBusinessLayer(); return(ManageObj.InsertAdPostByAdmin(Obj)); }
public AdDetailsEntity GetImage(AdDetailsEntity obj) { return(new DAL.InformationDAL().GetImage(obj)); }
public int SPInsertAdViewsStatistics(AdDetailsEntity Entity) { return(new DAL.ManagementDAL().SPInsertAdViewsStatistics(Entity)); }
public void UpdateAdDetails(AdDetailsEntity Obj) { DAL.ManagementDAL OBJ = new DAL.ManagementDAL(); OBJ.UpdateAdDetails(Obj); }
public int UploadImage(AdDetailsEntity Obj) { return(new DAL.ManagementDAL().UploadImage(Obj)); }
public int SPInsertAdViewsStatistics(AdDetailsEntity Entity) { ManagementBusinessLayerInterface ManageObj = new BusinessLayer.ManagementBusinessLayer(); return(ManageObj.SPInsertAdViewsStatistics(Entity)); }