From 51aebb52e3f964ad5d0e96c6b92ae8e455b24ceb Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期五, 10 四月 2026 13:08:17 +0800
Subject: [PATCH] 需要修改的,   不选板材,直接按照板材规格扣减库存。  发版套数不填的话就是1.  扣减库存的量就是  数量*发版套数 20260410  试卷 6年级添加 答题卡 选项  完成

---
 CY_ECommercePlatform/CY.SQLDAL/OA/OA_CorporateClientsDAL.cs |  242 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 241 insertions(+), 1 deletions(-)

diff --git a/CY_ECommercePlatform/CY.SQLDAL/OA/OA_CorporateClientsDAL.cs b/CY_ECommercePlatform/CY.SQLDAL/OA/OA_CorporateClientsDAL.cs
index 50d5f9f..7b8a2ce 100644
--- a/CY_ECommercePlatform/CY.SQLDAL/OA/OA_CorporateClientsDAL.cs
+++ b/CY_ECommercePlatform/CY.SQLDAL/OA/OA_CorporateClientsDAL.cs
@@ -265,6 +265,64 @@
             return true;
         }
 
+
+
+        /// <summary>
+        /// 淇敼瀹岀粨
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        public bool UpdateWanjie(Infrastructure.Domain.IAggregateRoot model)
+        {
+            Model.OA_CorporateClients trueModel = model as Model.OA_CorporateClients;
+            if (trueModel == null)
+            {
+                return false;
+            }
+
+            SqlParameter par = null;
+            if (trueModel.LastOrderTime.HasValue)
+            {
+                par = new SqlParameter("@LastOrderTime", trueModel.LastOrderTime.Value);
+            }
+            else
+            {
+                par = new SqlParameter("@LastOrderTime", DBNull.Value);
+            }
+            SqlParameter par1 = null;
+            if (trueModel.WanjieTime.HasValue)
+            {
+                par1 = new SqlParameter("@WanjieTime", trueModel.WanjieTime.Value);
+            }
+            else
+            {
+                par1 = new SqlParameter("@WanjieTime", DBNull.Value);
+            }
+           
+            IList<SqlParameter> sqlParms = new List<SqlParameter>()
+            {
+                    new SqlParameter("@Keyid",trueModel.Keyid),
+                    
+                    par,
+                    
+                       par1,
+                       
+                            new SqlParameter("@Shifouwanjie",trueModel.Shifouwanjie??0) ,
+            };
+            string sql = "Update [OA_CorporateClients] Set [Shifouwanjie]=@Shifouwanjie,[WanjieTime]=@WanjieTime,[LastOrderTime]=@LastOrderTime  where [Keyid] =@Keyid ";
+
+            try
+            {
+                _dataBase.ExecuteSql(sql, sqlParms.ToArray<SqlParameter>());
+            }
+            catch (Exception ex)
+            {
+                throw ex;
+            }
+            return true;
+        }
+
+
         /// <summary>
         /// 杞Щ瀹㈡埛
         /// </summary>
@@ -1206,7 +1264,100 @@
 
             try
             {
-                IList<OA_CorporateClientsVisit> result = _dataBase.SelectModel<OA_CorporateClientsVisit>("  a.*,b.[Name] as CreaterName ", "OA_CorporateClientsVisit a left join EC_MemberBasic b on a.Creater = b.MemberId ", string.Format(" CorporateClientsid = '{0}'  order by a.[VisitTime] desc", CustomId)) as IList<OA_CorporateClientsVisit>;//鎵ц鏌ヨ
+                IList<OA_CorporateClientsVisit> result = _dataBase.SelectModel<OA_CorporateClientsVisit>(" top 50  a.*,b.[Name] as CreaterName ", "OA_CorporateClientsVisit a left join EC_MemberBasic b on a.Creater = b.MemberId ", string.Format(" CorporateClientsid = '{0}'  order by a.[VisitTime] desc", CustomId)) as IList<OA_CorporateClientsVisit>;//鎵ц鏌ヨ
+                return result;//杩斿洖缁撴灉
+            }
+            catch (Exception ex)
+            {
+                throw ex;
+            }
+        }
+
+
+
+
+        /// <summary>
+        /// 鏂板鍚堜綔瀹㈡埛璁捐娌熼��
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        public bool InsertModelSheji(CY.Model.OA_CorporateClientsSheji trueModel)
+        {
+            //Model.OA_CorporateClients trueModel = model as Model.OA_CorporateClientsVist;
+            if (trueModel == null)
+            {
+                return false;
+            }
+
+            SqlParameter par = null;
+            if (trueModel.ShejiTime.HasValue)
+            {
+                par = new SqlParameter("@ShejiTime", trueModel.ShejiTime.Value);
+            }
+            else
+            {
+                par = new SqlParameter("@ShejiTime", DBNull.Value);
+            }
+            SqlParameter par1 = null;
+            if (trueModel.CreateTime.HasValue)
+            {
+                par1 = new SqlParameter("@CreateTime", trueModel.CreateTime.Value);
+            }
+            else
+            {
+                par1 = new SqlParameter("@CreateTime", DBNull.Value);
+            }
+            SqlParameter par2 = null;
+            if (trueModel.LastUpdateTime.HasValue)
+            {
+                par2 = new SqlParameter("@LastUpdateTime", trueModel.LastUpdateTime.Value);
+            }
+            else
+            {
+                par2 = new SqlParameter("@LastUpdateTime", DBNull.Value);
+            }
+
+            IList<SqlParameter> sqlParms = new List<SqlParameter>()
+            {
+                       new SqlParameter("@Keyid",trueModel.Keyid),
+                    new SqlParameter("@CorporateClientsid",trueModel.CorporateClientsid),
+                    par,
+                     new SqlParameter("@YinjianName",trueModel.YinjianName),
+                      new SqlParameter("@JiaogaoCount",trueModel.JiaogaoCount.HasValue?trueModel.JiaogaoCount.Value:0),
+                    new SqlParameter("@Remark",trueModel.Remark),
+                    new SqlParameter("@Creater",trueModel.Creater),
+                    par1,
+                    new SqlParameter("@Updater",trueModel.Updater),
+                    par2,
+
+            };
+            string sql = "Insert Into OA_CorporateClientsSheji ([Keyid],[CorporateClientsid],[ShejiTime],[YinjianName], [JiaogaoCount], [Remark],[Creater], [CreateTime],[Updater], [LastUpdateTime] )"
+                                              + " Values (@Keyid,@CorporateClientsid,@ShejiTime, @YinjianName, @JiaogaoCount, @Remark, @Creater, @CreateTime, @Updater, @LastUpdateTime  )";
+
+            try
+            {
+                _dataBase.ExecuteSql(sql, sqlParms.ToArray<SqlParameter>());
+            }
+            catch (Exception ex)
+            {
+                throw ex;
+            }
+            return true;
+        }
+
+
+        /// <summary>
+        /// 鏍规嵁瀹㈡埛id鏌ヨ璁捐娌熼��
+        /// </summary>
+        /// <param name="CustomId">缂栧彿</param>
+        /// <returns></returns>
+        public IEnumerable<OA_CorporateClientsSheji> SelectShejiListByCorId(Guid CustomId)
+        {
+            if (CustomId == null)
+                return null;//閿欒鏁版嵁杩斾細绌�
+            try
+            {
+                IList<OA_CorporateClientsSheji> result = _dataBase.SelectModel<OA_CorporateClientsSheji>(" top 50  a.*,b.[Name] as CreaterName ", "OA_CorporateClientsSheji a left join EC_MemberBasic b on a.Creater = b.MemberId ", string.Format(" CorporateClientsid = '{0}'  order by a.[ShejiTime] desc", CustomId)) as IList<OA_CorporateClientsSheji>;//鎵ц鏌ヨ
                 return result;//杩斿洖缁撴灉
             }
             catch (Exception ex)
@@ -1505,5 +1656,94 @@
             }
         }
 
+
+        /// <summary>
+        /// 鏂板
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        public bool Insertattachment(OA_attachment model)
+        {
+            Model.OA_attachment trueModel = model as Model.OA_attachment;
+            if (trueModel == null)
+            {
+                return false;
+            }
+
+
+            IList<SqlParameter> sqlParms = new List<SqlParameter>()
+            {
+                   new SqlParameter("@OA_Id",trueModel.OA_Id),
+                   new SqlParameter("@CreateTime",trueModel.CreateTime),
+                   new SqlParameter("@PlanAttachment",trueModel.PlanAttachment),
+                   new SqlParameter("@AttachmentType",trueModel.AttachmentType),
+                   new SqlParameter("@Operator",string.IsNullOrWhiteSpace(trueModel.Operator)?"":trueModel.Operator),
+                    new SqlParameter("@AttachmentHouzhui",string.IsNullOrWhiteSpace(trueModel.AttachmentHouzhui)?"":trueModel.AttachmentHouzhui),
+                     new SqlParameter("@AttachmentName",string.IsNullOrWhiteSpace(trueModel.AttachmentName)?"":trueModel.AttachmentName ),
+
+
+            };
+            string sql = "Insert Into OA_attachment ( [OA_Id] , [PlanAttachment],[AttachmentType],[CreateTime],[Operator],[AttachmentHouzhui],[AttachmentName] )"
+                                             + " Values (  @OA_Id,  @PlanAttachment,@AttachmentType,@CreateTime,@Operator,@AttachmentHouzhui,@AttachmentName  )";
+            try
+            {
+                _dataBase.ExecuteSql(sql, sqlParms.ToArray<SqlParameter>());
+            }
+            catch (Exception ex)
+            {
+                throw ex;
+            }
+            return true;
+        }
+
+
+        /// <summary>
+        /// 鏍规嵁鍘傚晢缂栧彿鏌ヨ鍏ㄩ儴澶栧崗鍘傚晢
+        /// </summary>
+        /// <param name="MemberId">缂栧彿</param>
+        /// <returns></returns>
+        public IEnumerable<OA_attachment> GetattachmentlList(string OA_Id)
+        {
+            if (OA_Id == null)
+                return null;//閿欒鏁版嵁杩斾細绌� 
+
+            IList<OA_attachment> result = _dataBase.SelectModel<OA_attachment>("*", "OA_attachment", string.Format(" OA_Id='{0}'   ORDER BY CreateTime DESC", OA_Id)) as IList<OA_attachment>;//鎵ц鏌ヨ
+
+            return result;//杩斿洖缁撴灉
+        }
+
+
+        /// <summary>
+        /// 鍗曚釜鏌ヨ璁块棶
+        /// </summary>
+        /// <param name="Keyid">缂栧彿</param>
+        /// <returns></returns>
+        public OA_CorporateClientsVisit SelectVisitByKeyid(Guid Keyid)
+        {
+            if (Keyid == null)
+                return null;//閿欒鏁版嵁杩斾細绌� 
+
+            IList<OA_CorporateClientsVisit> result = _dataBase.SelectModel<OA_CorporateClientsVisit>(" a.* ", " OA_CorporateClientsVisit a ", string.Format(" a.Keyid='{0}'", Keyid)) as IList<OA_CorporateClientsVisit>;//鎵ц鏌ヨ
+
+            return (null == result || result.Count == 0) ? null : result[0];//杩斿洖缁撴灉
+        }
+
+
+
+        /// <summary>
+        /// 鍗曚釜鏌ヨ璁捐娌熼��
+        /// </summary>
+        /// <param name="Keyid">缂栧彿</param>
+        /// <returns></returns>
+        public OA_CorporateClientsSheji SelectShejiByKeyid(Guid Keyid)
+        {
+            if (Keyid == null)
+                return null;//閿欒鏁版嵁杩斾細绌� 
+
+            IList<OA_CorporateClientsSheji> result = _dataBase.SelectModel<OA_CorporateClientsSheji>(" a.* ", " OA_CorporateClientsSheji a ", string.Format(" a.Keyid='{0}'", Keyid)) as IList<OA_CorporateClientsSheji>;//鎵ц鏌ヨ
+
+            return (null == result || result.Count == 0) ? null : result[0];//杩斿洖缁撴灉
+        }
+
     }
 }

--
Gitblit v1.9.1