protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { DataClassesDataContext DbContext = new DataClassesDataContext(); orders TempOrder = new orders(); TempOrder.frompostcode = Request["txtLoadFromAdds"]; TempOrder.fromadds = Request["hffromAdds"]; TempOrder.topostcode = Request["txtLoadToAdds"]; TempOrder.toadds = Request["hftoAdds"]; TempOrder.packagetype = Request["inlineRadioOptions"]; TempOrder.packageamount = int.Parse(Request["packageNo"]); TempOrder.price = int.Parse(Request["priceoutput"].Split('円')[0]); TempOrder.createdate = DateTime.Now; DbContext.orders.InsertOnSubmit(TempOrder); DbContext.SubmitChanges(); Response.Redirect("neworder.aspx?orderid=" + TempOrder.Id.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { int orderid = 0; if (!string.IsNullOrEmpty(Request["orderid"]) && int.TryParse(Request["orderid"], out orderid)) { } order = DbContext.orders.Where(order => order.Id == orderid).FirstOrDefault(); if (order.state.HasValue) { if (order.state.Value == 1) { btnSubmit.Text = "送信"; } else { btnSubmit.Text = "送信"; } } else { btnSubmit.Text = "送信"; } }
partial void Updateorders(orders instance);
partial void Deleteorders(orders instance);
partial void Insertorders(orders instance);