Пример #1
0
        public int SetBussinessLog(BussinessLogModel bussinessLog)
        {
            // add something to database
            DataCommand command = new DataCommand("InsertSystemLog", new SqlCustomDbCommand());

            command.SetParameterValue("@modelname", bussinessLog.ModelName);
            command.SetParameterValue("@logtime", bussinessLog.OperatorTime);
            command.SetParameterValue("@logcontent", string.IsNullOrEmpty(bussinessLog.OperatorContent) ? (bussinessLog.ModelName + "执行了操作。") : bussinessLog.OperatorContent);
            command.SetParameterValue("@optype", bussinessLog.ModelType);
            command.SetParameterValue("@username", bussinessLog.UserName);
            command.ExecuteNonQuery();
            return(0);
        }
Пример #2
0
        public override TModel TransferToModel <TContact, TModel>(TContact contact)
        {
            var bussinessLogModel = new BussinessLogModel();
            var model             = contact as QueryBussinessLog;

            if (model != null)
            {
                bussinessLogModel.ModelName       = model.ModelName;
                bussinessLogModel.ModelType       = model.ModelType;
                bussinessLogModel.OperatorContent = model.OperatorContent;
                bussinessLogModel.OperatorTime    = model.OperatorTime;
                bussinessLogModel.UserName        = model.UserName;
            }
            return(bussinessLogModel as TModel);
        }