Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 保存新属性asp.net mvc_Asp.net Mvc_C# 4.0_Model View Controller - Fatal编程技术网

Asp.net mvc 保存新属性asp.net mvc

Asp.net mvc 保存新属性asp.net mvc,asp.net-mvc,c#-4.0,model-view-controller,Asp.net Mvc,C# 4.0,Model View Controller,我使用的框架必须扩展新的模型、控制器 所以有一个观点。现在我尝试向现有视图添加一个属性 新财产称为: public virtual string Project_Number { get; set; } 模型如下所示: public class OrderoverviewModel_ProjectNumber: OrderOverviewModel { [Display(Name = "ProjectNumber")] [MaxLength(50,

我使用的框架必须扩展新的模型、控制器

所以有一个观点。现在我尝试向现有视图添加一个属性

新财产称为:

public virtual string  Project_Number { get; set; }
模型如下所示:

public class OrderoverviewModel_ProjectNumber: OrderOverviewModel
    {

        [Display(Name = "ProjectNumber")]
        [MaxLength(50, ErrorMessageResourceName = "Validation_MaxLength")]
        public virtual string  Project_Number { get; set; }
        public OrderOverviewModel overViewModel { get; set; }
    }
@model Sana.Commerce.DomainModel.Order.OrderoverviewModel_ProjectNumber

<div class="additional-info">
    <h4>@Sana.SimpleText("OrderOverview_AdditionalInformation")</h4>
    @*@if (Shop.UserAbilities.Has(AbilityTo.AddReferenceNo))
    {*@
        <div class="form-row">
            <div class="control">
                <div class="label">
                    @Html.LabelFor(it => it.ReferenceNumber, htmlAttributes: new { @class = "lbl" })
                </div>
                <div class="field">
                    @Html.EditorFor(it => it.ReferenceNumber, new { tabindex = 1 })
                </div>
            </div>
            <div class="validation">
                @Html.ValidationMessageFor(it => it.ReferenceNumber)
            </div>
        </div>
    @*}*@

    @*@if (Shop.UserAbilities.Has(AbilityTo.AddReferenceNo))
    {*@
        <div class="form-row">
            <div class="control">
                <div class="label">
                    @Html.LabelFor(it => it.Project_Number, htmlAttributes: new { @class = "lbl" })
                </div>
                <div class="field">
                    @Html.EditorFor(it => it.Project_Number, new { tabindex = 1 })
                </div>
            </div>
            <div class="validation">
                @Html.ValidationMessageFor(it => it.Project_Number)
            </div>
        </div>
    @*}*@




    @if (Shop.UserAbilities.Has(AbilityTo.AddReferenceNo))
    {
        <div class="form-row">
            <div class="control">
                <div class="label">
                    @Html.LabelFor(it => it.Comments, htmlAttributes: new { @class = "lbl" })
                </div>
                <div class="field">
                    @Html.EditorFor(it => it.Comments, new { tabindex = 1 })
                </div>
            </div>
            <div class="validation">
                @Html.ValidationMessageFor(it => it.Comments)
            </div>
        </div>
    }
    @if (Shop.UserAbilities.Has(AbilityTo.AddRequestedDeliveryDate))
    {
        <div class="form-row">
            <div class="control">
                <div class="label">
                    @Html.LabelFor(it => it.DeliveryDate, htmlAttributes: new { @class = "lbl" })
                </div>
                <div class="field">
                    @Html.EditorFor(it => it.DeliveryDate, new { tabindex = 1 })
                </div>
            </div>
            <div class="validation">
                @Html.ValidationMessageFor(it => it.DeliveryDate)
            </div>
        </div>
    }
</div>
 public class ExtendedOrderManager : OrderManager<IExtendedOrderProvider>
    {
        public string CustomAction(int value)
        {
            var cacheKey = CacheKey.ForErpItem<object>("customaction_" + value, cacheGroup: "abc");
            return CacheManager.FromCache(cacheKey, () => Provider.CustomAction(value));
        }

        public override IOrder SaveOrder(IOrder order)
        {
            //order.Fields.SetField(new Entities.EntityField("BlanketOrderId", "BO1") { StoreWithEntity = true });

            //order["BlanketOrderId"] = "BO1";
            //order.Fields["BlanketOrderId"].StoreWithEntity = true;

            return base.SaveOrder(order);
        }
    }
 //
    // Summary:
    //     This interface represents an order in the ERP system. This can be an order that
    //     still has to be placed or an order that is already in the ERP (for example order
    //     history). There are several types of orders like regular orders, invoice and
    //     quotes. The type of order is stored in the document type property.
    public interface IOrder : IEntity, IVersionedItem
    {
        //
        // Summary:
        //     ID of the account that placed the order.
        string AccountId { get; set; }
        //
        // Summary:
        //     The type of account that placed this order.
        AccountType AccountType { get; set; }
        //
        // Summary:
        //     Gets or sets the list of order attachments.
        IList<IAttachment> Attachments { get; set; }
        //
        // Summary:
        //     Gets or sets the status of order authorization.
        OrderAuthorizationStatus AuthorizationStatus { get; set; }
        //
        // Summary:
        //     Address that will recieve the invoice.
        ICustomerAddress BillingAddress { get; set; }
        //
        // Summary:
        //     Gets or sets bill-to name.
        string BillToName { get; set; }
        //
        // Summary:
        //     Gets or sets the comment.
        string Comment { get; set; }
        //
        // Summary:
        //     Name of the Contact that placed this order.
        string Contact { get; set; }
        //
        // Summary:
        //     ID of the Contact that placed this order.
        string ContactId { get; set; }
        //
        // Summary:
        //     ID of the currency used to place this order (for example USD). This can be different
        //     from the current users default currency.
        string CurrencyId { get; set; }
        //
        // Summary:
        //     The total amount of discount the customer gets over this order. This includes
        //     linediscount over all basketlines and invoice discount.
        decimal DiscountAmount { get; set; }
        //
        // Summary:
        //     Document date.
        Date? DocumentDate { get; set; }
        //
        // Summary:
        //     The OrderId (in the case of other types than Order or Quote).
        string DocumentId { get; set; }
        //
        // Summary:
        //     Gets or sets the document type.
        string DocumentType { get; set; }
        //
        // Summary:
        //     Due date.
        Date? DueDate { get; set; }
        //
        // Summary:
        //     Gets or sets the value indicating whether this order has report.
        bool HasReport { get; set; }
        //
        // Summary:
        //     The ID of the instance.
        string Id { get; set; }
        //
        // Summary:
        //     The total amount of invoice discount the customer gets over his/her order. This
        //     is calculated using the totalprice without VAT.
        decimal InvoiceDiscount { get; set; }
        //
        // Summary:
        //     Gets or sets a value indicating whether this quote is confirmed.
        bool IsQuoteConfirmed { get; set; }
        //
        // Summary:
        //     Location code.
        string LocationCode { get; set; }
        //
        // Summary:
        //     Gets or sets the max expired date.
        DateTime? MaxExpirationDate { get; set; }
        //
        // Summary:
        //     Date on which the order was placed.
        Date OrderDate { get; set; }
        //
        // Summary:
        //     The order lines.
        IList<IOrderLine> OrderLines { get; set; }
        //
        // Summary:
        //     The number of order lines.
        int OrderLinesCount { get; set; }
        //
        // Summary:
        //     Gets or sets the order type.
        OrderType? OrderType { get; set; }
        //
        // Summary:
        //     The ID of the sales order which this document is linked to. For example, if it
        //     is an 'Invoice' document then this field should be the ID of the sales order
        //     for which this invoice has been posted. In case this is an 'Order' or 'Quote'
        //     document type then this field should be empty.
        string OriginalOrderId { get; set; }
        //
        // Summary:
        //     Gets or sets the original quote identifier.
        string OriginalQuoteId { get; set; }
        //
        // Summary:
        //     The total amount outstanding.
        decimal OutstandingAmount { get; set; }
        //
        // Summary:
        //     Address of the company the order was paid by.
        ICustomerAddress PayerAddress { get; set; }
        //
        // Summary:
        //     Payment Discount.
        decimal PaymentDiscount { get; set; }
        //
        // Summary:
        //     Payment Discount Date.
        Date? PaymentDiscountDate { get; set; }
        //
        // Summary:
        //     Name of the payment method used by the customer.
        string PaymentMethod { get; set; }
        //
        // Summary:
        //     Status of the Payment of this order.
        string PaymentStatus { get; set; }
        //
        // Summary:
        //     Payment terms code.
        string PaymentTermsCode { get; set; }
        //
        // Summary:
        //     The payment transaction ID.
        string PaymentTransactionId { get; set; }
        //
        // Summary:
        //     Posting Date.
        Date? PostingDate { get; set; }
        //
        // Summary:
        //     Gets or sets the prepayment amount.
        decimal PrepaymentAmount { get; set; }
        //
        // Summary:
        //     Gets or sets the prepayment percentage.
        decimal PrepaymentPercentage { get; set; }
        //
        // Summary:
        //     Gets or sets a value indicating whether prices include tax.
        bool PricesInclTax { get; set; }
        //
        // Summary:
        //     Promised Delivery Date.
        Date? PromisedDeliveryDate { get; set; }
        //
        // Summary:
        //     Gets or sets the reference no.
        string ReferenceNo { get; set; }
        //
        // Summary:
        //     Requested Delivery Date.
        Date? RequestedDeliveryDate { get; set; }
        //
        // Summary:
        //     The round-off value, which is added or substracted from the subtotal value when
        //     the rounding precision of total costs is corrected on the ERP side.
        decimal RoundOff { get; set; }
        //
        // Summary:
        //     Name of the sales person that placed this order.
        string SalesPerson { get; set; }
        //
        // Summary:
        //     ID of the sales person that placed this order.
        string SalesPersonId { get; set; }
        //
        // Summary:
        //     Gets or sets the Sana internal order identifier.
        string SanaOrderId { get; set; }
        //
        // Summary:
        //     Address of the company the order was selled to.
        ICustomerAddress SellToAddress { get; set; }
        //
        // Summary:
        //     Date the order was shipped.
        Date? ShipmentDate { get; set; }
        //
        // Summary:
        //     Address this order will or was shipped to.
        ICustomerAddress ShippingAddress { get; set; }
        //
        // Summary:
        //     Code (string) of the method the order was shipped by.
        string ShippingMethodCode { get; set; }
        //
        // Summary:
        //     Name of the method the order was shipped by.
        string ShippingMethodName { get; set; }
        //
        // Summary:
        //     Gets or sets the shipping status. Order is shipped only if order lines are shipped.
        string ShippingStatus { get; set; }
        //
        // Summary:
        //     The shipping tracking link provided by the shipping agent.
        string ShippingTrackingLink { get; set; }
        //
        // Summary:
        //     The shipping tracking number provided by the shipping agent.
        string ShippingTrackingNumber { get; set; }
        //
        // Summary:
        //     Gets or sets ship-to name.
        string ShipToName { get; set; }
        //
        // Summary:
        //     Gets or sets the e-mail address of the shop account who placed this order.
        string ShopAccountEmail { get; set; }
        //
        // Summary:
        //     Gets or sets the status of this order.
        OrderStatus Status { get; set; }
        //
        // Summary:
        //     The total Amount of tax the user has to pay over all basket lines.
        decimal TaxAmount { get; set; }
        //
        // Summary:
        //     The lines containing taxes.
        IList<ITaxLine> TaxLines { get; set; }
        //
        // Summary:
        //     The percentage of tax that is used for this order (for example when tax is 19%,
        //     this property contains 19).
        decimal TaxPercent { get; set; }
        //
        // Summary:
        //     The total price of all products of this order including invoice discount and
        //     VAT.
        decimal TotalPrice { get; set; }
        //
        // Summary:
        //     The total price of all products of this order without any discounts or tax added.
        decimal TotalPriceExcludingDiscount { get; set; }
        //
        // Summary:
        //     The total price of all products of this order including invoice discount, but
        //     excluding tax.
        decimal TotalPriceExcludingTax { get; set; }
        //
        // Summary:
        //     The Total number of products this order contains.
        decimal TotalQuantity { get; }
        //
        // Summary:
        //     The ID of the website.
        string WebsiteId { get; set; }
    }
 interface IOrderProjectNumber:IOrder
    {
        string ProjectNumber { get; set; }

    }
视图如下所示:

public class OrderoverviewModel_ProjectNumber: OrderOverviewModel
    {

        [Display(Name = "ProjectNumber")]
        [MaxLength(50, ErrorMessageResourceName = "Validation_MaxLength")]
        public virtual string  Project_Number { get; set; }
        public OrderOverviewModel overViewModel { get; set; }
    }
@model Sana.Commerce.DomainModel.Order.OrderoverviewModel_ProjectNumber

<div class="additional-info">
    <h4>@Sana.SimpleText("OrderOverview_AdditionalInformation")</h4>
    @*@if (Shop.UserAbilities.Has(AbilityTo.AddReferenceNo))
    {*@
        <div class="form-row">
            <div class="control">
                <div class="label">
                    @Html.LabelFor(it => it.ReferenceNumber, htmlAttributes: new { @class = "lbl" })
                </div>
                <div class="field">
                    @Html.EditorFor(it => it.ReferenceNumber, new { tabindex = 1 })
                </div>
            </div>
            <div class="validation">
                @Html.ValidationMessageFor(it => it.ReferenceNumber)
            </div>
        </div>
    @*}*@

    @*@if (Shop.UserAbilities.Has(AbilityTo.AddReferenceNo))
    {*@
        <div class="form-row">
            <div class="control">
                <div class="label">
                    @Html.LabelFor(it => it.Project_Number, htmlAttributes: new { @class = "lbl" })
                </div>
                <div class="field">
                    @Html.EditorFor(it => it.Project_Number, new { tabindex = 1 })
                </div>
            </div>
            <div class="validation">
                @Html.ValidationMessageFor(it => it.Project_Number)
            </div>
        </div>
    @*}*@




    @if (Shop.UserAbilities.Has(AbilityTo.AddReferenceNo))
    {
        <div class="form-row">
            <div class="control">
                <div class="label">
                    @Html.LabelFor(it => it.Comments, htmlAttributes: new { @class = "lbl" })
                </div>
                <div class="field">
                    @Html.EditorFor(it => it.Comments, new { tabindex = 1 })
                </div>
            </div>
            <div class="validation">
                @Html.ValidationMessageFor(it => it.Comments)
            </div>
        </div>
    }
    @if (Shop.UserAbilities.Has(AbilityTo.AddRequestedDeliveryDate))
    {
        <div class="form-row">
            <div class="control">
                <div class="label">
                    @Html.LabelFor(it => it.DeliveryDate, htmlAttributes: new { @class = "lbl" })
                </div>
                <div class="field">
                    @Html.EditorFor(it => it.DeliveryDate, new { tabindex = 1 })
                </div>
            </div>
            <div class="validation">
                @Html.ValidationMessageFor(it => it.DeliveryDate)
            </div>
        </div>
    }
</div>
 public class ExtendedOrderManager : OrderManager<IExtendedOrderProvider>
    {
        public string CustomAction(int value)
        {
            var cacheKey = CacheKey.ForErpItem<object>("customaction_" + value, cacheGroup: "abc");
            return CacheManager.FromCache(cacheKey, () => Provider.CustomAction(value));
        }

        public override IOrder SaveOrder(IOrder order)
        {
            //order.Fields.SetField(new Entities.EntityField("BlanketOrderId", "BO1") { StoreWithEntity = true });

            //order["BlanketOrderId"] = "BO1";
            //order.Fields["BlanketOrderId"].StoreWithEntity = true;

            return base.SaveOrder(order);
        }
    }
 //
    // Summary:
    //     This interface represents an order in the ERP system. This can be an order that
    //     still has to be placed or an order that is already in the ERP (for example order
    //     history). There are several types of orders like regular orders, invoice and
    //     quotes. The type of order is stored in the document type property.
    public interface IOrder : IEntity, IVersionedItem
    {
        //
        // Summary:
        //     ID of the account that placed the order.
        string AccountId { get; set; }
        //
        // Summary:
        //     The type of account that placed this order.
        AccountType AccountType { get; set; }
        //
        // Summary:
        //     Gets or sets the list of order attachments.
        IList<IAttachment> Attachments { get; set; }
        //
        // Summary:
        //     Gets or sets the status of order authorization.
        OrderAuthorizationStatus AuthorizationStatus { get; set; }
        //
        // Summary:
        //     Address that will recieve the invoice.
        ICustomerAddress BillingAddress { get; set; }
        //
        // Summary:
        //     Gets or sets bill-to name.
        string BillToName { get; set; }
        //
        // Summary:
        //     Gets or sets the comment.
        string Comment { get; set; }
        //
        // Summary:
        //     Name of the Contact that placed this order.
        string Contact { get; set; }
        //
        // Summary:
        //     ID of the Contact that placed this order.
        string ContactId { get; set; }
        //
        // Summary:
        //     ID of the currency used to place this order (for example USD). This can be different
        //     from the current users default currency.
        string CurrencyId { get; set; }
        //
        // Summary:
        //     The total amount of discount the customer gets over this order. This includes
        //     linediscount over all basketlines and invoice discount.
        decimal DiscountAmount { get; set; }
        //
        // Summary:
        //     Document date.
        Date? DocumentDate { get; set; }
        //
        // Summary:
        //     The OrderId (in the case of other types than Order or Quote).
        string DocumentId { get; set; }
        //
        // Summary:
        //     Gets or sets the document type.
        string DocumentType { get; set; }
        //
        // Summary:
        //     Due date.
        Date? DueDate { get; set; }
        //
        // Summary:
        //     Gets or sets the value indicating whether this order has report.
        bool HasReport { get; set; }
        //
        // Summary:
        //     The ID of the instance.
        string Id { get; set; }
        //
        // Summary:
        //     The total amount of invoice discount the customer gets over his/her order. This
        //     is calculated using the totalprice without VAT.
        decimal InvoiceDiscount { get; set; }
        //
        // Summary:
        //     Gets or sets a value indicating whether this quote is confirmed.
        bool IsQuoteConfirmed { get; set; }
        //
        // Summary:
        //     Location code.
        string LocationCode { get; set; }
        //
        // Summary:
        //     Gets or sets the max expired date.
        DateTime? MaxExpirationDate { get; set; }
        //
        // Summary:
        //     Date on which the order was placed.
        Date OrderDate { get; set; }
        //
        // Summary:
        //     The order lines.
        IList<IOrderLine> OrderLines { get; set; }
        //
        // Summary:
        //     The number of order lines.
        int OrderLinesCount { get; set; }
        //
        // Summary:
        //     Gets or sets the order type.
        OrderType? OrderType { get; set; }
        //
        // Summary:
        //     The ID of the sales order which this document is linked to. For example, if it
        //     is an 'Invoice' document then this field should be the ID of the sales order
        //     for which this invoice has been posted. In case this is an 'Order' or 'Quote'
        //     document type then this field should be empty.
        string OriginalOrderId { get; set; }
        //
        // Summary:
        //     Gets or sets the original quote identifier.
        string OriginalQuoteId { get; set; }
        //
        // Summary:
        //     The total amount outstanding.
        decimal OutstandingAmount { get; set; }
        //
        // Summary:
        //     Address of the company the order was paid by.
        ICustomerAddress PayerAddress { get; set; }
        //
        // Summary:
        //     Payment Discount.
        decimal PaymentDiscount { get; set; }
        //
        // Summary:
        //     Payment Discount Date.
        Date? PaymentDiscountDate { get; set; }
        //
        // Summary:
        //     Name of the payment method used by the customer.
        string PaymentMethod { get; set; }
        //
        // Summary:
        //     Status of the Payment of this order.
        string PaymentStatus { get; set; }
        //
        // Summary:
        //     Payment terms code.
        string PaymentTermsCode { get; set; }
        //
        // Summary:
        //     The payment transaction ID.
        string PaymentTransactionId { get; set; }
        //
        // Summary:
        //     Posting Date.
        Date? PostingDate { get; set; }
        //
        // Summary:
        //     Gets or sets the prepayment amount.
        decimal PrepaymentAmount { get; set; }
        //
        // Summary:
        //     Gets or sets the prepayment percentage.
        decimal PrepaymentPercentage { get; set; }
        //
        // Summary:
        //     Gets or sets a value indicating whether prices include tax.
        bool PricesInclTax { get; set; }
        //
        // Summary:
        //     Promised Delivery Date.
        Date? PromisedDeliveryDate { get; set; }
        //
        // Summary:
        //     Gets or sets the reference no.
        string ReferenceNo { get; set; }
        //
        // Summary:
        //     Requested Delivery Date.
        Date? RequestedDeliveryDate { get; set; }
        //
        // Summary:
        //     The round-off value, which is added or substracted from the subtotal value when
        //     the rounding precision of total costs is corrected on the ERP side.
        decimal RoundOff { get; set; }
        //
        // Summary:
        //     Name of the sales person that placed this order.
        string SalesPerson { get; set; }
        //
        // Summary:
        //     ID of the sales person that placed this order.
        string SalesPersonId { get; set; }
        //
        // Summary:
        //     Gets or sets the Sana internal order identifier.
        string SanaOrderId { get; set; }
        //
        // Summary:
        //     Address of the company the order was selled to.
        ICustomerAddress SellToAddress { get; set; }
        //
        // Summary:
        //     Date the order was shipped.
        Date? ShipmentDate { get; set; }
        //
        // Summary:
        //     Address this order will or was shipped to.
        ICustomerAddress ShippingAddress { get; set; }
        //
        // Summary:
        //     Code (string) of the method the order was shipped by.
        string ShippingMethodCode { get; set; }
        //
        // Summary:
        //     Name of the method the order was shipped by.
        string ShippingMethodName { get; set; }
        //
        // Summary:
        //     Gets or sets the shipping status. Order is shipped only if order lines are shipped.
        string ShippingStatus { get; set; }
        //
        // Summary:
        //     The shipping tracking link provided by the shipping agent.
        string ShippingTrackingLink { get; set; }
        //
        // Summary:
        //     The shipping tracking number provided by the shipping agent.
        string ShippingTrackingNumber { get; set; }
        //
        // Summary:
        //     Gets or sets ship-to name.
        string ShipToName { get; set; }
        //
        // Summary:
        //     Gets or sets the e-mail address of the shop account who placed this order.
        string ShopAccountEmail { get; set; }
        //
        // Summary:
        //     Gets or sets the status of this order.
        OrderStatus Status { get; set; }
        //
        // Summary:
        //     The total Amount of tax the user has to pay over all basket lines.
        decimal TaxAmount { get; set; }
        //
        // Summary:
        //     The lines containing taxes.
        IList<ITaxLine> TaxLines { get; set; }
        //
        // Summary:
        //     The percentage of tax that is used for this order (for example when tax is 19%,
        //     this property contains 19).
        decimal TaxPercent { get; set; }
        //
        // Summary:
        //     The total price of all products of this order including invoice discount and
        //     VAT.
        decimal TotalPrice { get; set; }
        //
        // Summary:
        //     The total price of all products of this order without any discounts or tax added.
        decimal TotalPriceExcludingDiscount { get; set; }
        //
        // Summary:
        //     The total price of all products of this order including invoice discount, but
        //     excluding tax.
        decimal TotalPriceExcludingTax { get; set; }
        //
        // Summary:
        //     The Total number of products this order contains.
        decimal TotalQuantity { get; }
        //
        // Summary:
        //     The ID of the website.
        string WebsiteId { get; set; }
    }
 interface IOrderProjectNumber:IOrder
    {
        string ProjectNumber { get; set; }

    }
如果我查看方法:SaveOrder(Iorder-order)并将鼠标悬停在顺序上,我会看到属性ProjectNumber为null

但如果我看一下眼前的窗口,如果我这样做:?订单。项目。。。我没有看到房地产项目编号??这怎么可能


谢谢

我将把你的问题分为两部分:

1) 如何从视图中获取项目编号

2) 如何将项目编号保存到数据库

关于问题1)

  • 您需要检查您的
    选择
    。如何显示
    订单概览模型\u项目编号
    ?您可能需要在
    Select
    函数中添加
    Project\u编号

  • 在编辑视图中,您不读取/编辑
    项目编号
    ,因此实际上,它是空的。 如果您不想更改
    项目编号
    ,请检查第一点,您可能无法从数据库中获取此信息

关于问题2)

  • 这里有一个棘手的部分,因为您可能没有
    IOrder
    的源代码。但是,它是一个接口,因此您可以再次检查整个解决方案,可能是主类是
    Order

  • 如果您找不到,我建议重写代码部分,因为您不应该将
    项目编号
    与其他属性以不同方式存储

更新-1:现在,让我们将
项目编号添加到
IOrder.cs
。如果需要,在Order.cs中添加它。
最后,要将其存储在数据库中,请检查
OrderManager

中的方法
SaveOrder(IOrder order)
,请仅发布相关代码。其他人可能会感到困惑。首先在SaveOrder中创建一个变量并将顺序转换为OrderoverviewModel\u ProjectNumber。检查您是否获得了价值。此外,在base.save之后保存时,您需要添加其他逻辑来保存projectnumber。取货时也是如此。谢谢您的回复。关于问题1。我已经从视图中获取了property it.Project_编号。所以这不是问题。嗨,我做了更新。我已经用新属性publicstringprojectnumber{get;set;}添加了Order类。是的,但是我不能修改接口IOrder.cs。因为它是一个dllOk。我修改了帖子,有人有想法吗?非常感谢。