Example #1
0
        public bool UpdateInfo(Base_Organization info)
        {
            var query = from item in dc.Base_Organization
                        where item.Organization_ID == info.Organization_ID
                        select item;

            BatchEvaluate.Eval(info, query.First());
            dc.SubmitChanges();
            return(true);
        }
Example #2
0
        /// <summary>
        ///   更新库存信息
        /// </summary>
        /// <param name="info"> </param>
        /// <returns> </returns>
        public bool UpdateInfo(MMS_Store info)
        {
            var query = from item in dc.MMS_Store
                        where item.ID == info.ID
                        select item;

            BatchEvaluate.Eval(info, query.First());
            dc.SubmitChanges();
            return(true);
        }
Example #3
0
        public bool UpdateInfoDetail(MMS_PurchaseIndentDetail info)
        {
            var query = from item in dc.MMS_PurchaseIndentDetail
                        where item.ID == info.ID
                        select item;

            BatchEvaluate.Eval(info, query.First());
            dc.SubmitChanges();
            return(true);
        }
Example #4
0
        public bool UpdateSaleReturnDetail(MMS_SaleReturnDetail saleRetDet)
        {
            var query = from item in dc.MMS_SaleReturnContent
                        where item.ID == saleRetDet.ID
                        select item;

            BatchEvaluate.Eval(saleRetDet, query.First());
            dc.SubmitChanges();
            return(true);
        }
Example #5
0
        public bool UpdateInfo(Base_ClientInfo info)
        {
            var query = from item in dc.Base_ClientInfo
                        where item.ID == info.ID
                        select item;

            BatchEvaluate.Eval(info, query.First());
            dc.SubmitChanges();
            return(true);
        }
        /// <summary>
        ///   修改采购计划单
        /// </summary>
        /// <param name="info"> </param>
        /// <returns> </returns>
        public bool UpdateInfo(MMS_Delivery_Detail info)
        {
            var query = from item in dc.MMS_Delivery_Detail
                        where item.Delivery_id == info.Delivery_id
                        select item;

            BatchEvaluate.Eval(info, query.First());
            dc.SubmitChanges();
            return(true);
        }
        public bool UpdateInfo(Base_WarehouseInfo info)
        {
            var query = from house in dc.Base_WarehouseInfo
                        where house.Base_WarehouseInfo_ID == info.Base_WarehouseInfo_ID
                        select house;

            BatchEvaluate.Eval(info, query.First());
            dc.SubmitChanges();
            return(true);
        }
        /// <summary>
        ///   保存采购计划单组合实体
        /// </summary>
        /// <param name="obj"> 实体id号 </param>
        /// <returns> 自定义组合实体 </returns>
        public int SavePurchasePlan(TPurchasePlan obj)
        {
            if (obj.OprType == OperateType.otInsert)                    //传入的是插入操作标志
            {
                dc.MMS_PurchasePlanContent.InsertOnSubmit(obj.Content); //执行插入操作
            }
            else if (obj.OprType == OperateType.otUpdate)               //传入的是修改操作标志
            {
                var query = from item in dc.MMS_PurchasePlanContent
                            where item.ID == obj.Content.ID
                            select item;
                BatchEvaluate.Eval(obj.Content, query.First());         //调用Eval方法进行实体间赋值
            }
            else if (obj.OprType == OperateType.otDelete)               //传入的是删除操作标志
            {
                dc.MMS_PurchasePlanContent.DeleteOnSubmit(obj.Content); //执行删除操作
            }

            foreach (TPurchasePlanDetail item in obj.Detail)                  //遍历采购计划货品明细
            {
                if (item.OprType == OperateType.otInsert)                     //传入的是插入操作标志
                {
                    dc.MMS_PurchasePlanDetail.InsertOnSubmit(item.DetDetail); //执行插入操作
                }
                else if (item.OprType == OperateType.otUpdate)                //传入的是修改操作标志
                {
                    var query = from itm in dc.MMS_PurchasePlanDetail
                                where itm.ID == item.DetDetail.ID
                                select itm;
                    BatchEvaluate.Eval(item.DetDetail, query.First());        //执行修改操作
                }
                else if (item.OprType == OperateType.otDelete)                //传入的是删除操作标志
                {
                    dc.MMS_PurchasePlanDetail.DeleteOnSubmit(item.DetDetail); //执行删除操作
                }
            }
            try
            {
                dc.SubmitChanges(ConflictMode.ContinueOnConflict); //最后提交操作
            }
            catch (ChangeConflictException e)
            {
                foreach (ObjectChangeConflict occ in dc.ChangeConflicts)
                {
                    occ.Resolve(RefreshMode.KeepChanges);
                }
            }
            return(obj.Content.ID); //返回新添加计划单的主键值
        }
Example #9
0
        public bool UpdateInfoDetail(MMS_PurchaseDetail info)
        {
            try
            {
                var query = from item in dc.MMS_PurchaseDetail
                            where item.ID == info.ID
                            select item;

                BatchEvaluate.Eval(info, query.First());
                dc.SubmitChanges();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            return(true);
        }
Example #10
0
        /// <summary>
        ///   保存组合实体
        /// </summary>
        /// <param name="obj"> 实体id号 </param>
        /// <returns> 自定义组合实体 </returns>
        public int SavePurchaseReturn(TPurchaseReturn obj)
        {
            if (obj.OprType == OperateType.otInsert)
            {
                dc.MMS_PurchaseReturnContent.InsertOnSubmit(obj.Content);
            }
            else if (obj.OprType == OperateType.otUpdate)
            {
                var query = from item in dc.MMS_PurchaseReturnContent
                            where item.ID == obj.Content.ID
                            select item;
                BatchEvaluate.Eval(obj.Content, query.First());
            }
            else if (obj.OprType == OperateType.otDelete)
            {
                dc.MMS_PurchaseReturnContent.DeleteOnSubmit(obj.Content);
            }

            foreach (TPurchaseReturnDetail item in obj.Detail)
            {
                if (item.OprType == OperateType.otInsert)
                {
                    dc.MMS_PurchaseReturnDetail.InsertOnSubmit(item.DetDetail);
                }
                else if (item.OprType == OperateType.otUpdate)
                {
                    var query = from itm in dc.MMS_PurchaseReturnDetail
                                where itm.ID == item.DetDetail.ID
                                select itm;
                    BatchEvaluate.Eval(item.DetDetail, query.First());
                }
                else if (item.OprType == OperateType.otDelete)
                {
                    dc.MMS_PurchaseReturnDetail.DeleteOnSubmit(item.DetDetail);
                }
            }
            dc.SubmitChanges();
            return(obj.Content.ID);
        }
Example #11
0
        /// <summary>
        ///   保存销售单
        /// </summary>
        /// <param name="obj"> 自定义销售单实体 </param>
        /// <returns> 销售单ID号 </returns>
        public int SaveSale(TSale obj)
        {
            if (obj.OprType == OperateType.otInsert)            //传入的是插入操作标志
            {
                dc.MMS_SaleContent.InsertOnSubmit(obj.Content); //执行插入操作
            }
            else if (obj.OprType == OperateType.otUpdate)       //传入的是修改操作标志
            {
                var query = from item in dc.MMS_SaleContent
                            where item.ID == obj.Content.ID
                            select item;
                BatchEvaluate.Eval(obj.Content, query.First()); //调用Eval方法进行实体间赋值
            }
            else if (obj.OprType == OperateType.otDelete)       //传入的是删除操作标志
            {
                dc.MMS_SaleContent.DeleteOnSubmit(obj.Content); //执行删除操作
            }

            foreach (TSaleDetail item in obj.Detail)                  //遍历采购计划货品明细
            {
                if (item.OprType == OperateType.otInsert)             //传入的是插入操作标志
                {
                    dc.MMS_SaleDetail.InsertOnSubmit(item.DetDetail); //执行插入操作
                }
                else if (item.OprType == OperateType.otUpdate)        //传入的是修改操作标志
                {
                    var query = from itm in dc.MMS_SaleDetail
                                where itm.ID == item.DetDetail.ID
                                select itm;
                    BatchEvaluate.Eval(item.DetDetail, query.First()); //执行修改操作
                }
                else if (item.OprType == OperateType.otDelete)         //传入的是删除操作标志
                {
                    dc.MMS_SaleDetail.DeleteOnSubmit(item.DetDetail);  //执行删除操作
                }
            }
            dc.SubmitChanges(); //最后提交操作
            return(obj.Content.ID);
        }