Ejemplo n.º 1
0
        /// <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);
        }