Exemplo n.º 1
0
        public async Task <bool> AddAsync(Product prod)
        {
            string sql = @"INSERT INTO Product 
                            (Name
                            ,Quantity
                            ,Price
                            ,CategoryId)
                        VALUES
                            (@Name
                            ,@Quantity
                            ,@Price
                            ,@CategoryId)";

            return(await _context.ExecuteAsync(sql, prod) > 0);
        }
Exemplo n.º 2
0
        public async Task <bool> AddAsync(Products prod)
        {
            string sql = @"INSERT INTO Products 
                        (ProductName
                        ,QuantityPerUnit
                        ,UnitPrice
                        ,CategoryID)
                    VALUES
                        (@ProductName
                        ,@QuantityPerUnit
                        ,@UnitPrice
                        ,@CategoryID)";

            return(await _context.ExecuteAsync(sql, prod) > 0);
        }
        public async Task <bool> AddAsync(ESysAlarmLevel eSysAlarmLevel)
        {
            string sql = "insert into Sys_AlarmLevel(AlarmLevel,AlarmType,iAlarmLevel) values(@AlarmLevel,@AlarmType,@iAlarmLevel);select @@Identity;";

            return(await _context.ExecuteAsync(sql, eSysAlarmLevel) > 0);
        }
        public async Task <bool> InsertAsync(UserInfo userInfo)
        {
            var b = await _context.ExecuteAsync("INSERT INTO UserInfo VALUES (@Id ,@UserId,@Age,@Birthday,@PhoneNumber,@Email,@QQ,@AddTime,@IsDelete)", userInfo) > 0;

            return(b);
        }
        public async Task <bool> AddAsync(ESysKeywords eSysKeywords)
        {
            string sql = "insert into Sys_Keywords(Keyword,ReplaceValue,Status) values(@Keyword,@ReplaceValue,@Status);select @@Identity;";

            return(await _context.ExecuteAsync(sql, eSysKeywords) > 0);
        }
Exemplo n.º 6
0
        public async Task <bool> AddAsync(ESysUserRole eSysUserRole)
        {
            string sql = "insert into Sys_UserRole(RoleID,UserID,UserName) values(@RoleID,@UserID,@UserName);select @@Identity;";

            return(await _context.ExecuteAsync(sql, eSysUserRole) > 0);
        }
Exemplo n.º 7
0
        public async Task <bool> AddAsync(Category category)
        {
            string sql = @"INSERT INTO category (Name) VALUES (@Name)";

            return(await _context.ExecuteAsync(sql, category) > 0);
        }
Exemplo n.º 8
0
 public Task <int> SQLExecute(string sql, object param = null, bool isCommandTypeText = true)
 {
     return(_context.ExecuteAsync(sql, param, isCommandTypeText ? CommandType.Text : CommandType.StoredProcedure));
 }
Exemplo n.º 9
0
        public async Task <bool> AddAsync(EMessageBox eMessageBox)
        {
            string sql = "insert into MessageBox(Sender,SenderID,Receiver,ReceiverID,SendTime,CreateTime,Title,Content,Type,Status) values(@Sender,@SenderID,@Receiver,@ReceiverID,@SendTime,@CreateTime,@Title,@Content,@Type,@Status);select @@Identity;";

            return(await _context.ExecuteAsync(sql, eMessageBox) > 0);
        }
Exemplo n.º 10
0
        public async Task <bool> DeleteAsync(int MenuID)
        {
            string sql = "delete from Sys_Menu where MenuID=@MenuID";

            return(await _context.ExecuteAsync(sql, new { MenuID = MenuID }) > 0);
        }
Exemplo n.º 11
0
        public async Task <bool> AddAsync(ESysUserInfo eSysUserInfo)
        {
            string sql = "insert into Sys_UserInfo(UserName,RealName,Pwd,Mobile,Wechat,OpenId,Dept,Position,Status) values(@UserName,@RealName,@Pwd,@Mobile,@Wechat,@OpenId,@Dept,@Position,@Status);select @@Identity;";

            return(await _context.ExecuteAsync(sql, eSysUserInfo) > 0);
        }
        public async Task <bool> InsertAsync(Product product)
        {
            var b = await _context.ExecuteAsync("INSERT INTO Product VALUES (@Id, @Name, @Price)", product) > 0;

            return(b);
        }
Exemplo n.º 13
0
        public async Task <bool> AddAsync(ESysRole eSysRole)
        {
            string sql = "insert into Sys_Role(RoleName,Status,Mark) values(@RoleName,@Status,@Mark);select @@Identity;";

            return(await _context.ExecuteAsync(sql, eSysRole) > 0);
        }
Exemplo n.º 14
0
        //public async Task<IEnumerable<ESysRoleAlarmLevel>> GetDataAsync(string sWhere, Dapper.DynamicParameters param)
        //{
        //    string sql = "select RoleID,AlarmLevel from Sys_RoleAlarmLevel where RoleID=@RoleID";
        //    sql = string.Format(sql, sWhere);

        //    return await _context.QueryAsync<ESysRoleAlarmLevel>(sql, param);
        //}
        public async Task <bool> AddAsync(ESysRoleAlarmLevel eSysRoleAlarmLevel)
        {
            string sql = "insert into Sys_RoleAlarmLevel(RoleID,AlarmLevel,AlarmType) values(@RoleID,@AlarmLevel,@AlarmType);select @@Identity;";

            return(await _context.ExecuteAsync(sql, eSysRoleAlarmLevel) > 0);
        }
Exemplo n.º 15
0
        public async Task <bool> AddAsync(ESysRoleMenu eSysRoleMenu)
        {
            string sql = "insert into Sys_RoleMenu(RoleID,MenuID) values(@RoleID,@MenuID);select @@Identity;";

            return(await _context.ExecuteAsync(sql, eSysRoleMenu) > 0);
        }
        public async Task <bool> InsertAsync(UserAddress userAddress)
        {
            var b = await _context.ExecuteAsync("INSERT INTO UserAddress VALUES (@Id ,@UserId,@RecName,@PhoneNumber,@IsDefault,@Province,@City,@Regin, @Street,@AddTime,@IsDelete)", userAddress) > 0;

            return(b);
        }
Exemplo n.º 17
0
        public async Task <bool> InsertAsync(User user)
        {
            var b = await _context.ExecuteAsync("INSERT INTO UserInfo VALUES (@Id ,@UserName,@NickName,@PassWord,@RegisterTime,@Grade,@AddTime,@IsDelete)", user) > 0;

            return(b);
        }