コード例 #1
0
        public List <string> GetListPropertiesChangedOfCalendar(LICHCONGTAC_BO calendar, LICHCONGTACBusiness lichCongTacBusiness)
        {
            List <string> result     = new List <string>();
            Type          entityType = typeof(LICHCONGTAC);

            if (calendar.LICH_GOC_ID != null)
            {
                LICHCONGTAC oldEntity = lichCongTacBusiness.Find(calendar.LICH_GOC_ID);
                LICHCONGTAC newEntity = lichCongTacBusiness.Find(calendar.ID);
                if (oldEntity != null && newEntity != null)
                {
                    foreach (string propertyName in arrProperties)
                    {
                        PropertyInfo propertyInfo = entityType.GetProperty(propertyName);
                        var          oldValue     = propertyInfo.GetValue(oldEntity);
                        var          newValue     = propertyInfo.GetValue(newEntity);
                        if (oldValue != newValue)
                        {
                            result.Add(propertyName);
                        }
                    }
                }
            }
            return(result);
        }
コード例 #2
0
        /// <summary>
        /// @author: duynn
        /// @description: thông tin chi tiết lịch công tác
        /// @since: 15/08/2018
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public LICHCONGTAC_BO GetDetailLichCongTac(long id)
        {
            LICHCONGTAC_BO result = new LICHCONGTAC_BO();

            LICHCONGTAC dbEntity = this.context.LICHCONGTAC.Find(id);

            if (dbEntity != null)
            {
                result.ID                = dbEntity.ID;
                result.TIEUDE            = dbEntity.TIEUDE;
                result.DIADIEM           = dbEntity.DIADIEM;
                result.GHICHU            = dbEntity.GHICHU;
                result.NGAY_CONGTAC_TEXT = dbEntity.GIO_CONGTAC + ":" + dbEntity.PHUT_CONGTAC + " " + string.Format("{0:dd/MM/yyyy}", dbEntity.NGAY_CONGTAC);
                result.TEN_LANHDAO       = this.context.DM_NGUOIDUNG.Where(x => x.ID == dbEntity.LANHDAO_ID).Select(x => x.HOTEN).FirstOrDefault();
            }
            return(result);
        }