/// <summary> /// /// </summary> /// <param name="modelOrgChart"></param> /// <returns></returns> public ObjectModel.OrgChart GetOrgChartByID(ObjectModel.OrgChart modelOrgChart) { var rmodel = new ConvertModel(); var dao = new OrgChartRepository(); var dataOrgChart = dao.Query(s => s.Id == modelOrgChart.Id).FirstOrDefault(); return(rmodel.ReturnModel <ObjectModel.OrgChart, OrgChart>(dataOrgChart)); }
private IList <ObjectModel.OrgChart> QueryData(Expression <Func <OrgChart, bool> > filter, Expression <Func <OrgChart, ObjectModel.OrgChart> > selector) { var newfilter = ExpressionConverter <OrgChart> .Convert(filter); var dao = new OrgChartRepository(); var dataList = dao.Query(newfilter, p => new ObjectModel.OrgChart { //write something }).ToList(); return(dataList); }
/// <summary> /// Get Entity List /// </summary> /// <returns>List</returns> public IList <ObjectModel.OrgChart> FindAll() { var rmodel = new ConvertModel(); var list = new List <ObjectModel.OrgChart>(); var daOrgChart = new OrgChartRepository(); foreach (var vartemp in daOrgChart.Query(c => c.IsActive == "1")) { var omOrgChart = rmodel.ReturnModel <ObjectModel.OrgChart, OrgChart>(vartemp); list.Add(omOrgChart); } return(list); }
/// <summary> /// Edit Entity Method /// </summary> /// <param name="evarOrgChart"></param> public void Update(ObjectModel.OrgChart evarOrgChart) { var rmodel = new ConvertModel(); var eOrgChart = rmodel.ReturnModel <OrgChart, ObjectModel.OrgChart>(evarOrgChart); var dao = new OrgChartRepository(); var dataOrgChart = dao.Query(s => s.Id == evarOrgChart.Id).FirstOrDefault(); eOrgChart.CreatedOn = dataOrgChart.CreatedOn; eOrgChart.CreatedByEmployeeId = dataOrgChart.CreatedByEmployeeId; eOrgChart.ModifiedByEmployeeId = ConstantManager.GetCurrentUserId(); eOrgChart.ModifiedOn = DateTime.Now; eOrgChart.IsActive = dataOrgChart.IsActive; dao.Update(eOrgChart, c => c.Id == eOrgChart.Id); }
public IList <ObjectModel.OrgChart> Query(Expression <Func <ObjectModel.OrgChart, bool> > filter) { var newfilter = ExpressionConverter <OrgChart> .Convert(filter); var dao = new OrgChartRepository(); var rmodel = new ConvertModel(); var list = new List <ObjectModel.OrgChart>(); var dataList = dao.Query(newfilter).ToList(); if (null == dataList) { return(null); } foreach (var vartemp in dataList) { var omOrgChart = rmodel.ReturnModel <ObjectModel.OrgChart, OrgChart>(vartemp); list.Add(omOrgChart); } return(list); }