Beispiel #1
0
        /// <summary>
        /// 新增用车记录
        /// </summary>
        //[AbpAuthorize(PermissionNames.VehUseRecord_CreateVehUseRecord)]
        public async Task <int> CreateVehUseRecord(VehUseRecordEditDto input)
        {
            //TODO:新增前的逻辑判断,是否允许新增
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into veh_userecord(");
            strSql.Append("Id,UseCompanyId,NumberPlate,Brand,GoOutDate,GoBackDate,DutyPerson,Contact,Description,IsDeleted,CreationTime,CreatorUserId)");
            strSql.Append(" values (");
            strSql.Append("@Id,@UseCompanyId,@NumberPlate,@Brand,@GoOutDate,@GoBackDate,@DutyPerson,@Contact,@Description,@IsDeleted,@CreationTime,@CreatorUserId)");

            using (var conn = DBUtility.GetMySqlConnection())
            {
                input.Id            = Guid.NewGuid();
                input.CreatorUserId = AbpSession.UserId;
                return(await conn.ExecuteAsync(strSql.ToString(), input));
            }
        }
Beispiel #2
0
        /// <summary>
        /// 更新用车记录
        /// </summary>
        //[AbpAuthorize(PermissionNames.VehUseRecord_UpdateVehUseRecord)]
        public async Task <int> UpdateVehUseRecord(VehUseRecordEditDto input)
        {
            //TODO:更新前的逻辑判断,是否允许更新
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update veh_userecord set ");
            strSql.Append("UseCompanyId=@UseCompanyId,");
            strSql.Append("NumberPlate=@NumberPlate,");
            strSql.Append("Brand=@Brand,");
            strSql.Append("GoOutDate=@GoOutDate,");
            strSql.Append("GoBackDate=@GoBackDate,");
            strSql.Append("DutyPerson=@DutyPerson,");
            strSql.Append("Contact=@Contact,");
            strSql.Append("Description=@Description,");
            strSql.Append("LastModificationTime=@LastModificationTime,");
            strSql.Append("LastModifierUserId=@LastModifierUserId");
            strSql.Append(" where Id=@Id ");

            using (var conn = DBUtility.GetMySqlConnection())
            {
                input.LastModifierUserId = AbpSession.UserId;
                return(await conn.ExecuteAsync(strSql.ToString(), input));
            }
        }