コード例 #1
0
ファイル: BaseFeatures.cs プロジェクト: adityawa/KlinikMin
        /// <summary>
        /// Log any executed command by user
        /// </summary>
        /// <param name="module"></param>
        /// <param name="status"></param>
        /// <param name="command"></param>
        /// <param name="account"></param>
        /// <param name="newValue"></param>
        /// <param name="oldValue"></param>
        public static void CommandLog(bool status, ClinicEnums.Module module, string command, AccountModel account, object newValue = null, object oldValue = null)
        {
            try
            {
                var log = new LogModel
                {
                    Start        = DateTime.Now,
                    Module       = module.ToString(),
                    Status       = status ? "SUCCESS" : "ERROR",
                    Command      = command,
                    UserName     = account.UserName,
                    Organization = account.Organization,
                    OldValue     = oldValue is null ? null : JsonConvert.SerializeObject(oldValue),
                    NewValue     = newValue is null ? null : JsonConvert.SerializeObject(newValue),
                    CreatedBy    = account.UserCode,
                    CreatedDate  = DateTime.Now
                };

                var _entity = Mapper.Map <LogModel, Log>(log);

                using (var context = new klinikEntities())
                {
                    context.Logs.Add(_entity);
                    context.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                using (EventLog eventLog = new EventLog("Application"))
                {
                    eventLog.Source = "Application";
                    eventLog.WriteEntry(ex.GetAllMessages(), EventLogEntryType.Error, 101, 1);
                }
            }
        }
コード例 #2
0
 public MasterDataController(IUnitOfWork unitOfWork, klinikEntities context)
 {
     _unitOfWork = unitOfWork;
     _context    = context;
 }
コード例 #3
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="unitOfWork"></param>
        ///

        public EmployeeHandler(IUnitOfWork unitOfWork, klinikEntities context = null)
        {
            _unitOfWork = unitOfWork;
            _context    = context;
        }
コード例 #4
0
 public EmployeeValidator(IUnitOfWork unitOfWork, klinikEntities context)
 {
     _unitOfWork = unitOfWork;
     _context    = context;
 }
コード例 #5
0
 public LabController(IUnitOfWork unitOfWork, klinikEntities context, ClinicHandler clinicHandler)
 {
     _unitOfWork    = unitOfWork;
     _context       = context;
     _clinicHandler = clinicHandler;
 }
コード例 #6
0
ファイル: UserRoleHandler.cs プロジェクト: adityawa/KlinikMin
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="unitOfWork"></param>
 /// <param name="context"></param>
 public UserRoleHandler(IUnitOfWork unitOfWork, klinikEntities context)
 {
     _unitOfWork = unitOfWork;
     _context    = context;
 }
コード例 #7
0
ファイル: BaseController.cs プロジェクト: adityawa/KlinikMin
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="unitOfWork"></param>
 /// <param name="context"></param>
 public BaseController(IUnitOfWork unitOfWork, klinikEntities context)
 {
     _unitOfWork = unitOfWork;
     _context    = context;
 }
コード例 #8
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="unitOfWork"></param>
 /// <param name="context"></param>
 public AccountHandler(IUnitOfWork unitOfWork, klinikEntities context)
 {
     _unitOfWork = unitOfWork;
     _context    = context;
 }
コード例 #9
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="unitOfWork"></param>
 /// <param name="context"></param>
 public PasswordHistoryValidator(IUnitOfWork unitOfWork, klinikEntities context)
 {
     _unitOfWork = unitOfWork;
     _context    = context;
 }
コード例 #10
0
ファイル: DoctorValidator.cs プロジェクト: adityawa/KlinikMin
 public DoctorValidator(IUnitOfWork unitOfWork, klinikEntities context)
 {
     _unitOfWork = unitOfWork;
     _context    = context;
 }
コード例 #11
0
 public AdministrationController(IUnitOfWork unitOfWork, klinikEntities context) :
     base(unitOfWork, context)
 {
 }
コード例 #12
0
 /// <summary>
 /// Contructor
 /// </summary>
 /// <param name="unitOfWork"></param>
 /// <param name="context"></param>
 public UserRoleValidator(IUnitOfWork unitOfWork, klinikEntities context)
 {
     _unitOfWork = unitOfWork;
     _context    = context;
 }
コード例 #13
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="privilege_name"></param>
        public CustomAuthorizeAttribute(params string[] privilege_name)
        {
            this._privilege_names = privilege_name;

            _context = new klinikEntities();
        }
コード例 #14
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="unitOfWork"></param>
 /// <param name="context"></param>
 public RolePrivilegeHandler(IUnitOfWork unitOfWork, klinikEntities context)
 {
     _unitOfWork = unitOfWork;
     _context    = context;
 }
コード例 #15
0
 public PasswordHistoryController(IUnitOfWork unitOfWork, klinikEntities context)
 {
     _context    = context;
     _unitOfWork = unitOfWork;
 }
コード例 #16
0
ファイル: DoctorHandler.cs プロジェクト: adityawa/KlinikMin
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="unitOfWork"></param>
 public DoctorHandler(IUnitOfWork unitOfWork, klinikEntities context = null)
 {
     _unitOfWork = unitOfWork;
     _context    = context;
 }
コード例 #17
0
ファイル: UnitOfWork.cs プロジェクト: adityawa/KlinikMin
 public UnitOfWork(klinikEntities context)
 {
     _context = context;
 }
コード例 #18
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="unitOfWork"></param>
 /// <param name="context"></param>
 public OrganizationPrivilegeValidator(IUnitOfWork unitOfWork, klinikEntities context)
 {
     _unitOfWork = unitOfWork;
     _context    = context;
 }
コード例 #19
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="unitOfWork"></param>
 /// <param name="context"></param>
 public RolePrivilegeValidator(IUnitOfWork unitOfWork, klinikEntities context)
 {
     _unitOfWork = unitOfWork;
     _context    = context;
 }