/// <summary> /// /// </summary> /// <param name="modelDataDictionary"></param> /// <returns></returns> public ObjectModel.DataDictionary GetDataDictionaryByID(ObjectModel.DataDictionary modelDataDictionary) { var rmodel = new ConvertModel(); var dao = new DataDictionaryRepository(); var dataDataDictionary = dao.Query(s => s.Id == modelDataDictionary.Id).FirstOrDefault(); return(rmodel.ReturnModel <ObjectModel.DataDictionary, DataDictionary>(dataDataDictionary)); }
/// <summary> /// save Entity Method /// </summary> /// <param name="svarDataDictionary"></param> public Decimal Add(ObjectModel.DataDictionary svarDataDictionary) { svarDataDictionary.IsActive = "1"; var rmodel = new ConvertModel(); var sDataDictionary = rmodel.ReturnModel <DataDictionary, ObjectModel.DataDictionary>(svarDataDictionary); var dao = new DataDictionaryRepository(); var newItem = dao.Insert(sDataDictionary); return(newItem.Id); }
private IList <ObjectModel.DataDictionary> QueryData(Expression <Func <DataDictionary, bool> > filter, Expression <Func <DataDictionary, ObjectModel.DataDictionary> > selector) { var newfilter = ExpressionConverter <DataDictionary> .Convert(filter); var dao = new DataDictionaryRepository(); var dataList = dao.Query(newfilter, p => new ObjectModel.DataDictionary { //write something }).ToList(); return(dataList); }
/// <summary> /// Get Entity List /// </summary> /// <returns>List</returns> public IList <ObjectModel.DataDictionary> FindAll() { var rmodel = new ConvertModel(); var list = new List <ObjectModel.DataDictionary>(); var daDataDictionary = new DataDictionaryRepository(); foreach (var vartemp in daDataDictionary.Query(c => c.IsActive == "1")) { var omDataDictionary = rmodel.ReturnModel <ObjectModel.DataDictionary, DataDictionary>(vartemp); list.Add(omDataDictionary); } return(list); }
/// <summary> /// Edit Entity Method /// </summary> /// <param name="evarDataDictionary"></param> public void Update(ObjectModel.DataDictionary evarDataDictionary) { var rmodel = new ConvertModel(); var eDataDictionary = rmodel.ReturnModel <DataDictionary, ObjectModel.DataDictionary>(evarDataDictionary); var dao = new DataDictionaryRepository(); var dataDataDictionary = dao.Query(s => s.Id == evarDataDictionary.Id).FirstOrDefault(); //eDataDictionary.CreatedOn =dataDataDictionary.CreatedOn; //eDataDictionary.CreatedByEmployeeId =dataDataDictionary.CreatedByEmployeeId; //eDataDictionary.ModifiedByEmployeeId =ConstantManager.GetCurrentUserId(); //eDataDictionary.ModifiedOn =DateTime.Now; eDataDictionary.IsActive = dataDataDictionary.IsActive; dao.Update(eDataDictionary, c => c.Id == eDataDictionary.Id); }
public ObjectModel.DataDictionary GetSingleOrDefault(Expression <Func <ObjectModel.DataDictionary, bool> > filter, string orderBy) { var newfilter = ExpressionConverter <DataDictionary> .Convert(filter); var dao = new DataDictionaryRepository(); int recordCount = 0; var data = dao.QueryByPage(newfilter, orderBy, 1, 1, out recordCount).ToList().FirstOrDefault(); if (null == data) { return(null); } var list = new List <ObjectModel.DataDictionary>(); var rmodel = new ConvertModel(); return(rmodel.ReturnModel <ObjectModel.DataDictionary, DataDictionary>(data)); }
public IList <ObjectModel.DataDictionary> Query(Expression <Func <ObjectModel.DataDictionary, bool> > filter) { var newfilter = ExpressionConverter <DataDictionary> .Convert(filter); var dao = new DataDictionaryRepository(); var rmodel = new ConvertModel(); var list = new List <ObjectModel.DataDictionary>(); var dataList = dao.Query(newfilter).ToList(); if (null == dataList) { return(null); } foreach (var vartemp in dataList) { var omDataDictionary = rmodel.ReturnModel <ObjectModel.DataDictionary, DataDictionary>(vartemp); list.Add(omDataDictionary); } return(list); }
public IList <ObjectModel.DataDictionary> QueryByPage(Expression <Func <ObjectModel.DataDictionary, bool> > filter, string orderBy, int pageSize, int pageIndex, out int recordsCount) { var newfilter = ExpressionConverter <DataDictionary> .Convert(filter); var dao = new DataDictionaryRepository(); var dataList = dao.QueryByPage(newfilter, orderBy, pageSize, pageIndex, out recordsCount).ToList(); if (null == dataList) { return(null); } var list = new List <ObjectModel.DataDictionary>(); var rmodel = new ConvertModel(); foreach (var vartemp in dataList) { var omDataDictionary = rmodel.ReturnModel <ObjectModel.DataDictionary, DataDictionary>(vartemp); list.Add(omDataDictionary); } return(list); }
/// <summary> /// Delete Entity Method /// </summary> /// <param name="dvarDataDictionary"></param> public void Remove(ObjectModel.DataDictionary dvarDataDictionary) { var dao = new DataDictionaryRepository(); dao.Delete(s => s.Id == dvarDataDictionary.Id); }