/// <summary>
 /// 用于向 QuoteMain EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet&lt;T&gt; 属性的 .Add 方法。
 /// </summary>
 public void AddToQuoteMain(QuoteMain quoteMain)
 {
     base.AddObject("QuoteMain", quoteMain);
 }
 /// <summary>
 /// 创建新的 QuoteMain 对象。
 /// </summary>
 /// <param name="guid">Guid 属性的初始值。</param>
 /// <param name="name">Name 属性的初始值。</param>
 /// <param name="feeType">FeeType 属性的初始值。</param>
 /// <param name="valid">Valid 属性的初始值。</param>
 public static QuoteMain CreateQuoteMain(global::System.String guid, global::System.String name, global::System.String feeType, global::System.Boolean valid)
 {
     QuoteMain quoteMain = new QuoteMain();
     quoteMain.Guid = guid;
     quoteMain.Name = name;
     quoteMain.FeeType = feeType;
     quoteMain.Valid = valid;
     return quoteMain;
 }
Beispiel #3
0
 public void UpdateQuoteMain(QuoteMain quoteMain, List<QuoteMainRelation> quoteMainRelation, List<QuoteExpression> quoteExpression)
 {
     QuoteMainAdapter.UpdateQuoteMain(quoteMain, quoteMainRelation, quoteExpression);
 }
Beispiel #4
0
 public void InsertQuoteMain(QuoteMain quoteMain, List<QuoteMainRelation> quoteMainRelation, List<QuoteExpression> quoteExpression)
 {
     QuoteMainAdapter.InsertQuoteMain(quoteMain, quoteMainRelation, quoteExpression);
 }
Beispiel #5
0
 /// <summary>
 /// 修改报价信息
 /// </summary>
 public static void UpdateQuoteMain(QuoteMain quoteMain, List<QuoteMainRelation> quoteMainRelation, List<QuoteExpression> quoteExpression)
 {
     try
     {
         LDLLogisticsEntities context = new LDLLogisticsEntities();
         //查找该报价是否存在
         QuoteMain _quoteMain = context.QuoteMain.FirstOrDefault(obj => obj.Guid == quoteMain.Guid);
         if (_quoteMain == null)
             throw new FaultException(string.Format("报价[{0}]不存在!", quoteMain.Name));
         EntityObjectHelper.Copyto(quoteMain, ref _quoteMain); //利用反射动态赋值
         //清除报价关系表,插入新的关系表
         IQueryable<QuoteMainRelation> queryQuoteMainRelation = context.QuoteMainRelation.Where(obj => obj.SrcID == quoteMain.Guid);
         foreach (QuoteMainRelation obj in queryQuoteMainRelation)
             context.QuoteMainRelation.DeleteObject(obj);
         foreach (QuoteMainRelation obj in quoteMainRelation)
             context.QuoteMainRelation.AddObject(obj);
         //清除报价公式表,插入新的公式表
         IQueryable<QuoteExpression> queryQuoteExpression = context.QuoteExpression.Where(obj => obj.SrcID == quoteMain.Guid);
         foreach (QuoteExpression obj in queryQuoteExpression)
             context.QuoteExpression.DeleteObject(obj);
         foreach (QuoteExpression obj in quoteExpression)
             context.QuoteExpression.AddObject(obj);
         context.SysOperationLog.AddObject(SysOperationLogAdapter.GetOperationtLog("QuoteMainAdapter03", Define.Update, _quoteMain));   //记录日志
         context.SaveChanges();  //提交保存
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message);
     }
 }
Beispiel #6
0
 /// <summary>
 /// 新增报价信息
 /// </summary>
 public static void InsertQuoteMain(QuoteMain quoteMain, List<QuoteMainRelation> quoteMainRelation, List<QuoteExpression> quoteExpression)
 {
     try
     {
         LDLLogisticsEntities context = new LDLLogisticsEntities();
         //查找该ID是否存在,防止重复插入
         if (context.QuoteMain.FirstOrDefault(obj => obj.Guid.Trim().ToLower() == quoteMain.Guid.Trim().ToLower()) != null)
             throw new FaultException(string.Format("报价已存在!"));
         //插入报价关系表
         foreach (QuoteMainRelation obj in quoteMainRelation)
             context.QuoteMainRelation.AddObject(obj);
         //插入报价公式表
         foreach (QuoteExpression obj in quoteExpression)
             context.QuoteExpression.AddObject(obj);
         context.QuoteMain.AddObject(quoteMain);    //新增
         context.SysOperationLog.AddObject(SysOperationLogAdapter.GetOperationtLog("QuoteMainAdapter01", Define.Insert, quoteMain));   //记录日志
         context.SaveChanges();  //提交保存
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message);
     }
 }