Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["memberdata"] != null)
        {
            MemberLib.Mmemberdata m = (MemberLib.Mmemberdata)Session["memberdata"];
            OrderLib.OrderData    o = OrderLib.Get_ordData(Request.QueryString["ord_code"]);

            if (m.Memberid.ToString() == o.Memberid)
            {
                htmlstr = unity.classlib.GetTextString(Server.MapPath("/templates/orderdata.html"));
                htmlstr = htmlstr.Replace("@ord_code@", o.Ord_code);
                htmlstr = htmlstr.Replace("@ordername@", o.Ordname);
                htmlstr = htmlstr.Replace("@ordermail@", o.Ordemail);
                htmlstr = htmlstr.Replace("@orderphone@", o.Ordphone);
                htmlstr = htmlstr.Replace("@shipname@", o.Ordname);
                htmlstr = htmlstr.Replace("@shipphone@", o.Ordphone);
                htmlstr = htmlstr.Replace("@shipaddress@", o.Ordaddress);
                htmlstr = htmlstr.Replace("@TotalPrice@", "NT$:" + o.TotalPrice.ToString());
                htmlstr = htmlstr.Replace("@paymode@", OrderLib.getPaymode(o.Paymode));
                htmlstr = htmlstr.Replace("@ShipPrice@", o.ShipPrice.ToString());
                htmlstr = htmlstr.Replace("@delivery_kind@", OrderLib.getdelivery_kind(o.Delivery_kind));
                string detailstr = "";
                foreach (var d in o.OrderDetail)
                {
                    detailstr += "<tr><td>" + d.P_name + "</td><td>" + d.Price.ToString() + "</td><td>" + d.Num.ToString() + "</td><td>" + d.Amount.ToString() + "</td></tr>";
                }
                htmlstr = htmlstr.Replace("@detail@", detailstr);
            }
        }
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["ord_code"] != null)
        {
            LessonLib.JoinData o = LessonLib.Web.Get_ord_JoinData(Session["ord_code"].ToString());

            string htmldetail = "";

            htmlstr    = unity.classlib.GetTextString(Server.MapPath("/templates/Lessondata0.html"));
            htmldetail = unity.classlib.GetTextString(Server.MapPath("/templates/classdetail.html"));
            htmlstr    = htmlstr.Replace("@subject@", o.LessonData.MainData.Subject);
            htmlstr    = htmlstr.Replace("@pic@", o.LessonData.MainData.Pic);
            htmlstr    = htmlstr.Replace("@totalprice@", o.OrderData.TotalPrice.ToString());
            htmlstr    = htmlstr.Replace("@classdate@", o.LessonData.StartDay.ToShortDateString() + "~" + o.LessonData.EndDay.ToShortDateString());
            htmlstr    = htmlstr.Replace("@address@", o.LessonData.Address);
            htmlstr    = htmlstr.Replace("@ord_code@", o.Ord_code);
            htmlstr    = htmlstr.Replace("@DeliveryPrice@", o.OrderData.ShipPrice.ToString());
            htmlstr    = htmlstr.Replace("@ordername@", o.OrderData.Ordname);
            htmlstr    = htmlstr.Replace("@ordermail@", o.OrderData.Ordemail);
            htmlstr    = htmlstr.Replace("@orderphone@", o.OrderData.Ordphone);
            htmlstr    = htmlstr.Replace("@shipname@", o.OrderData.Ordname);
            htmlstr    = htmlstr.Replace("@shipphone@", o.OrderData.Ordphone);
            htmlstr    = htmlstr.Replace("@shipaddress@", o.OrderData.Ordaddress);
            htmlstr    = htmlstr.Replace("@TotalPrice@", "NT$:" + o.OrderData.TotalPrice.ToString());
            htmlstr    = htmlstr.Replace("@paymode@", OrderLib.getPaymode(o.OrderData.Paymode));
            htmlstr    = htmlstr.Replace("@ShipPrice@", o.OrderData.ShipPrice.ToString());
            htmlstr    = htmlstr.Replace("@delivery_kind@", OrderLib.getdelivery_kind(o.OrderData.Delivery_kind));
            htmlstr    = htmlstr.Replace("@ticketname@", o.LessonData.MainData.Subject);
            htmlstr    = htmlstr.Replace("@StartDay@", o.LessonData.MainData.Lesson.StartDay.ToString("yyyy/MM/dd"));
            htmlstr    = htmlstr.Replace("@EndDay@", o.LessonData.MainData.Lesson.EndDay.ToString("yyyy/MM/dd"));
            htmlstr    = htmlstr.Replace("@Lessontime@", o.LessonData.MainData.Lesson.Lessontime);

            string temp  = "";
            string temp1 = "";
            foreach (article.LessonDetail d in o.LessonData.LessonDetail)
            {
                var data = o.JoinDetail.FindAll(y => y.LessonId == d.LessonId);

                // var data = o.LessonData.LessonDetail.FindAll  (y => y.LessonId == d.LessonId).Sum(c => d.Sellprice );
                //  var data = o.LessonData.LessonDetail.FindAll.Where(x => x.ID).Sum(c => c.price)
                if (data != null)
                {
                    temp1 += temp1 == "" ? "<tr><td width = '40%' rowspan = '" + o.LessonData.LessonDetail.Count + "'>票券 </td><td>" + d.Description : "<tr><td width = '20%'>" + d.Description;
                    temp1 += "</td><td width = '20%'> NT$" + d.Sellprice + "</td>";
                    temp1 += "<td width = '20%' class='text-right'>";
                    temp1 += "NT$" + d.Sellprice * data.Count + "</td></tr>";
                }
            }
            foreach (LessonLib.JoinDetail d in o.JoinDetail)
            {
                string QrCode = o.Ord_code + "-" + d.JoinId.ToString() + "-" + d.LessonId + "-" + d.Secno;
                temp += htmldetail;
                temp  = temp.Replace("@secno@", d.Secno.ToString());
                temp  = temp.Replace("@ticketno@", QrCode);
                temp  = temp.Replace("@name@", d.Name.ToString());
                temp  = temp.Replace("@email@", d.Email.ToString());
                temp  = temp.Replace("@phone@", d.Phone.ToString());
                temp  = temp.Replace("@qrcode@", QrCode);

                QR_Encode qr = new QR_Encode();
                qr.BackColor = Color.White;
                qr.ForeColor = Color.Black;
                int i = qr.EncodeData(1, 0, false, 1, 5, QrCode, Server.MapPath("upload/" + QrCode + ".gif"), false, 255, 255);
                //Bitmap b = qr.GetBMP; //輸出至前端
                //Response.ContentType = "image/jpeg";
                //b.Save(Response.OutputStream, ImageFormat.Gif);
                //b.Dispose();
            }
            htmlstr = htmlstr.Replace("@detail@", temp1);
            htmlstr = htmlstr.Replace("@classdetail@", temp);
        }
    }
Ejemplo n.º 3
0
        public static string Get_JoinData(string ord_code)
        {
            string htmldetail = "";
            string htmlstr;

            LessonLib.JoinData o = LessonLib.Web.Get_ord_JoinData(ord_code);

            htmlstr    = unity.classlib.GetTextString(HttpContext.Current.Server.MapPath(" /templates/Lessondata0.html"));
            htmldetail = unity.classlib.GetTextString(HttpContext.Current.Server.MapPath("/templates/classdetail.html"));
            htmlstr    = htmlstr.Replace("@subject@", o.LessonData.MainData.Subject);
            htmlstr    = htmlstr.Replace("@pic@", o.LessonData.MainData.Pic);
            htmlstr    = htmlstr.Replace("@totalprice@", o.OrderData.TotalPrice.ToString());
            htmlstr    = htmlstr.Replace("@classdate@", o.LessonData.StartDay.ToShortDateString() + "~" + o.LessonData.EndDay.ToShortDateString());
            htmlstr    = htmlstr.Replace("@address@", o.LessonData.Address);
            htmlstr    = htmlstr.Replace("@ord_code@", o.Ord_code);
            htmlstr    = htmlstr.Replace("@DeliveryPrice@", o.OrderData.ShipPrice.ToString());
            htmlstr    = htmlstr.Replace("@ordername@", o.OrderData.Ordname);
            htmlstr    = htmlstr.Replace("@ordermail@", o.OrderData.Ordemail);
            htmlstr    = htmlstr.Replace("@orderphone@", o.OrderData.Ordphone);
            htmlstr    = htmlstr.Replace("@shipname@", o.OrderData.Ordname);
            htmlstr    = htmlstr.Replace("@shipphone@", o.OrderData.Ordphone);
            htmlstr    = htmlstr.Replace("@shipaddress@", o.OrderData.Ordaddress);
            htmlstr    = htmlstr.Replace("@TotalPrice@", "NT$:" + o.OrderData.TotalPrice.ToString());
            htmlstr    = htmlstr.Replace("@paymode@", OrderLib.getPaymode(o.OrderData.Paymode));
            htmlstr    = htmlstr.Replace("@ShipPrice@", o.OrderData.ShipPrice.ToString());
            htmlstr    = htmlstr.Replace("@delivery_kind@", OrderLib.getdelivery_kind(o.OrderData.Delivery_kind));
            htmlstr    = htmlstr.Replace("@ticketname@", o.LessonData.MainData.Subject);
            htmlstr    = htmlstr.Replace("@StartDay@", o.LessonData.MainData.Lesson.StartDay.ToString("yyyy/MM/dd"));
            htmlstr    = htmlstr.Replace("@EndDay@", o.LessonData.MainData.Lesson.EndDay.ToString("yyyy/MM/dd"));
            htmlstr    = htmlstr.Replace("@Lessontime@", o.LessonData.MainData.Lesson.Lessontime);
            htmlstr    = htmlstr.Replace("@paymode@", OrderLib.getPaymode(o.OrderData.Paymode));
            htmlstr    = htmlstr.Replace("@paystatus@", OrderLib.get_ord_status(o.OrderData.Status));
            SpGatewayHelper.Models.TradeInfoLog log = OrderLib.Get_Tradelog(ord_code);
            string payinfo = "";

            if (log.Result.TradeNo != "")
            {
                payinfo += "<tr><td  colspan=\"4\">轉帳資訊:<br>";
                payinfo += "銀行代碼:" + log.Result.BankCode + "<br>";
                payinfo += "帳號:" + log.Result.CodeNo + "<br></td></tr>";
            }
            //  string payinfo = "";
            htmlstr = htmlstr.Replace("@payinfo@", payinfo);

            string temp  = "";
            string temp1 = "";

            foreach (article.LessonDetail d in o.LessonData.LessonDetail)
            {
                var data = o.JoinDetail.Find(y => y.LessonId == d.LessonId);

                // var data = o.LessonData.LessonDetail.FindAll  (y => y.LessonId == d.LessonId).Sum(c => d.Sellprice );
                //  var data = o.LessonData.LessonDetail.FindAll.Where(x => x.ID).Sum(c => c.price)
                if (data != null)
                {
                    temp1 += "<tr><td>" + o.LessonData.MainData.Subject + "</td>";
                    temp1 += "<td  colspan=\"2\">" + d.Description + "</td>";
                    temp1 += "<td  class='text-right'>";
                    temp1 += "NT$" + d.Sellprice + "</td></tr>";
                }
            }
            foreach (LessonLib.JoinDetail d in o.JoinDetail)
            {
                string QrCode = o.Ord_code + "-" + d.JoinId.ToString() + "-" + d.LessonId;
                string url    = "http://www.culturelaunch.net/lib/checkjoin.aspx?code=" + QrCode;
                temp += htmldetail;
                temp  = temp.Replace("@secno@", d.JoinId.ToString());
                temp  = temp.Replace("@ticketno@", QrCode);
                temp  = temp.Replace("@name@", d.Name.ToString());
                temp  = temp.Replace("@email@", d.Email.ToString());
                temp  = temp.Replace("@phone@", d.Phone.ToString());
                temp  = temp.Replace("@qrcode@", QrCode);
                temp  = temp.Replace("@orderno@", ord_code);
                QR_Encode qr = new QR_Encode();
                qr.BackColor = Color.White;
                qr.ForeColor = Color.Black;
                int i = qr.EncodeData(1, 0, true, -1, 5, url, HttpContext.Current.Server.MapPath("upload/" + QrCode + ".gif"), false, 255, 255);
                //Bitmap b = qr.GetBMP; //輸出至前端
                //Response.ContentType = "image/jpeg";
                //b.Save(Response.OutputStream, ImageFormat.Gif);
                //b.Dispose();
            }
            htmlstr = htmlstr.Replace("@detail@", temp1);
            htmlstr = htmlstr.Replace("@classdetail@", temp);
            return(htmlstr);
        }