public object UpdateHcPackagemasterInfo(object param) { Database db = DatabaseFactory.CreateDatabase(); object retObj = null; using (DbConnection connection = db.CreateConnection()) { connection.Open(); DbTransaction transaction = connection.BeginTransaction(); try { HcPackagemasterEntity hcPackagemasterEntity = (HcPackagemasterEntity)param; HcPackagemasterDAL hcPackagemasterDAL = new HcPackagemasterDAL(); retObj = (object)hcPackagemasterDAL.UpdateHcPackagemasterInfo(hcPackagemasterEntity, db, transaction); transaction.Commit(); } catch { transaction.Rollback(); throw; } finally { connection.Close(); } } return(retObj); }
public HcPackagemasterEntity GetSingleHcPackagemasterRecordById(object param) { Database db = DatabaseFactory.CreateDatabase(); string sql = "SELECT id, PackageName, PackageShorDesc, PackagePrice, createdby, createdDate, updateby, updateDate, isactive FROM HC_PackageMaster WHERE Id=@Id"; DbCommand dbCommand = db.GetSqlStringCommand(sql); db.AddInParameter(dbCommand, "Id", DbType.String, param); HcPackagemasterEntity hcPackagemasterEntity = null; using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { if (dataReader.Read()) { hcPackagemasterEntity = new HcPackagemasterEntity(); if (dataReader["id"] != DBNull.Value) { hcPackagemasterEntity.Id = dataReader["id"].ToString(); } if (dataReader["PackageName"] != DBNull.Value) { hcPackagemasterEntity.Packagename = dataReader["PackageName"].ToString(); } if (dataReader["PackageShorDesc"] != DBNull.Value) { hcPackagemasterEntity.Packageshordesc = dataReader["PackageShorDesc"].ToString(); } if (dataReader["PackagePrice"] != DBNull.Value) { hcPackagemasterEntity.Packageprice = dataReader["PackagePrice"].ToString(); } if (dataReader["createdby"] != DBNull.Value) { hcPackagemasterEntity.Createdby = dataReader["createdby"].ToString(); } if (dataReader["createdDate"] != DBNull.Value) { hcPackagemasterEntity.Createddate = dataReader["createdDate"].ToString(); } if (dataReader["updateby"] != DBNull.Value) { hcPackagemasterEntity.Updateby = dataReader["updateby"].ToString(); } if (dataReader["updateDate"] != DBNull.Value) { hcPackagemasterEntity.Updatedate = dataReader["updateDate"].ToString(); } if (dataReader["isactive"] != DBNull.Value) { hcPackagemasterEntity.Isactive = dataReader["isactive"].ToString(); } } } return(hcPackagemasterEntity); }
public bool UpdateHcPackagemasterInfo(HcPackagemasterEntity hcPackagemasterEntity, Database db, DbTransaction transaction) { string sql = "UPDATE HC_PackageMaster SET PackageName= @Packagename, PackageShorDesc= @Packageshordesc, PackagePrice= @Packageprice, createdby= @Createdby, createdDate= @Createddate, updateby= @Updateby, updateDate= @Updatedate, isactive= @Isactive WHERE Id=@Id"; DbCommand dbCommand = db.GetSqlStringCommand(sql); db.AddInParameter(dbCommand, "Id", DbType.String, hcPackagemasterEntity.Id); db.AddInParameter(dbCommand, "Packagename", DbType.String, hcPackagemasterEntity.Packagename); db.AddInParameter(dbCommand, "Packageshordesc", DbType.String, hcPackagemasterEntity.Packageshordesc); db.AddInParameter(dbCommand, "Packageprice", DbType.String, hcPackagemasterEntity.Packageprice); db.AddInParameter(dbCommand, "Createdby", DbType.String, hcPackagemasterEntity.Createdby); db.AddInParameter(dbCommand, "Createddate", DbType.String, hcPackagemasterEntity.Createddate); db.AddInParameter(dbCommand, "Updateby", DbType.String, hcPackagemasterEntity.Updateby); db.AddInParameter(dbCommand, "Updatedate", DbType.String, hcPackagemasterEntity.Updatedate); db.AddInParameter(dbCommand, "Isactive", DbType.String, hcPackagemasterEntity.Isactive); db.ExecuteNonQuery(dbCommand, transaction); return(true); }
public bool SaveHcPackagemasterInfo(HcPackagemasterEntity hcPackagemasterEntity, Database db, DbTransaction transaction) { string sql = "INSERT INTO HC_PackageMaster ( id, PackageName, PackageShorDesc, PackagePrice, createdby, createdDate, updateby, updateDate, isactive) VALUES ( @Id, @Packagename, @Packageshordesc, @Packageprice, @Createdby, @Createddate, @Updateby, @Updatedate, @Isactive )"; DbCommand dbCommand = db.GetSqlStringCommand(sql); db.AddInParameter(dbCommand, "Id", DbType.String, hcPackagemasterEntity.Id); db.AddInParameter(dbCommand, "Packagename", DbType.String, hcPackagemasterEntity.Packagename); db.AddInParameter(dbCommand, "Packageshordesc", DbType.String, hcPackagemasterEntity.Packageshordesc); db.AddInParameter(dbCommand, "Packageprice", DbType.String, hcPackagemasterEntity.Packageprice); db.AddInParameter(dbCommand, "Createdby", DbType.String, hcPackagemasterEntity.Createdby); db.AddInParameter(dbCommand, "Createddate", DbType.String, hcPackagemasterEntity.Createddate); db.AddInParameter(dbCommand, "Updateby", DbType.String, hcPackagemasterEntity.Updateby); db.AddInParameter(dbCommand, "Updatedate", DbType.String, hcPackagemasterEntity.Updatedate); db.AddInParameter(dbCommand, "Isactive", DbType.String, hcPackagemasterEntity.Isactive); db.ExecuteNonQuery(dbCommand, transaction); return(true); }
string getAllPackages() { string packageData = ""; HcPackagemasterEntity pmObj = new HcPackagemasterEntity(); HcPackagedetailsEntity pdObj = new HcPackagedetailsEntity(); pmObj.Isactive = "1"; DataTable dt = (DataTable)ExecuteDB(HCareTaks.AG_GetAllHcPackagemasterRecord, pmObj); if (dt.Rows.Count > 0) { foreach (DataRow dpm in dt.Rows) { packageData += @"<div class='card custome-card' style='background-image: url(" + dpm["packageImage"] + ") no-repeat; background-color: #ffffff' >" + "<a href = '/Home/Packages/" + dpm["ID"] + "'>" + "<img class='card-img-top' src=" + dpm["packageImage"] + " alt='Packeage iamge'>" + "<div class='card-body'>" + "<div class='row'>" + "<div class='col-md-8 col-lg-8 '>" + "<h4 class='card-title'>" + dpm["PackageName"] + "</h4>" + "<p class='card-text'>" + dpm["PackageShorDesc"] + "</p>" + "</div>" + "<div class='col-md-4 col-lg-4'>" + "<h3 class='card-title text-center'>" + dpm["PackagePrice"] + " </h3>" + "</div>" + "</div>" + "</div> </a> </div>"; } } return(packageData); }