示例#1
0
        /// <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);
                }
            }
        }
 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
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="unitOfWork"></param>
 /// <param name="context"></param>
 public UserRoleHandler(IUnitOfWork unitOfWork, klinikEntities context)
 {
     _unitOfWork = unitOfWork;
     _context    = context;
 }
示例#7
0
 /// <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;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="unitOfWork"></param>
 /// <param name="context"></param>
 public PasswordHistoryValidator(IUnitOfWork unitOfWork, klinikEntities context)
 {
     _unitOfWork = unitOfWork;
     _context    = context;
 }
示例#10
0
 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;
 }
        /// <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
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="unitOfWork"></param>
 public DoctorHandler(IUnitOfWork unitOfWork, klinikEntities context = null)
 {
     _unitOfWork = unitOfWork;
     _context    = context;
 }
示例#17
0
 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;
 }