/// <summary> /// Update QuotationDetail /// </summary> /// <param name="detail">QuotationDetail</param> /// <returns>bool</returns> public bool UpdateQuotationDetail(QuotationDetail detail) { try { context.Entry(detail).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); } catch { return(false); } return(true); }
public QuoteItem(QuotationDetail detail) { this.id = detail.id; this.quoteId = detail.quoteId; this.line_No = detail.line_No; this.partNo = detail.partNo; this.description = detail.description; this.qty = detail.qty; this.listPrice = detail.listPrice; this.unitPrice = detail.unitPrice; this.newUnitPrice = detail.newUnitPrice; this.category = detail.category; this.classABC = detail.classABC; this.reqDate = detail.reqDate; this.dueDate = detail.dueDate; this.inventory = detail.inventory; this.HigherLevel = detail.HigherLevel; this.ItemType = detail.ItemType; this.DisplayUnitPrice = detail.DisplayUnitPrice; this.DisplayQty = detail.DisplayQty; this.DisplayLineNo = detail.DisplayLineNo; }
public static void CartDetail2QuoteDetail(String _CartID, String _QuoteID) { List <cart_DETAIL_V2> CartDetails = MyAdvantechContext.Current.cart_DETAIL_V2.Where(d => d.Cart_Id.Equals(_CartID)).ToList(); foreach (cart_DETAIL_V2 c in CartDetails) { QuotationDetail q = new QuotationDetail(); q.quoteId = _QuoteID; q.line_No = c.Line_No; q.partNo = c.Part_No; q.description = c.Description; q.qty = c.Qty; q.listPrice = c.List_Price; q.unitPrice = c.oUnit_Price == null ? 0 : c.oUnit_Price; q.newUnitPrice = c.Unit_Price; q.itp = c.Itp; q.newItp = c.Itp; q.RecyclingFee = c.RecyclingFee == null ? 0 : c.RecyclingFee; q.deliveryPlant = c.Delivery_Plant; q.category = c.Category; q.classABC = c.@class; q.rohs = c.rohs; q.ewFlag = c.Ew_Flag; q.reqDate = c.req_date; q.dueDate = c.due_date; q.satisfyFlag = c.SatisfyFlag; q.canBeConfirmed = c.CanbeConfirmed; q.custMaterial = c.CustMaterial; q.inventory = c.inventory; //q.oType = c.otype; q.modelNo = c.Model_No; q.HigherLevel = c.higherLevel; q.ItemType = (c.Line_No >= 100 && (c.Line_No % 100 == 0)) ? 1 : 0; // weird... eQuotation only has 0/1 two kind of values. q.SequenceNo = 0; // not sure what is this field for. eQuotationContext.Current.QuotationDetail.Add(q); } eQuotationContext.Current.SaveChanges(); }