namespace MySystem.Models.View {
public class ItemPage {
public Item Item { get; set; }
public int CurrentItemID { get; set; }
public string ModalHeading { get; set; }
public string SubmitButtonText { get; set; }
/// <summary>
/// This will be the color that we will use in the view, if set
/// </summary>
public System.Drawing.Color CssColorTwist { get; set; }
public ItemPage() {
//ItemEngine iEngine = new ItemEngine();
//this.Item = iEngine.GetItem(CurrentItemID);
}
public ItemPage(Item item) {
this.Item = item;
this.CurrentItemID = Item.ItemID;
}
public ItemPage(Item item, string btnText, string modalHeading) {
this.Item = item;
ModalHeading = modalHeading;
SubmitButtonText = btnText;
this.CurrentItemID = Item.ItemID;
}
public ItemPage(Item item, string btnText, string modalHeading, System.Drawing.Color cssColor) {
this.Item = item;
ModalHeading = modalHeading;
SubmitButtonText = btnText;
CssColorTwist = cssColor;
this.CurrentItemID = Item.ItemID;
}
public Color GetCssColorDarker(double factor) {
if(CssColorTwist != null) {
return CssColorTwist.GetColorDarker(factor);
}
return new Color();
}
public Color GetCssColorLighter(double factor) {
if (CssColorTwist != null) {
return CssColorTwist.GetColorLighter(factor);
}
return new Color();
}
}
}
<span class="display-form-item">@Html.DisplayNameFor(model => model.Item.Address):</span>
@Html.TextBoxFor(model => model.Item.Address, new { @id = "addressID-" + @Model.Item.ItemID, @class = "form-control", data_toggle = "tooltip", data_placement = "bottom", @title = "Skriv inn adresse" })
@Html.ValidationMessageFor(model => model.Item.Address, String.Empty, new { @class = "alert-danger" })
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE