/// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Carousel_Image model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Carousel_Image>();

            if (!model.Image.IsNullOrEmpty())
            {
                insert.Insert(p => p.Image == model.Image);
            }
            if (!model.OrderID.IsNullOrEmpty())
            {
                insert.Insert(p => p.OrderID == model.OrderID);
            }
            if (!model.AUrl.IsNullOrEmpty())
            {
                insert.Insert(p => p.AUrl == model.AUrl);
            }
            if (!model.IsCarousel.IsNullOrEmpty())
            {
                insert.Insert(p => p.IsCarousel == model.IsCarousel);
            }
            if (!model.IsPC.IsNullOrEmpty())
            {
                insert.Insert(p => p.IsPC == model.IsPC);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
Beispiel #2
0
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Message model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Message>();

            if (!model.MainTitle.IsNullOrEmpty())
            {
                insert.Insert(p => p.MainTitle == model.MainTitle);
            }
            if (!model.Title.IsNullOrEmpty())
            {
                insert.Insert(p => p.Title == model.Title);
            }
            if (!model.Content.IsNullOrEmpty())
            {
                insert.Insert(p => p.Content == model.Content);
            }
            if (!model.MessageTime.IsNullOrEmpty())
            {
                insert.Insert(p => p.MessageTime == model.MessageTime);
            }
            if (!model.IsDelete.IsNullOrEmpty())
            {
                insert.Insert(p => p.IsDelete == model.IsDelete);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
Beispiel #3
0
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Commrecommend model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Commrecommend>();

            if (!model.CommId.IsNullOrEmpty())
            {
                insert.Insert(p => p.CommId == model.CommId);
            }
            if (!model.OrderID.IsNullOrEmpty())
            {
                insert.Insert(p => p.OrderID == model.OrderID);
            }
            if (!model.FrontImage.IsNullOrEmpty())
            {
                insert.Insert(p => p.FrontImage == model.FrontImage);
            }
            if (!model.AttrSpan.IsNullOrEmpty())
            {
                insert.Insert(p => p.AttrSpan == model.AttrSpan);
            }
            if (!model.BehindImage.IsNullOrEmpty())
            {
                insert.Insert(p => p.BehindImage == model.BehindImage);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public bool Insert(User_Like model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <User_Like>();

            if (!model.UserId.IsNullOrEmpty())
            {
                insert.Insert(p => p.UserId == model.UserId);
            }
            if (!model.CommodityId.IsNullOrEmpty())
            {
                insert.Insert(p => p.CommodityId == model.CommodityId);
            }
            return(insert.GetInsertResult(connection, transaction) >= 0);
        }
Beispiel #5
0
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public bool Insert(Erpuser model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Erpuser>();

            if (!model.ErproleName.IsNullOrEmpty())
            {
                insert.Insert(p => p.ErproleName == model.ErproleName);
            }
            if (!model.ERProlePower.IsNullOrEmpty())
            {
                insert.Insert(p => p.ERProlePower == model.ERProlePower);
            }
            return(insert.GetInsertResult(connection, transaction) >= 0);
        }
Beispiel #6
0
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public bool Insert(Platalink model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Platalink>();

            if (!model.Title.IsNullOrEmpty())
            {
                insert.Insert(p => p.Title == model.Title);
            }
            if (!model.Content.IsNullOrEmpty())
            {
                insert.Insert(p => p.Content == model.Content);
            }
            return(insert.GetInsertResult(connection, transaction) >= 0);
        }
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public bool Insert(Hot_Search model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Hot_Search>();

            if (!model.SearchWord.IsNullOrEmpty())
            {
                insert.Insert(p => p.SearchWord == model.SearchWord);
            }
            if (!model.Amount.IsNullOrEmpty())
            {
                insert.Insert(p => p.Amount == model.Amount);
            }
            return(insert.GetInsertResult(connection, transaction) >= 0);
        }
Beispiel #8
0
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public bool Insert(Showgradeinfo model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Showgradeinfo>();

            if (!model.GradeId.IsNullOrEmpty())
            {
                insert.Insert(p => p.GradeId == model.GradeId);
            }
            if (!model.OrderCount.IsNullOrEmpty())
            {
                insert.Insert(p => p.OrderCount == model.OrderCount);
            }
            return(insert.GetInsertResult(connection, transaction) >= 0);
        }
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public bool Insert(Grade_Attr model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Grade_Attr>();

            if (!model.GradeId.IsNullOrEmpty())
            {
                insert.Insert(p => p.GradeId == model.GradeId);
            }
            if (!model.Content.IsNullOrEmpty())
            {
                insert.Insert(p => p.Content == model.Content);
            }
            return(insert.GetInsertResult(connection, transaction) >= 0);
        }
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Technology model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Technology>();

            if (!model.Name.IsNullOrEmpty())
            {
                insert.Insert(p => p.Name == model.Name);
            }
            if (!model.IsDelete.IsNullOrEmpty())
            {
                insert.Insert(p => p.IsDelete == model.IsDelete);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
Beispiel #11
0
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public bool Insert(Warehouse model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Warehouse>();

            if (!model.Name.IsNullOrEmpty())
            {
                insert.Insert(p => p.Name == model.Name);
            }
            if (!model.IsDelete.IsNullOrEmpty())
            {
                insert.Insert(p => p.IsDelete == model.IsDelete);
            }
            return(insert.GetInsertResult(connection, transaction) >= 0);
        }
Beispiel #12
0
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Invoice model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Invoice>();

            if (!model.UserId.IsNullOrEmpty())
            {
                insert.Insert(p => p.UserId == model.UserId);
            }
            if (!model.OrderId.IsNullOrEmpty())
            {
                insert.Insert(p => p.OrderId == model.OrderId);
            }
            if (!model.Title.IsNullOrEmpty())
            {
                insert.Insert(p => p.Title == model.Title);
            }
            if (!model.DutyParagraph.IsNullOrEmpty())
            {
                insert.Insert(p => p.DutyParagraph == model.DutyParagraph);
            }
            if (!model.TypeInvoice.IsNullOrEmpty())
            {
                insert.Insert(p => p.TypeInvoice == model.TypeInvoice);
            }
            if (!model.InvoiceTime.IsNullOrEmpty())
            {
                insert.Insert(p => p.InvoiceTime == model.InvoiceTime);
            }
            if (!model.MobliePhone.IsNullOrEmpty())
            {
                insert.Insert(p => p.MobliePhone == model.MobliePhone);
            }
            if (!model.OpeningBank.IsNullOrEmpty())
            {
                insert.Insert(p => p.OpeningBank == model.OpeningBank);
            }
            if (!model.BankAccount.IsNullOrEmpty())
            {
                insert.Insert(p => p.BankAccount == model.BankAccount);
            }
            if (!model.Address.IsNullOrEmpty())
            {
                insert.Insert(p => p.Address == model.Address);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Producerinvoice model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Producerinvoice>();

            if (!model.ProducerId.IsNullOrEmpty())
            {
                insert.Insert(p => p.ProducerId == model.ProducerId);
            }
            if (!model.CompanyName.IsNullOrEmpty())
            {
                insert.Insert(p => p.CompanyName == model.CompanyName);
            }
            if (!model.InvoiceNumber.IsNullOrEmpty())
            {
                insert.Insert(p => p.InvoiceNumber == model.InvoiceNumber);
            }
            if (!model.InvoiceTime.IsNullOrEmpty())
            {
                insert.Insert(p => p.InvoiceTime == model.InvoiceTime);
            }
            if (!model.InvoiceMoney.IsNullOrEmpty())
            {
                insert.Insert(p => p.InvoiceMoney == model.InvoiceMoney);
            }
            if (!model.InvoiceIdentify.IsNullOrEmpty())
            {
                insert.Insert(p => p.InvoiceIdentify == model.InvoiceIdentify);
            }
            if (!model.InvoicePhone.IsNullOrEmpty())
            {
                insert.Insert(p => p.InvoicePhone == model.InvoicePhone);
            }
            if (!model.InvoiceAddress.IsNullOrEmpty())
            {
                insert.Insert(p => p.InvoiceAddress == model.InvoiceAddress);
            }
            if (!model.InvoiceBank.IsNullOrEmpty())
            {
                insert.Insert(p => p.InvoiceBank == model.InvoiceBank);
            }
            if (!model.InvoiceContext.IsNullOrEmpty())
            {
                insert.Insert(p => p.InvoiceContext == model.InvoiceContext);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
Beispiel #14
0
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Receive model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Receive>();

            if (!model.ProductionId.IsNullOrEmpty())
            {
                insert.Insert(p => p.ProductionId == model.ProductionId);
            }
            if (!model.receiveStatus.IsNullOrEmpty())
            {
                insert.Insert(p => p.receiveStatus == model.receiveStatus);
            }
            if (!model.receiveOutTime.IsNullOrEmpty())
            {
                insert.Insert(p => p.receiveOutTime == model.receiveOutTime);
            }
            if (!model.receiveTime.IsNullOrEmpty())
            {
                insert.Insert(p => p.receiveTime == model.receiveTime);
            }
            if (!model.receiveContext.IsNullOrEmpty())
            {
                insert.Insert(p => p.receiveContext == model.receiveContext);
            }
            if (!model.receiveSinglePerson.IsNullOrEmpty())
            {
                insert.Insert(p => p.receiveSinglePerson == model.receiveSinglePerson);
            }
            if (!model.receiveSingleTime.IsNullOrEmpty())
            {
                insert.Insert(p => p.receiveSingleTime == model.receiveSingleTime);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Producerconectinfo model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Producerconectinfo>();

            if (!model.ConectName.IsNullOrEmpty())
            {
                insert.Insert(p => p.ConectName == model.ConectName);
            }
            if (!model.Position.IsNullOrEmpty())
            {
                insert.Insert(p => p.Position == model.Position);
            }
            if (!model.ConectSex.IsNullOrEmpty())
            {
                insert.Insert(p => p.ConectSex == model.ConectSex);
            }
            if (!model.Telephone.IsNullOrEmpty())
            {
                insert.Insert(p => p.Telephone == model.Telephone);
            }
            if (!model.Phone.IsNullOrEmpty())
            {
                insert.Insert(p => p.Phone == model.Phone);
            }
            if (!model.Email.IsNullOrEmpty())
            {
                insert.Insert(p => p.Email == model.Email);
            }
            if (!model.ProducerId.IsNullOrEmpty())
            {
                insert.Insert(p => p.ProducerId == model.ProducerId);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Customerservice model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Customerservice>();

            if (!model.ServiceName.IsNullOrEmpty())
            {
                insert.Insert(p => p.ServiceName == model.ServiceName);
            }
            if (!model.ServicePwd.IsNullOrEmpty())
            {
                insert.Insert(p => p.ServicePwd == model.ServicePwd);
            }
            if (!model.IsService.IsNullOrEmpty())
            {
                insert.Insert(p => p.IsService == model.IsService);
            }
            if (!model.ServiceQQ.IsNullOrEmpty())
            {
                insert.Insert(p => p.ServiceQQ == model.ServiceQQ);
            }
            if (!model.ServiceWechat.IsNullOrEmpty())
            {
                insert.Insert(p => p.ServiceWechat == model.ServiceWechat);
            }
            if (!model.ServiceALWW.IsNullOrEmpty())
            {
                insert.Insert(p => p.ServiceALWW == model.ServiceALWW);
            }
            if (!model.ServicePhone.IsNullOrEmpty())
            {
                insert.Insert(p => p.ServicePhone == model.ServicePhone);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Message_Grant model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Message_Grant>();

            if (!model.UserId.IsNullOrEmpty())
            {
                insert.Insert(p => p.UserId == model.UserId);
            }
            if (!model.MessageId.IsNullOrEmpty())
            {
                insert.Insert(p => p.MessageId == model.MessageId);
            }
            if (!model.IsWatch.IsNullOrEmpty())
            {
                insert.Insert(p => p.IsWatch == model.IsWatch);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Erploginuer model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Erploginuer>();

            if (!model.ErproleId.IsNullOrEmpty())
            {
                insert.Insert(p => p.ErproleId == model.ErproleId);
            }
            if (!model.erpLoginName.IsNullOrEmpty())
            {
                insert.Insert(p => p.erpLoginName == model.erpLoginName);
            }
            if (!model.erpLoginPwd.IsNullOrEmpty())
            {
                insert.Insert(p => p.erpLoginPwd == model.erpLoginPwd);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
Beispiel #19
0
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Comm_Discount model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Comm_Discount>();

            if (!model.CommodityId.IsNullOrEmpty())
            {
                insert.Insert(p => p.CommodityId == model.CommodityId);
            }
            if (!model.rate.IsNullOrEmpty())
            {
                insert.Insert(p => p.rate == model.rate);
            }
            if (!model.ValidityTime.IsNullOrEmpty())
            {
                insert.Insert(p => p.ValidityTime == model.ValidityTime);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
Beispiel #20
0
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Tips model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Tips>();

            if (!model.Title.IsNullOrEmpty())
            {
                insert.Insert(p => p.Title == model.Title);
            }
            if (!model.Content.IsNullOrEmpty())
            {
                insert.Insert(p => p.Content == model.Content);
            }
            if (!model.CreateTime.IsNullOrEmpty())
            {
                insert.Insert(p => p.CreateTime == model.CreateTime);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
Beispiel #21
0
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Commshow model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Commshow>();

            if (!model.GradeId.IsNullOrEmpty())
            {
                insert.Insert(p => p.GradeId == model.GradeId);
            }
            if (!model.OrderId.IsNullOrEmpty())
            {
                insert.Insert(p => p.OrderId == model.OrderId);
            }
            if (!model.CommId.IsNullOrEmpty())
            {
                insert.Insert(p => p.CommId == model.CommId);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
Beispiel #22
0
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(User_Tips model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <User_Tips>();

            if (!model.UserId.IsNullOrEmpty())
            {
                insert.Insert(p => p.UserId == model.UserId);
            }
            if (!model.TipsId.IsNullOrEmpty())
            {
                insert.Insert(p => p.TipsId == model.TipsId);
            }
            if (!model.IsClick.IsNullOrEmpty())
            {
                insert.Insert(p => p.IsClick == model.IsClick);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
Beispiel #23
0
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Changestorage model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Changestorage>();

            if (!model.storageId.IsNullOrEmpty())
            {
                insert.Insert(p => p.storageId == model.storageId);
            }
            if (!model.ChangeTime.IsNullOrEmpty())
            {
                insert.Insert(p => p.ChangeTime == model.ChangeTime);
            }
            if (!model.ChangeType.IsNullOrEmpty())
            {
                insert.Insert(p => p.ChangeType == model.ChangeType);
            }
            if (!model.ChangeCount.IsNullOrEmpty())
            {
                insert.Insert(p => p.ChangeCount == model.ChangeCount);
            }
            if (!model.ChangeAfterCount.IsNullOrEmpty())
            {
                insert.Insert(p => p.ChangeAfterCount == model.ChangeAfterCount);
            }
            if (!model.ChangeContext.IsNullOrEmpty())
            {
                insert.Insert(p => p.ChangeContext == model.ChangeContext);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Receive_Materials model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Receive_Materials>();

            if (!model.receiveId.IsNullOrEmpty())
            {
                insert.Insert(p => p.receiveId == model.receiveId);
            }
            if (!model.raw_materialsId.IsNullOrEmpty())
            {
                insert.Insert(p => p.raw_materialsId == model.raw_materialsId);
            }
            if (!model.BaseCount.IsNullOrEmpty())
            {
                insert.Insert(p => p.BaseCount == model.BaseCount);
            }
            if (!model.additionalCount.IsNullOrEmpty())
            {
                insert.Insert(p => p.additionalCount == model.additionalCount);
            }
            if (!model.SKU.IsNullOrEmpty())
            {
                insert.Insert(p => p.SKU == model.SKU);
            }
            if (!model.Isadditional.IsNullOrEmpty())
            {
                insert.Insert(p => p.Isadditional == model.Isadditional);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
Beispiel #25
0
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Address model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Address>();

            if (!model.UserId.IsNullOrEmpty())
            {
                insert.Insert(p => p.UserId == model.UserId);
            }
            if (!model.ContactName.IsNullOrEmpty())
            {
                insert.Insert(p => p.ContactName == model.ContactName);
            }
            if (!model.ContactPhone.IsNullOrEmpty())
            {
                insert.Insert(p => p.ContactPhone == model.ContactPhone);
            }
            if (!model.AddrArea.IsNullOrEmpty())
            {
                insert.Insert(p => p.AddrArea == model.AddrArea);
            }
            if (!model.AddrDetail.IsNullOrEmpty())
            {
                insert.Insert(p => p.AddrDetail == model.AddrDetail);
            }
            if (!model.DefaultTime.IsNullOrEmpty())
            {
                insert.Insert(p => p.DefaultTime == model.DefaultTime);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
Beispiel #26
0
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Storage model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Storage>();

            if (!model.WarehouseId.IsNullOrEmpty())
            {
                insert.Insert(p => p.WarehouseId == model.WarehouseId);
            }
            if (!model.ProducerId.IsNullOrEmpty())
            {
                insert.Insert(p => p.ProducerId == model.ProducerId);
            }
            if (!model.Raw_materialsId.IsNullOrEmpty())
            {
                insert.Insert(p => p.Raw_materialsId == model.Raw_materialsId);
            }
            if (!model.stock.IsNullOrEmpty())
            {
                insert.Insert(p => p.stock == model.stock);
            }
            if (!model.freeze_stock.IsNullOrEmpty())
            {
                insert.Insert(p => p.freeze_stock == model.freeze_stock);
            }
            if (!model.Color.IsNullOrEmpty())
            {
                insert.Insert(p => p.Color == model.Color);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
Beispiel #27
0
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Colorinfo model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Colorinfo>();

            if (!model.StandardColor.IsNullOrEmpty())
            {
                insert.Insert(p => p.StandardColor == model.StandardColor);
            }
            if (!model.ChinaDescribe.IsNullOrEmpty())
            {
                insert.Insert(p => p.ChinaDescribe == model.ChinaDescribe);
            }
            if (!model.EngDescibe.IsNullOrEmpty())
            {
                insert.Insert(p => p.EngDescibe == model.EngDescibe);
            }
            if (!model.ParentId.IsNullOrEmpty())
            {
                insert.Insert(p => p.ParentId == model.ParentId);
            }
            if (!model.HtmlCode.IsNullOrEmpty())
            {
                insert.Insert(p => p.HtmlCode == model.HtmlCode);
            }
            if (!model.IsDelete.IsNullOrEmpty())
            {
                insert.Insert(p => p.IsDelete == model.IsDelete);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
Beispiel #28
0
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Materials_Colorinfo model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Materials_Colorinfo>();

            if (!model.MaterialsId.IsNullOrEmpty())
            {
                insert.Insert(p => p.MaterialsId == model.MaterialsId);
            }
            if (!model.SKU.IsNullOrEmpty())
            {
                insert.Insert(p => p.SKU == model.SKU);
            }
            if (!model.ColorId.IsNullOrEmpty())
            {
                insert.Insert(p => p.ColorId == model.ColorId);
            }
            if (!model.MinStockNum.IsNullOrEmpty())
            {
                insert.Insert(p => p.MinStockNum == model.MinStockNum);
            }
            if (!model.SKUImage.IsNullOrEmpty())
            {
                insert.Insert(p => p.SKUImage == model.SKUImage);
            }
            if (!model.PositionInfo.IsNullOrEmpty())
            {
                insert.Insert(p => p.PositionInfo == model.PositionInfo);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Commodity_Stage_Price model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Commodity_Stage_Price>();

            if (!model.CommodityId.IsNullOrEmpty())
            {
                insert.Insert(p => p.CommodityId == model.CommodityId);
            }
            if (!model.StageAmount.IsNullOrEmpty())
            {
                insert.Insert(p => p.StageAmount == model.StageAmount);
            }
            if (!model.StagePrice.IsNullOrEmpty())
            {
                insert.Insert(p => p.StagePrice == model.StagePrice);
            }
            if (!model.DiscountRate.IsNullOrEmpty())
            {
                insert.Insert(p => p.DiscountRate == model.DiscountRate);
            }
            return(insert.GetInsertResult(connection, transaction));
        }
        /// <summary>
        /// 根据模型插入
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>是否成功</returns>
        public int InsertReturnKey(Orderdetaildesign model, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var insert = new LambdaInsert <Orderdetaildesign>();

            if (!model.OrderDetailId.IsNullOrEmpty())
            {
                insert.Insert(p => p.OrderDetailId == model.OrderDetailId);
            }
            if (!model.Content.IsNullOrEmpty())
            {
                insert.Insert(p => p.Content == model.Content);
            }
            if (!model.PrintingPosition.IsNullOrEmpty())
            {
                insert.Insert(p => p.PrintingPosition == model.PrintingPosition);
            }
            if (!model.Image.IsNullOrEmpty())
            {
                insert.Insert(p => p.Image == model.Image);
            }
            return(insert.GetInsertResult(connection, transaction));
        }