Files
ayanova7/source/WBI/ContractEdit.aspx.cs
2018-06-29 19:47:36 +00:00

82 lines
2.5 KiB
C#

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using GZTW.AyaNova.BLL;
public partial class ContractEdit : BaseThemePage
{
protected void Page_Load(object sender, EventArgs e)
{
Util.Localize(this.Page);
if (Request.QueryString["id"] == null)
CloseMe();
Contract c=Contract.GetItem(new Guid(Request.QueryString["id"].ToString()));
Page.Title = Util.LocaleText("O.Contract") + " - " + c.Name;
lblHeader.Text = Util.StringWebify(c.Name);
System.Text.StringBuilder sb = new System.Text.StringBuilder();
if (c.CanWiki)
{
sb.Append("&nbsp;<a href=\"Wiki.aspx" + TypeAndID.ToAyaURLQueryParameter(RootObjectTypes.Contract, c.ID) + "\">");
sb.Append("<img src=\"graphics/Wiki16.png\">");
sb.Append("</a>");
lblHeader.Text += sb.ToString();
sb.Length = 0;
}
sb.Append(NameFetcher.GetItem(new TypeAndID(RootObjectTypes.Region, c.RegionID)).RecordName );
sb.Append("\r\n");
sb.Append("<b>"+Util.LocaleText("Contract.Label.DiscountParts")+"</b>");
sb.Append(": ");
sb.Append(c.DiscountParts.ToString("p"));
sb.Append("\r\n");
sb.Append("<b>" + Util.LocaleText("Contract.Label.Notes") + "</b>");
sb.Append("\r\n");
sb.Append(c.Notes);
sb.Append("\r\n");
sb.Append("<b>" + Util.LocaleText("Contract.Label.ContractRatesOnly") + "</b>");
sb.Append(": ");
sb.Append(c.ContractRatesOnly.ToString());
sb.Append("\r\n");
if (c.Rates.Count > 1)
{
RatePickList rp = RatePickList.GetListWithContract(c.ID);
sb.Append("<b>" + Util.LocaleText("ContractRate.Label.List") + "</b>");
sb.Append("\r\n");
foreach (ContractRate r in c.Rates)
{
RatePickList.RatePickListInfo i = rp[r.RateID];
sb.Append(i.Name);
sb.Append(" - ");
sb.Append(i.Charge.ToString("c"));
sb.Append("\r\n");
}
}
lblDetails.Text = Util.StringWebify(sb.ToString());
}
}