//private AppDbContext db;// = new AppDbContext(); #endregion /// <summary> /// Inserts a new row in the MdmDQQue table. /// </summary> /// <param name="que">A MdmDQQue object.</param> /// <returns>An updated MdmDQQue object.</returns> public MdmEntityDetails Insert(MdmEntityDetails mdmdque) { using (var db = new AppDbContext()) { db.Set <MdmEntityDetails>().Add(mdmdque); db.SaveChanges(); return(mdmdque); } }
public bool CreateDQIParam(string tblCat, string tblCol, string tblWeight, string tblName) { //string salt = null; //MdmWeights Mdmw = new MdmWeights(); ////Mdmw.WEIGHT_ID = WeightValue; //Mdmw.WEIGHT_VALUE = Convert.ToInt16(WeightValue); //Mdmw.CREATED_BY = "admin"; //Mdmw.CREATED_DATE = DateTime.Now; //Mdmw.RECORD_STATUS = "Y"; //DQIdb.MDM_WEIGHTS.Add(Mdmw); //DQIdb.SaveChanges(); //if (Mdmw.WEIGHT_ID == null) //{ // return false; //} //else //{ // return true; //} //ICollection<CM_USER_ROLE_XREF> UserRoleColl = new Collection<CM_USER_ROLE_XREF>(); //EntityDetails entityObj = new EntityDetails(); decimal ENTITY_DETAIL_ID = 0; using (var mdm = new AppDbContext()) { var entityObj = new MdmEntityDetails { ENTITY_TAB_NAME = tblName, ENTITY_COL_NAME = tblCol, FLG_MANDATORY = true, WEIGHT_ID = Convert.ToInt16(tblWeight), CREATED_BY = "Admin", RECORD_STATUS = true, CREATED_DATE = DateTime.Now, }; mdm.EntityDetails.Add(entityObj); mdm.SaveChanges(); ENTITY_DETAIL_ID = entityObj.ENTITY_DETAIL_ID; }; if (ENTITY_DETAIL_ID == null) { return(false); } else { return(true); } }
/// <summary> /// Updates the queitem /// </summary> /// <param name="queitem">queitem</param> public virtual void UpdateParamItem(MdmEntityDetails queitem) { if (queitem == null) { throw new ArgumentNullException("queitem"); } _dqparamDAC.Update(queitem); //event notification //_eventPublisher.EntityUpdated(vendor); }
/// <summary> /// Updates an existing row in the mdmdque table. /// </summary> /// <param name="mdmdque">A mdmdque entity object.</param> public void Update(MdmEntityDetails mdmdque) { using (var db = new AppDbContext()) { var entry = db.Entry <MdmEntityDetails>(mdmdque); // Re-attach the entity. entry.State = EntityState.Modified; db.SaveChanges(); } }