/*===============================
*  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
        }
Beispiel #2
0
/*===============================
*  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
        }
Beispiel #3
0
/*===============================
*  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
        }
Beispiel #4
0
/*===============================
*  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
        }
Beispiel #5
0
/*===============================
*  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
        }
Beispiel #6
0
/*===============================
*  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
        }