protected void Page_Load(object sender, EventArgs e) { string hm = "1904"; string hhmm = hm.Insert(2, ":"); TimeSpan timeSpan = TimeSpan.Parse(hhmm); TimeSpan timeSpan2 = TimeSpan.Parse("02:12"); bool a = timeSpan > timeSpan2; if (!IsPostBack) { string results1 = Snippet.func(@"O V.7\nG ทะเบียนรถ - ต้นหาด้วย x\nX\\\nteqPZiWrvecli5fXLcpWEUQ%...\n2\nฎง 9999\nกรุงเทพมหานคร\nง)\nล\n"); string results2 = Snippet.func(@"8ณ-9174\nกรุงเทพมหานคร\n(Uส\nthaisecondhand.com\nThaiSecondhand แหล่งซื้อขายของมือสอง ขา\nมือสอง\n"); string results3 = Snippet.func(@"ณท.3368\nกรุงเทพมหานคร 0\n"); LearningDataContext db = new LearningDataContext(); Trees = db.Trees.ToList(); string result = CreateNote(0); ltrTree.Text = @"<ul>" + result + @"<ul>"; ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('success')", true); List <Tree> parent = Trees.Where(x => x.ParentId == 0).ToList(); foreach (Tree item in parent) { TreeNode node = new TreeNode(item.Name, item.Id.ToString()); tvTree.Nodes.Add(node); AddChildNode(ref node); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { LearningDataContext db = new LearningDataContext(); GridView1.DataSource = db.v_UserLineMessageLogs.OrderByDescending(x => x.Id); GridView1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { LearningDataContext db = new LearningDataContext(); gvTree.DataSource = db.Trees; gvTree.DataBind(); } }
protected void Submit_Click(object sender, EventArgs e) { try { LearningDataContext db = new LearningDataContext(); string userId = hdnUserIdProfileField.Value; string displayName = hdnDisplayNameField.Value; string profilePicture = hdnProfilePictureDiv.Value; string statusMessage = hdnStatusMessageField.Value; var found = db.LineUsers.SingleOrDefault(x => x.LineUserId == userId); if (found == null) { db.LineUsers.InsertOnSubmit(new LineUser { LineUserId = userId, DisplayName = displayName, ProfilePicture = profilePicture, StatusMessage = statusMessage, MobileNo = txtMobileNo.Text, CreateDate = DateTime.Now }); } else { if (found.DisplayName != displayName || found.ProfilePicture != profilePicture || found.StatusMessage != statusMessage || found.MobileNo != txtMobileNo.Text) { found.DisplayName = displayName; found.ProfilePicture = profilePicture; found.StatusMessage = statusMessage; found.MobileNo = txtMobileNo.Text; found.ModifyDate = DateTime.Now; } } db.SubmitChanges(); G.Alert(this, "Success"); var script = @"liff.init({liffId: ""1614834775-a0mOA8vd""}).then(() => {liff.closeWindow();});"; Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", script, true); } catch (Exception ex) { G.Alert(this, ex.Message); } }