示例#1
0
        /// <summary>
        /// ثبت کارمند جدید
        /// </summary>
        /// <param name="employee">کارمند</param>
        /// <returns>کارمند ثبت شده</returns>
        public Employee CreateEmployee(Employee employee)
        {
            PersistenceObjectRepository <Employee> .Create(employee);

            m_profilePictureRepository.Save(employee.ID.ToString(), employee.ProfilePicture);
            return(employee);
        }
示例#2
0
        /// <summary>
        /// ثبت گزارش خطای جدید
        /// </summary>
        /// <param name="log">گزارش خطا</param>
        /// <returns>گزارش خطای ثبت شده</returns>
        public Log CreateLog(Log log)
        {
            Log l_log = PersistenceObjectRepository <Log> .Create(log);

            m_logPictureRepository.Save(l_log.ID.ToString(), l_log.Picture);

            return(log);
        }
        /// <summary>
        /// دخیره سازی تصویر صورت
        /// </summary>
        /// <param name="bitmap">تصویر</param>
        /// <param name="id">شناسه خارجی</param>
        public static void SaveFaceBitmap(Bitmap bitmap, string id)
        {
            ///[Saving face bitmap]
            int key = FaceRepository.getKey(id);

            if (m_storageMethod == StorageMethod.ZipArchive)
            {
                m_facePictureRepository.Save(string.Format(@"{0}\{1}.jpg", key, Guid.NewGuid()), bitmap);
            }

            ///[Saving face bitmap]
            else if (m_storageMethod == StorageMethod.Directory)
            {
                if (!Directory.Exists(string.Format(@"faces\{0}", key)))
                {
                    Directory.CreateDirectory(string.Format(@"faces\{0}", key));
                }

                bitmap.Save(string.Format(@"faces\{0}\{1}.jpg", key, Guid.NewGuid()), ImageFormat.Jpeg);
            }

            m_xmlKeyValueDatabase[Convert.ToString(key)] = id;
        }