/*=============================== * Display Record Form * -------------------------------*/ void Order_Show() { // Order Show begin bool ActionInsert = true; if (p_Order_order_id.Value.Length > 0) { string sWhere = ""; sWhere += "order_id=" + CCUtility.ToSQL(p_Order_order_id.Value, FieldTypes.Number); // Order Open Event begin // Order Open Event end string sSQL = "select * from orders where " + sWhere; OleDbDataAdapter dsCommand = new OleDbDataAdapter(sSQL, Utility.Connection); DataSet ds = new DataSet(); DataRow row; if (dsCommand.Fill(ds, 0, 1, "Order") > 0) { row = ds.Tables[0].Rows[0]; Order_order_id.Value = CCUtility.GetValue(row, "order_id"); Order_quantity.Text = CCUtility.GetValue(row, "quantity"); Order_item_id.Value = CCUtility.GetValue(row, "item_id"); Order_insert.Visible = false; ActionInsert = false; // Order ShowEdit Event begin // Order ShowEdit Event end } } if (ActionInsert) { String pValue; pValue = Utility.GetParam("item_id"); Order_item_id.Value = pValue; // Order ShowInsert Event begin // Order ShowInsert Event end } // Order Open Event begin // Order Open Event end // Order Show Event begin // Order Show Event end // Order Show end // Order Close Event begin // Order Close Event end }
/*=============================== * Display Record Form * -------------------------------*/ void Categories_Show() { // Categories Show begin bool ActionInsert = true; if (p_Categories_category_id.Value.Length > 0) { string sWhere = ""; sWhere += "category_id=" + CCUtility.ToSQL(p_Categories_category_id.Value, FieldTypes.Number); // Categories Open Event begin // Categories Open Event end string sSQL = "select * from categories where " + sWhere; OleDbDataAdapter dsCommand = new OleDbDataAdapter(sSQL, Utility.Connection); DataSet ds = new DataSet(); DataRow row; if (dsCommand.Fill(ds, 0, 1, "Categories") > 0) { row = ds.Tables[0].Rows[0]; Categories_category_id.Value = CCUtility.GetValue(row, "category_id"); Categories_name.Text = CCUtility.GetValue(row, "name"); Categories_insert.Visible = false; ActionInsert = false; // Categories ShowEdit Event begin // Categories ShowEdit Event end } } if (ActionInsert) { String pValue; pValue = Utility.GetParam("category_id"); Categories_category_id.Value = pValue; Categories_delete.Visible = false; Categories_update.Visible = false; // Categories ShowInsert Event begin // Categories ShowInsert Event end } // Categories Open Event begin // Categories Open Event end // Categories Show Event begin // Categories Show Event end // Categories Show end // Categories Close Event begin // Categories Close Event end }
/*=============================== * Display Record Form * -------------------------------*/ void ShoppingCartRecord_Show() { // ShoppingCartRecord Show begin bool ActionInsert = true; if (p_ShoppingCartRecord_order_id.Value.Length > 0) { string sWhere = ""; sWhere += "order_id=" + CCUtility.ToSQL(p_ShoppingCartRecord_order_id.Value, FieldTypes.Number); // ShoppingCartRecord Open Event begin // ShoppingCartRecord Open Event end string sSQL = "select * from orders where " + sWhere; OleDbDataAdapter dsCommand = new OleDbDataAdapter(sSQL, Utility.Connection); DataSet ds = new DataSet(); DataRow row; if (dsCommand.Fill(ds, 0, 1, "ShoppingCartRecord") > 0) { row = ds.Tables[0].Rows[0]; ShoppingCartRecord_order_id.Value = CCUtility.GetValue(row, "order_id"); ShoppingCartRecord_member_id.Value = CCUtility.GetValue(row, "member_id"); ShoppingCartRecord_item_id.Text = Server.HtmlEncode(Utility.Dlookup("items", "name", "item_id=" + CCUtility.ToSQL(CCUtility.GetValue(row, "item_id"), FieldTypes.Number)).ToString()); ShoppingCartRecord_quantity.Text = CCUtility.GetValue(row, "quantity"); ActionInsert = false; // ShoppingCartRecord ShowEdit Event begin // ShoppingCartRecord ShowEdit Event end } } if (ActionInsert) { String pValue; if (Session["UserID"] != null) { pValue = Session["UserID"].ToString(); } else { pValue = ""; } ShoppingCartRecord_member_id.Value = pValue; ShoppingCartRecord_delete.Visible = false; ShoppingCartRecord_update.Visible = false; // ShoppingCartRecord ShowInsert Event begin // ShoppingCartRecord ShowInsert Event end } // ShoppingCartRecord Open Event begin // ShoppingCartRecord Open Event end // ShoppingCartRecord Show Event begin // ShoppingCartRecord Show Event end // ShoppingCartRecord Show end // ShoppingCartRecord Close Event begin // ShoppingCartRecord Close Event end }
/*=============================== * Display Record Form * -------------------------------*/ void Orders_Show() { // Orders Show begin Utility.buildListBox(Orders_member_id.Items, "select member_id,member_login from members order by 2", "member_id", "member_login", null, ""); Utility.buildListBox(Orders_item_id.Items, "select item_id,name from items order by 2", "item_id", "name", null, ""); bool ActionInsert = true; if (p_Orders_order_id.Value.Length > 0) { string sWhere = ""; sWhere += "order_id=" + CCUtility.ToSQL(p_Orders_order_id.Value, FieldTypes.Number); // Orders Open Event begin // Orders Open Event end string sSQL = "select * from orders where " + sWhere; OleDbDataAdapter dsCommand = new OleDbDataAdapter(sSQL, Utility.Connection); DataSet ds = new DataSet(); DataRow row; if (dsCommand.Fill(ds, 0, 1, "Orders") > 0) { row = ds.Tables[0].Rows[0]; Orders_order_id.Text = Server.HtmlEncode(CCUtility.GetValue(row, "order_id").ToString()); { string s; s = CCUtility.GetValue(row, "member_id"); try { Orders_member_id.SelectedIndex = Orders_member_id.Items.IndexOf(Orders_member_id.Items.FindByValue(s)); }catch {} } { string s; s = CCUtility.GetValue(row, "item_id"); try { Orders_item_id.SelectedIndex = Orders_item_id.Items.IndexOf(Orders_item_id.Items.FindByValue(s)); }catch {} } Orders_quantity.Text = CCUtility.GetValue(row, "quantity"); Orders_insert.Visible = false; ActionInsert = false; // Orders ShowEdit Event begin // Orders ShowEdit Event end } } if (ActionInsert) { String pValue; pValue = Utility.GetParam("order_id"); Orders_order_id.Text = pValue; pValue = Utility.GetParam("member_id"); try { Orders_member_id.SelectedIndex = Orders_member_id.Items.IndexOf(Orders_member_id.Items.FindByValue(pValue)); }catch {} pValue = Utility.GetParam("item_id"); try { Orders_item_id.SelectedIndex = Orders_item_id.Items.IndexOf(Orders_item_id.Items.FindByValue(pValue)); }catch {} Orders_delete.Visible = false; Orders_update.Visible = false; // Orders ShowInsert Event begin // Orders ShowInsert Event end } // Orders Open Event begin // Orders Open Event end // Orders Show Event begin // Orders Show Event end // Orders Show end // Orders Close Event begin // Orders Close Event end }
/*=============================== * Display Record Form * -------------------------------*/ void editorials_Show() { // editorials Show begin Utility.buildListBox(editorials_editorial_cat_id.Items, "select editorial_cat_id,editorial_cat_name from editorial_categories order by 2", "editorial_cat_id", "editorial_cat_name", null, ""); Utility.buildListBox(editorials_item_id.Items, "select item_id,name from items order by 2", "item_id", "name", "", ""); bool ActionInsert = true; if (p_editorials_article_id.Value.Length > 0) { string sWhere = ""; sWhere += "article_id=" + CCUtility.ToSQL(p_editorials_article_id.Value, FieldTypes.Number); // editorials Open Event begin // editorials Open Event end string sSQL = "select * from editorials where " + sWhere; OleDbDataAdapter dsCommand = new OleDbDataAdapter(sSQL, Utility.Connection); DataSet ds = new DataSet(); DataRow row; if (dsCommand.Fill(ds, 0, 1, "editorials") > 0) { row = ds.Tables[0].Rows[0]; editorials_article_id.Value = CCUtility.GetValue(row, "article_id"); editorials_article_desc.Text = CCUtility.GetValue(row, "article_desc"); editorials_article_title.Text = CCUtility.GetValue(row, "article_title"); { string s; s = CCUtility.GetValue(row, "editorial_cat_id"); try { editorials_editorial_cat_id.SelectedIndex = editorials_editorial_cat_id.Items.IndexOf(editorials_editorial_cat_id.Items.FindByValue(s)); }catch {} } { string s; s = CCUtility.GetValue(row, "item_id"); try { editorials_item_id.SelectedIndex = editorials_item_id.Items.IndexOf(editorials_item_id.Items.FindByValue(s)); }catch {} } editorials_insert.Visible = false; ActionInsert = false; // editorials ShowEdit Event begin // editorials ShowEdit Event end } } if (ActionInsert) { String pValue; pValue = Utility.GetParam("article_id"); editorials_article_id.Value = pValue; editorials_delete.Visible = false; editorials_update.Visible = false; // editorials ShowInsert Event begin // editorials ShowInsert Event end } // editorials Open Event begin // editorials Open Event end // editorials Show Event begin // editorials Show Event end // editorials Show end // editorials Close Event begin // editorials Close Event end }
/*=============================== * Display Record Form * -------------------------------*/ void Book_Show() { // Book Show begin Utility.buildListBox(Book_category_id.Items, "select category_id,name from categories order by 2", "category_id", "name", null, ""); bool ActionInsert = true; if (p_Book_item_id.Value.Length > 0) { string sWhere = ""; sWhere += "item_id=" + CCUtility.ToSQL(p_Book_item_id.Value, FieldTypes.Number); // Book Open Event begin // Book Open Event end string sSQL = "select * from items where " + sWhere; OleDbDataAdapter dsCommand = new OleDbDataAdapter(sSQL, Utility.Connection); DataSet ds = new DataSet(); DataRow row; if (dsCommand.Fill(ds, 0, 1, "Book") > 0) { row = ds.Tables[0].Rows[0]; Book_item_id.Value = CCUtility.GetValue(row, "item_id"); Book_name.Text = CCUtility.GetValue(row, "name"); Book_author.Text = CCUtility.GetValue(row, "author"); { string s; s = CCUtility.GetValue(row, "category_id"); try { Book_category_id.SelectedIndex = Book_category_id.Items.IndexOf(Book_category_id.Items.FindByValue(s)); }catch {} } Book_price.Text = CCUtility.GetValue(row, "price"); Book_product_url.Text = CCUtility.GetValue(row, "product_url"); Book_image_url.Text = CCUtility.GetValue(row, "image_url"); Book_notes.Text = CCUtility.GetValue(row, "notes"); Book_is_recommended.Checked = CCUtility.GetValue(row, "is_recommended").ToLower().Equals("1".ToLower()); Book_insert.Visible = false; ActionInsert = false; // Book ShowEdit Event begin // Book ShowEdit Event end } } if (ActionInsert) { String pValue; pValue = Utility.GetParam("item_id"); Book_item_id.Value = pValue; pValue = Utility.GetParam("category_id"); try { Book_category_id.SelectedIndex = Book_category_id.Items.IndexOf(Book_category_id.Items.FindByValue(pValue)); }catch {} Book_delete.Visible = false; Book_update.Visible = false; // Book ShowInsert Event begin // Book ShowInsert Event end } // Book Open Event begin // Book Open Event end // Book Show Event begin // Book Show Event end // Book Show end // Book Close Event begin // Book Close Event end }
/*=============================== * Display Record Form * -------------------------------*/ void Record_Show() { // Record Show begin bool ActionInsert = true; if (p_Record_member_id.Value.Length > 0) { string sWhere = ""; sWhere += "member_id=" + CCUtility.ToSQL(p_Record_member_id.Value, FieldTypes.Number); // Record Open Event begin // Record Open Event end string sSQL = "select * from members where " + sWhere; OleDbDataAdapter dsCommand = new OleDbDataAdapter(sSQL, Utility.Connection); DataSet ds = new DataSet(); DataRow row; if (dsCommand.Fill(ds, 0, 1, "Record") > 0) { row = ds.Tables[0].Rows[0]; Record_member_id.Value = CCUtility.GetValue(row, "member_id"); Record_member_login.Text = Server.HtmlEncode(CCUtility.GetValue(row, "member_login").ToString()); Record_member_login.NavigateUrl = "MembersRecord.aspx" + "?" + "member_id=" + Server.UrlEncode(CCUtility.GetValue(row, "member_id").ToString()) + "&" + ""; Record_member_level.Text = Server.HtmlEncode(CCUtility.GetValue(row, "member_level").ToString()); Record_name.Text = Server.HtmlEncode(CCUtility.GetValue(row, "first_name").ToString()); Record_last_name.Text = Server.HtmlEncode(CCUtility.GetValue(row, "last_name").ToString()); Record_email.Text = Server.HtmlEncode(CCUtility.GetValue(row, "email").ToString()); Record_phone.Text = Server.HtmlEncode(CCUtility.GetValue(row, "phone").ToString()); Record_address.Text = Server.HtmlEncode(CCUtility.GetValue(row, "address").ToString()); Record_notes.Text = Server.HtmlEncode(CCUtility.GetValue(row, "notes").ToString()); ActionInsert = false; // Record ShowEdit Event begin // Record ShowEdit Event end } } if (ActionInsert) { // Record ShowInsert Event begin // Record ShowInsert Event end } // Record Open Event begin // Record Open Event end // Record Show Event begin // Record Show Event end // Record Show end // Record Close Event begin // Record Close Event end }
/*=============================== * Display Record Form * -------------------------------*/ void Rating_Show() { // Rating Show begin Utility.buildListBox(Rating_rating.Items, Rating_rating_lov, null, ""); bool ActionInsert = true; if (p_Rating_item_id.Value.Length > 0) { string sWhere = ""; sWhere += "item_id=" + CCUtility.ToSQL(p_Rating_item_id.Value, FieldTypes.Number); // Rating Open Event begin // Rating Open Event end string sSQL = "select * from items where " + sWhere; OleDbDataAdapter dsCommand = new OleDbDataAdapter(sSQL, Utility.Connection); DataSet ds = new DataSet(); DataRow row; if (dsCommand.Fill(ds, 0, 1, "Rating") > 0) { row = ds.Tables[0].Rows[0]; Rating_item_id.Value = CCUtility.GetValue(row, "item_id"); Rating_rating_view.Text = CCUtility.GetValue(row, "rating"); Rating_rating_count_view.Text = Server.HtmlEncode(CCUtility.GetValue(row, "rating_count").ToString()); { string s; s = CCUtility.GetValue(row, "rating"); try { Rating_rating.SelectedIndex = Rating_rating.Items.IndexOf(Rating_rating.Items.FindByValue(s)); }catch {} } Rating_rating_count.Value = CCUtility.GetValue(row, "rating_count"); ActionInsert = false; // Rating ShowEdit Event begin // Rating ShowEdit Event end } } if (ActionInsert) { String pValue; pValue = Utility.GetParam("item_id"); Rating_item_id.Value = pValue; Rating_update.Visible = false; // Rating ShowInsert Event begin // Rating ShowInsert Event end } // Rating Open Event begin // Rating Open Event end // Rating Show Event begin if (Int16.Parse(Rating_rating_view.Text) == 0) { Rating_rating_view.Text = "Not rated yet"; Rating_rating_count_view.Text = ""; } else { Rating_rating_view.Text = "<img src=images/" + System.Math.Round(Double.Parse(Rating_rating.SelectedItem.Value) / Double.Parse(Rating_rating_count.Value)) + "stars.gif>"; } // Rating Show Event end // Rating Show end // Rating Close Event begin // Rating Close Event end }
/*=============================== * Display Record Form * -------------------------------*/ void Detail_Show() { // Detail Show begin bool ActionInsert = true; if (p_Detail_item_id.Value.Length > 0) { string sWhere = ""; sWhere += "item_id=" + CCUtility.ToSQL(p_Detail_item_id.Value, FieldTypes.Number); // Detail Open Event begin // Detail Open Event end string sSQL = "select * from items where " + sWhere; OleDbDataAdapter dsCommand = new OleDbDataAdapter(sSQL, Utility.Connection); DataSet ds = new DataSet(); DataRow row; if (dsCommand.Fill(ds, 0, 1, "Detail") > 0) { row = ds.Tables[0].Rows[0]; Detail_item_id.Value = CCUtility.GetValue(row, "item_id"); Detail_name.Text = Server.HtmlEncode(CCUtility.GetValue(row, "name").ToString()); Detail_author.Text = Server.HtmlEncode(CCUtility.GetValue(row, "author").ToString()); Detail_category_id.Text = Server.HtmlEncode(Utility.Dlookup("categories", "name", "category_id=" + CCUtility.ToSQL(CCUtility.GetValue(row, "category_id"), FieldTypes.Number)).ToString()); Detail_price.Text = Server.HtmlEncode(CCUtility.GetValue(row, "price").ToString()); Detail_image_url.Text = CCUtility.GetValue(row, "image_url"); Detail_image_url.NavigateUrl = CCUtility.GetValue(row, "product_url") + ""; Detail_notes.Text = CCUtility.GetValue(row, "notes"); Detail_product_url.Text = Server.HtmlEncode(CCUtility.GetValue(row, "product_url").ToString()); Detail_product_url.NavigateUrl = CCUtility.GetValue(row, "product_url") + ""; ActionInsert = false; // Detail ShowEdit Event begin // Detail ShowEdit Event end } } if (ActionInsert) { String pValue; pValue = Utility.GetParam("item_id"); Detail_item_id.Value = pValue; // Detail ShowInsert Event begin // Detail ShowInsert Event end } // Detail Open Event begin // Detail Open Event end // Detail Show Event begin Detail_image_url.ImageUrl = Detail_image_url.Text; Detail_product_url.Text = "Review this book on Amazon.com"; // Detail Show Event end // Detail Show end // Detail Close Event begin // Detail Close Event end }
/*=============================== * Display Record Form * -------------------------------*/ void Members_Show() { // Members Show begin Utility.buildListBox(Members_member_level.Items, Members_member_level_lov, null, ""); Utility.buildListBox(Members_card_type_id.Items, "select card_type_id,name from card_types order by 2", "card_type_id", "name", "", ""); bool ActionInsert = true; if (p_Members_member_id.Value.Length > 0) { string sWhere = ""; sWhere += "member_id=" + CCUtility.ToSQL(p_Members_member_id.Value, FieldTypes.Number); // Members Open Event begin // Members Open Event end string sSQL = "select * from members where " + sWhere; OleDbDataAdapter dsCommand = new OleDbDataAdapter(sSQL, Utility.Connection); DataSet ds = new DataSet(); DataRow row; if (dsCommand.Fill(ds, 0, 1, "Members") > 0) { row = ds.Tables[0].Rows[0]; Members_member_id.Value = CCUtility.GetValue(row, "member_id"); Members_member_login.Text = CCUtility.GetValue(row, "member_login"); Members_member_password.Text = CCUtility.GetValue(row, "member_password"); { string s; s = CCUtility.GetValue(row, "member_level"); try { Members_member_level.SelectedIndex = Members_member_level.Items.IndexOf(Members_member_level.Items.FindByValue(s)); }catch {} } Members_name.Text = CCUtility.GetValue(row, "first_name"); Members_last_name.Text = CCUtility.GetValue(row, "last_name"); Members_email.Text = CCUtility.GetValue(row, "email"); Members_phone.Text = CCUtility.GetValue(row, "phone"); Members_address.Text = CCUtility.GetValue(row, "address"); Members_notes.Text = CCUtility.GetValue(row, "notes"); { string s; s = CCUtility.GetValue(row, "card_type_id"); try { Members_card_type_id.SelectedIndex = Members_card_type_id.Items.IndexOf(Members_card_type_id.Items.FindByValue(s)); }catch {} } Members_card_number.Text = CCUtility.GetValue(row, "card_number"); Members_insert.Visible = false; ActionInsert = false; // Members ShowEdit Event begin // Members ShowEdit Event end } } if (ActionInsert) { String pValue; pValue = Utility.GetParam("member_id"); Members_member_id.Value = pValue; pValue = Utility.GetParam("member_login"); Members_member_login.Text = pValue; Members_delete.Visible = false; Members_update.Visible = false; // Members ShowInsert Event begin // Members ShowInsert Event end } // Members Open Event begin // Members Open Event end // Members Show Event begin // Members Show Event end // Members Show end // Members Close Event begin // Members Close Event end }
/*=============================== * Display Record Form * -------------------------------*/ void Form_Show() { // Form Show begin Utility.buildListBox(Form_card_type_id.Items, "select card_type_id,name from card_types order by 2", "card_type_id", "name", "", ""); bool ActionInsert = true; if (p_Form_member_id.Value.Length > 0) { string sWhere = ""; sWhere += "member_id=" + CCUtility.ToSQL(p_Form_member_id.Value, FieldTypes.Number); // Form Open Event begin // Form Open Event end string sSQL = "select * from members where " + sWhere; OleDbDataAdapter dsCommand = new OleDbDataAdapter(sSQL, Utility.Connection); DataSet ds = new DataSet(); DataRow row; if (dsCommand.Fill(ds, 0, 1, "Form") > 0) { row = ds.Tables[0].Rows[0]; Form_member_id.Value = CCUtility.GetValue(row, "member_id"); Form_member_login.Text = Server.HtmlEncode(CCUtility.GetValue(row, "member_login").ToString()); Form_member_password.Text = CCUtility.GetValue(row, "member_password"); Form_name.Text = CCUtility.GetValue(row, "first_name"); Form_last_name.Text = CCUtility.GetValue(row, "last_name"); Form_email.Text = CCUtility.GetValue(row, "email"); Form_address.Text = CCUtility.GetValue(row, "address"); Form_phone.Text = CCUtility.GetValue(row, "phone"); Form_notes.Text = CCUtility.GetValue(row, "notes"); { string s; s = CCUtility.GetValue(row, "card_type_id"); try { Form_card_type_id.SelectedIndex = Form_card_type_id.Items.IndexOf(Form_card_type_id.Items.FindByValue(s)); }catch {} } Form_card_number.Text = CCUtility.GetValue(row, "card_number"); ActionInsert = false; // Form ShowEdit Event begin // Form ShowEdit Event end } } if (ActionInsert) { String pValue; if (Session["UserID"] != null) { pValue = Session["UserID"].ToString(); } else { pValue = ""; } Form_member_id.Value = pValue; Form_update.Visible = false; // Form ShowInsert Event begin // Form ShowInsert Event end } // Form Open Event begin // Form Open Event end // Form Show Event begin // Form Show Event end // Form Show end // Form Close Event begin // Form Close Event end }
/*=============================== * Display Record Form * -------------------------------*/ void Member_Show() { // Member Show begin bool ActionInsert = true; if (p_Member_member_id.Value.Length > 0) { string sWhere = ""; sWhere += "member_id=" + CCUtility.ToSQL(p_Member_member_id.Value, FieldTypes.Number); // Member Open Event begin // Member Open Event end string sSQL = "select * from members where " + sWhere; OleDbDataAdapter dsCommand = new OleDbDataAdapter(sSQL, Utility.Connection); DataSet ds = new DataSet(); DataRow row; if (dsCommand.Fill(ds, 0, 1, "Member") > 0) { row = ds.Tables[0].Rows[0]; Member_member_id.Value = CCUtility.GetValue(row, "member_id"); Member_member_login.Text = Server.HtmlEncode(CCUtility.GetValue(row, "member_login").ToString()); Member_member_login.NavigateUrl = "MyInfo.aspx" + "?" + ""; Member_name.Text = Server.HtmlEncode(CCUtility.GetValue(row, "first_name").ToString()); Member_last_name.Text = Server.HtmlEncode(CCUtility.GetValue(row, "last_name").ToString()); Member_address.Text = Server.HtmlEncode(CCUtility.GetValue(row, "address").ToString()); Member_email.Text = Server.HtmlEncode(CCUtility.GetValue(row, "email").ToString()); Member_phone.Text = Server.HtmlEncode(CCUtility.GetValue(row, "phone").ToString()); ActionInsert = false; // Member ShowEdit Event begin // Member ShowEdit Event end } } if (ActionInsert) { String pValue; if (Session["UserID"] != null) { pValue = Session["UserID"].ToString(); } else { pValue = ""; } Member_member_id.Value = pValue; // Member ShowInsert Event begin // Member ShowInsert Event end } // Member Open Event begin // Member Open Event end // Member Show Event begin // Member Show Event end // Member Show end // Member Close Event begin // Member Close Event end }