Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int     instructionID = Convert.ToInt32(Request.QueryString["InstructionID"]);
            DataSet extra         = null;

            if (instructionID > 0)
            {
                string cacheName = "_instruction" + instructionID.ToString();

                if (Cache[cacheName] == null)
                {
                    Facade.IJob facJob = new Facade.Job();
                    extra = facJob.GetExtrasForInstructionID(instructionID);
                    Cache.Add(cacheName, extra, null, System.Web.Caching.Cache.NoAbsoluteExpiration, new TimeSpan(0, 20, 0), System.Web.Caching.CacheItemPriority.Normal, null);
                }
                else
                {
                    extra = (DataSet)Cache[cacheName];
                }
            }

            if (extra != null)
            {
                StringBuilder output = new StringBuilder();
                output.Append(header);

                foreach (DataRow dr in extra.Tables[0].Rows)
                {
                    output.Append(string.Format(content, dr["OrderID"].ToString(), dr["ExtraType"].ToString(), dr["ExtraState"].ToString(), dr["ClientContact"].ToString(), ((decimal)dr["ExtraAmount"]).ToString("C")));
                }

                output.Append(footer);

                phExtras.Controls.Add(new LiteralControl(output.ToString()));
            }
        }