Esempio n. 1
0
        public bool Add(SpecialSpellName entity)
        {
            string cmd = @"INSERT INTO [HrApp].[dbo].[SpecialSpellName] ([Name],[Code],[IsDeleted],[IsErrorSpell])
     VALUES ({Name},{Code},{IsDeleted},{IsErrorSpell}) ";

            return(CommonRepository.ExtInsert <SpecialSpellName>(cmd, SqlConnString, entity));
        }
        public bool Add(ContactData entity)
        {
            entity.InitData();
            string sql = entity.InsertSql();

            return(CommonRepository.ExtInsert <ContactData>(sql, SqlConnString, entity));
        }
        /// <summary>
        /// 初始化数据
        /// </summary>
        void InitTableData()
        {
            RelyTable rely = new RelyTable();
            //添加忽略项
            string sql = rely.GetInitDBRelactiveSql();

            CommonRepository.ExtInsert(sql, SqlConnString, rely);
        }
Esempio n. 4
0
        public bool Add(AppModel entity)
        {
            entity.IsDelete = 0;
            string sqlCmd = @"INSERT INTO [dbo].[App]  ([AppName],[AppCode],[IsDelete])
                    VALUES  ({AppName},{AppCode},{IsDelete}) ";

            return(CommonRepository.ExtInsert <AppModel>(sqlCmd, SqlConnString, entity));
        }
Esempio n. 5
0
        public bool Add(Model.Menu entity)
        {
            Menu m = new Menu()
            {
                IsEnable = true
            };
            string insert = SqlCmdHelper.GenerateInsertSql <Menu>();// m.InserSql();

            return(CommonRepository.ExtInsert <Menu>(insert, SqlConnString, entity));
        }
Esempio n. 6
0
        public bool WriteLog(ELogType type, string log, string title, bool isNormalLog)
        {
            DateTime appTime = Domain.GlobalModel.AppRunData.RunTime;//程序启动时的时间
            LogData  data    = new LogData()
            {
                CreateTime = DateTime.Now,
                Category   = (short)type.GetHashCode(),
                Id         = Guid.NewGuid(),
                IsError    = !isNormalLog,
                Note       = log,
                Title      = title
            };

            data.DayInt = int.Parse(data.CreateTime.ToString(CommonFormat.DateIntFormat));
            SqlCmdHelper cmd = new SqlCmdHelper()
            {
                SqlConnString = SqlConnString
            };
            string sql = SqlCmdHelper.GenerateInsertSql <LogData>();

            return(CommonRepository.ExtInsert(sql, SqlConnString, data));
            // throw new NotImplementedException();
        }
Esempio n. 7
0
        public bool SaveNote(ReportNote note)
        {
            string sql = note.GetInsertSql();

            return(CommonRepository.ExtInsert <ReportNote>(sql, SqlConnString, note));
        }