예제 #1
0
파일: MyInfo.cs 프로젝트: dnester/demo
//===============================
// MyInfo Show begin
        protected void Page_Load(object sender, EventArgs e)
        {
            Utility = new CCUtility(this);
            //===============================
// MyInfo Open Event begin
// MyInfo Open Event end
            //===============================

            //===============================
// MyInfo OpenAnyPage Event begin
// MyInfo OpenAnyPage Event end
            //===============================
            //
            //===============================
            // MyInfo PageSecurity begin
            Utility.CheckSecurity(1);
            // MyInfo PageSecurity end
            //===============================

            if (!IsPostBack)
            {
                if (Session["UserID"] != null)
                {
                    p_Form_member_id.Value = Session["UserID"].ToString();
                }
                else
                {
                    p_Form_member_id.Value = "";
                }
                Page_Show(sender, e);
            }
        }
예제 #2
0
파일: MembersInfo.cs 프로젝트: dnester/demo
//===============================
// MembersInfo Show begin
        protected void Page_Load(object sender, EventArgs e)
        {
            Utility = new CCUtility(this);
            //===============================
// MembersInfo Open Event begin
// MembersInfo Open Event end
            //===============================

            //===============================
// MembersInfo OpenAnyPage Event begin
// MembersInfo OpenAnyPage Event end
            //===============================
            //
            //===============================
            // MembersInfo PageSecurity begin
            Utility.CheckSecurity(2);
            // MembersInfo PageSecurity end
            //===============================

            if (!IsPostBack)
            {
                p_Record_member_id.Value = Utility.GetParam("member_id");
                p_Orders_order_id.Value  = Utility.GetParam("order_id"); Page_Show(sender, e);
            }
        }
예제 #3
0
//===============================
// ShoppingCart Show begin
        protected void Page_Load(object sender, EventArgs e)
        {
            Utility = new CCUtility(this);
            //===============================
// ShoppingCart Open Event begin
// ShoppingCart Open Event end
            //===============================

            //===============================
// ShoppingCart OpenAnyPage Event begin
// ShoppingCart OpenAnyPage Event end
            //===============================
            //
            //===============================
            // ShoppingCart PageSecurity begin
            Utility.CheckSecurity(1);
            // ShoppingCart PageSecurity end
            //===============================

            if (!IsPostBack)
            {
                p_Items_order_id.Value = Utility.GetParam("order_id");
                if (Session["UserID"] != null)
                {
                    p_Member_member_id.Value = Session["UserID"].ToString();
                }
                else
                {
                    p_Member_member_id.Value = "";
                }
                Page_Show(sender, e);
            }
        }
예제 #4
0
        bool ShoppingCartRecord_delete_Click(Object Src, EventArgs E)
        {
            string sWhere = "";

            if (p_ShoppingCartRecord_order_id.Value.Length > 0)
            {
                sWhere += "order_id=" + CCUtility.ToSQL(p_ShoppingCartRecord_order_id.Value, FieldTypes.Number);
            }

            string sSQL = "delete from orders where " + sWhere;

// ShoppingCartRecord Delete Event begin
// ShoppingCartRecord Delete Event end
            ShoppingCartRecord_BeforeSQLExecute(sSQL, "Delete");
            OleDbCommand cmd = new OleDbCommand(sSQL, Utility.Connection);

            try {
                cmd.ExecuteNonQuery();
            } catch (Exception e) {
                ShoppingCartRecord_ValidationSummary.Text   += e.Message;
                ShoppingCartRecord_ValidationSummary.Visible = true;
                return(false);
            }

// ShoppingCartRecord AfterDelete Event begin
// ShoppingCartRecord AfterDelete Event end
            return(true);
        }
예제 #5
0
파일: Login.cs 프로젝트: dnester/demo
//===============================
// Login Show begin
        protected void Page_Load(object sender, EventArgs e)
        {
            Utility = new CCUtility(this);
            //===============================
// Login Open Event begin
// Login Open Event end
            //===============================

            //===============================
// Login OpenAnyPage Event begin
// Login OpenAnyPage Event end
            //===============================
            //
            //===============================
            // Login PageSecurity begin
            // Login PageSecurity end
            //===============================
            if (Session["UserID"] != null && Int16.Parse(Session["UserID"].ToString()) > 0)
            {
                Login_logged = true;
            }

            if (!IsPostBack)
            {
                Page_Show(sender, e);
            }
        }
예제 #6
0
//===============================
// BookDetail Show begin
        protected void Page_Load(object sender, EventArgs e)
        {
            Utility = new CCUtility(this);
            //===============================
// BookDetail Open Event begin
// BookDetail Open Event end
            //===============================

            //===============================
// BookDetail OpenAnyPage Event begin
// BookDetail OpenAnyPage Event end
            //===============================
            //
            //===============================
            // BookDetail PageSecurity begin
            Utility.CheckSecurity(1);
            // BookDetail PageSecurity end
            //===============================

            if (!IsPostBack)
            {
                p_Detail_item_id.Value = Utility.GetParam("item_id");
                p_Order_order_id.Value = Utility.GetParam("order_id");
                p_Rating_item_id.Value = Utility.GetParam("item_id"); Page_Show(sender, e);
            }
        }
예제 #7
0
        bool Categories_delete_Click(Object Src, EventArgs E)
        {
            string sWhere = "";

            if (p_Categories_category_id.Value.Length > 0)
            {
                sWhere += "category_id=" + CCUtility.ToSQL(p_Categories_category_id.Value, FieldTypes.Number);
            }

            string sSQL = "delete from categories where " + sWhere;

// Categories Delete Event begin
// Categories Delete Event end
            Categories_BeforeSQLExecute(sSQL, "Delete");
            OleDbCommand cmd = new OleDbCommand(sSQL, Utility.Connection);

            try {
                cmd.ExecuteNonQuery();
            } catch (Exception e) {
                Categories_ValidationSummary.Text   += e.Message;
                Categories_ValidationSummary.Visible = true;
                return(false);
            }

// Categories AfterDelete Event begin
// Categories AfterDelete Event end
            return(true);
        }
예제 #8
0
//===============================
// MembersInfo Show begin
        protected void Page_Load(object sender, EventArgs e)
        {	
		Utility=new CCUtility(this);
		//===============================
// MembersInfo Open Event begin
// MembersInfo Open Event end
		//===============================
		
		//===============================
// MembersInfo OpenAnyPage Event begin
// MembersInfo OpenAnyPage Event end
		//===============================
		//
		//===============================
		// MembersInfo PageSecurity begin
		Utility.CheckSecurity(2);
		// MembersInfo PageSecurity end
		//===============================

		if (!IsPostBack){
			
			p_Record_member_id.Value = Utility.GetParam("member_id");
			p_Orders_order_id.Value = Utility.GetParam("order_id");Page_Show(sender, e);
		}
	}
예제 #9
0
//===============================
// MyInfo Show begin
        protected void Page_Load(object sender, EventArgs e)
        {	
		Utility=new CCUtility(this);
		//===============================
// MyInfo Open Event begin
// MyInfo Open Event end
		//===============================
		
		//===============================
// MyInfo OpenAnyPage Event begin
// MyInfo OpenAnyPage Event end
		//===============================
		//
		//===============================
		// MyInfo PageSecurity begin
		Utility.CheckSecurity(1);
		// MyInfo PageSecurity end
		//===============================

		if (!IsPostBack){
			
			if(Session["UserID"]!=null)
			p_Form_member_id.Value = Session["UserID"].ToString();
			else
			p_Form_member_id.Value="";
			Page_Show(sender, e);
		}
	}
예제 #10
0
//===============================
// ShoppingCart Show begin
        protected void Page_Load(object sender, EventArgs e)
        {	
		Utility=new CCUtility(this);
		//===============================
// ShoppingCart Open Event begin
// ShoppingCart Open Event end
		//===============================
		
		//===============================
// ShoppingCart OpenAnyPage Event begin
// ShoppingCart OpenAnyPage Event end
		//===============================
		//
		//===============================
		// ShoppingCart PageSecurity begin
		Utility.CheckSecurity(1);
		// ShoppingCart PageSecurity end
		//===============================

		if (!IsPostBack){
			
			p_Items_order_id.Value = Utility.GetParam("order_id");
			if(Session["UserID"]!=null)
			p_Member_member_id.Value = Session["UserID"].ToString();
			else
			p_Member_member_id.Value="";
			Page_Show(sender, e);
		}
	}
예제 #11
0
//===============================
// Default Show begin
        protected void Page_Load(object sender, EventArgs e)
        {
            Utility = new CCUtility(this);

            Utility = new CCUtility(this);
            Utility = new CCUtility(this);
            //===============================
// Default Open Event begin
// Default Open Event end
            //===============================

            //===============================
// Default OpenAnyPage Event begin
// Default OpenAnyPage Event end
            //===============================
            //
            //===============================
            // Default PageSecurity begin
            // Default PageSecurity end
            //===============================

            if (!IsPostBack)
            {
                Page_Show(sender, e);
            }
        }
예제 #12
0
//===============================
// BookDetail Show begin
        protected void Page_Load(object sender, EventArgs e)
        {	
		Utility=new CCUtility(this);
		//===============================
// BookDetail Open Event begin
// BookDetail Open Event end
		//===============================
		
		//===============================
// BookDetail OpenAnyPage Event begin
// BookDetail OpenAnyPage Event end
		//===============================
		//
		//===============================
		// BookDetail PageSecurity begin
		Utility.CheckSecurity(1);
		// BookDetail PageSecurity end
		//===============================

		if (!IsPostBack){
			
			p_Detail_item_id.Value = Utility.GetParam("item_id");
			p_Order_order_id.Value = Utility.GetParam("order_id");
			p_Rating_item_id.Value = Utility.GetParam("item_id");Page_Show(sender, e);
		}
	}
예제 #13
0
/*===============================
*  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
        }
예제 #14
0
        // Book Action begin

        bool Book_insert_Click(Object Src, EventArgs E)
        {
            string sSQL    = "";
            bool   bResult = Book_Validate();

// Book Check Event begin
// Book Check Event end

            string p2_name           = CCUtility.ToSQL(Utility.GetParam("Book_name"), FieldTypes.Text);
            string p2_author         = CCUtility.ToSQL(Utility.GetParam("Book_author"), FieldTypes.Text);
            string p2_category_id    = CCUtility.ToSQL(Utility.GetParam("Book_category_id"), FieldTypes.Number);
            string p2_price          = CCUtility.ToSQL(Utility.GetParam("Book_price"), FieldTypes.Number);
            string p2_product_url    = CCUtility.ToSQL(Utility.GetParam("Book_product_url"), FieldTypes.Text);
            string p2_image_url      = CCUtility.ToSQL(Utility.GetParam("Book_image_url"), FieldTypes.Text);
            string p2_notes          = CCUtility.ToSQL(Utility.GetParam("Book_notes"), FieldTypes.Text);
            string c1_is_recommended = CCUtility.getCheckBoxValue(Utility.GetParam("Book_is_recommended"), "1", "0", FieldTypes.Number);

// Book Insert Event begin
// Book Insert Event end


            if (bResult)
            {
                if (sSQL.Length == 0)
                {
                    sSQL = "insert into items (" +
                           "name," +
                           "author," +
                           "category_id," +
                           "price," +
                           "product_url," +
                           "image_url," +
                           "notes," +
                           "is_recommended)" +
                           " values (" +
                           p2_name + "," +
                           p2_author + "," +
                           p2_category_id + "," +
                           p2_price + "," +
                           p2_product_url + "," +
                           p2_image_url + "," +
                           p2_notes + "," +
                           c1_is_recommended + ")";
                }
                Book_BeforeSQLExecute(sSQL, "Insert");
                OleDbCommand cmd = new OleDbCommand(sSQL, Utility.Connection);
                try {
                    cmd.ExecuteNonQuery();
                } catch (Exception e) {
                    Book_ValidationSummary.Text   += e.Message;
                    Book_ValidationSummary.Visible = true;
                    return(false);
                }

// Book AfterInsert Event begin
// Book AfterInsert Event end
            }
            return(bResult);
        }
예제 #15
0
/*===============================
*  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
        }
예제 #16
0
파일: MyInfo.cs 프로젝트: dnester/demo
        bool Form_update_Click(Object Src, EventArgs E)
        {
            string sWhere = "";
            string sSQL   = "";

            bool bResult = Form_Validate();

            if (bResult)
            {
                if (p_Form_member_id.Value.Length > 0)
                {
                    sWhere = sWhere + "member_id=" + CCUtility.ToSQL(p_Form_member_id.Value, FieldTypes.Number);
                }

// Form Check Event begin
// Form Check Event end

                if (bResult)
                {
                    sSQL = "update members set " +
                           "[member_password]=" + CCUtility.ToSQL(Utility.GetParam("Form_member_password"), FieldTypes.Text) +
                           ",[first_name]=" + CCUtility.ToSQL(Utility.GetParam("Form_name"), FieldTypes.Text) +
                           ",[last_name]=" + CCUtility.ToSQL(Utility.GetParam("Form_last_name"), FieldTypes.Text) +
                           ",[email]=" + CCUtility.ToSQL(Utility.GetParam("Form_email"), FieldTypes.Text) +
                           ",[address]=" + CCUtility.ToSQL(Utility.GetParam("Form_address"), FieldTypes.Text) +
                           ",[phone]=" + CCUtility.ToSQL(Utility.GetParam("Form_phone"), FieldTypes.Text) +
                           ",[notes]=" + CCUtility.ToSQL(Utility.GetParam("Form_notes"), FieldTypes.Text) +
                           ",[card_type_id]=" + CCUtility.ToSQL(Utility.GetParam("Form_card_type_id"), FieldTypes.Number) +
                           ",[card_number]=" + CCUtility.ToSQL(Utility.GetParam("Form_card_number"), FieldTypes.Text);


                    sSQL = sSQL + " where " + sWhere;

// Form Update Event begin
// Form Update Event end
                    Form_BeforeSQLExecute(sSQL, "Update");
                    OleDbCommand cmd = new OleDbCommand(sSQL, Utility.Connection);
                    try {
                        cmd.ExecuteNonQuery();
                    } catch (Exception e) {
                        Form_ValidationSummary.Text   += e.Message;
                        Form_ValidationSummary.Visible = true;
                        return(false);
                    }
                }

                if (bResult)
                {
// Form AfterUpdate Event begin
// Form AfterUpdate Event end
                }
            }
            return(bResult);
        }
예제 #17
0
        bool Book_update_Click(Object Src, EventArgs E)
        {
            string sWhere = "";
            string sSQL   = "";

            bool bResult = Book_Validate();

            if (bResult)
            {
                if (p_Book_item_id.Value.Length > 0)
                {
                    sWhere = sWhere + "item_id=" + CCUtility.ToSQL(p_Book_item_id.Value, FieldTypes.Number);
                }

// Book Check Event begin
// Book Check Event end

                if (bResult)
                {
                    sSQL = "update items set " +
                           "[name]=" + CCUtility.ToSQL(Utility.GetParam("Book_name"), FieldTypes.Text) +
                           ",[author]=" + CCUtility.ToSQL(Utility.GetParam("Book_author"), FieldTypes.Text) +
                           ",[category_id]=" + CCUtility.ToSQL(Utility.GetParam("Book_category_id"), FieldTypes.Number) +
                           ",[price]=" + CCUtility.ToSQL(Utility.GetParam("Book_price"), FieldTypes.Number) +
                           ",[product_url]=" + CCUtility.ToSQL(Utility.GetParam("Book_product_url"), FieldTypes.Text) +
                           ",[image_url]=" + CCUtility.ToSQL(Utility.GetParam("Book_image_url"), FieldTypes.Text) +
                           ",[notes]=" + CCUtility.ToSQL(Utility.GetParam("Book_notes"), FieldTypes.Text) +
                           ",[is_recommended]=" + CCUtility.getCheckBoxValue(Utility.GetParam("Book_is_recommended"), "1", "0", FieldTypes.Number);


                    sSQL = sSQL + " where " + sWhere;

// Book Update Event begin
// Book Update Event end
                    Book_BeforeSQLExecute(sSQL, "Update");
                    OleDbCommand cmd = new OleDbCommand(sSQL, Utility.Connection);
                    try {
                        cmd.ExecuteNonQuery();
                    } catch (Exception e) {
                        Book_ValidationSummary.Text   += e.Message;
                        Book_ValidationSummary.Visible = true;
                        return(false);
                    }
                }

                if (bResult)
                {
// Book AfterUpdate Event begin
// Book AfterUpdate Event end
                }
            }
            return(bResult);
        }
예제 #18
0
        bool editorials_update_Click(Object Src, EventArgs E)
        {
            string sWhere = "";
            string sSQL   = "";

            bool bResult = editorials_Validate();

            if (bResult)
            {
                if (p_editorials_article_id.Value.Length > 0)
                {
                    sWhere = sWhere + "article_id=" + CCUtility.ToSQL(p_editorials_article_id.Value, FieldTypes.Number);
                }

// editorials Check Event begin
// editorials Check Event end

                if (bResult)
                {
                    sSQL = "update editorials set " +
                           "[article_desc]=" + CCUtility.ToSQL(Utility.GetParam("editorials_article_desc"), FieldTypes.Text) +
                           ",[article_title]=" + CCUtility.ToSQL(Utility.GetParam("editorials_article_title"), FieldTypes.Text) +
                           ",[editorial_cat_id]=" + CCUtility.ToSQL(Utility.GetParam("editorials_editorial_cat_id"), FieldTypes.Number) +
                           ",[item_id]=" + CCUtility.ToSQL(Utility.GetParam("editorials_item_id"), FieldTypes.Number);


                    sSQL = sSQL + " where " + sWhere;

// editorials Update Event begin
// editorials Update Event end
                    editorials_BeforeSQLExecute(sSQL, "Update");
                    OleDbCommand cmd = new OleDbCommand(sSQL, Utility.Connection);
                    try {
                        cmd.ExecuteNonQuery();
                    } catch (Exception e) {
                        editorials_ValidationSummary.Text   += e.Message;
                        editorials_ValidationSummary.Visible = true;
                        return(false);
                    }
                }

                if (bResult)
                {
// editorials AfterUpdate Event begin
// editorials AfterUpdate Event end
                }
            }
            return(bResult);
        }
예제 #19
0
        bool Rating_update_Click(Object Src, EventArgs E)
        {
            string sWhere = "";
            string sSQL   = "";

            bool bResult = Rating_Validate();

            if (bResult)
            {
                if (p_Rating_item_id.Value.Length > 0)
                {
                    sWhere = sWhere + "item_id=" + CCUtility.ToSQL(p_Rating_item_id.Value, FieldTypes.Number);
                }

// Rating Check Event begin
// Rating Check Event end

                if (bResult)
                {
                    sSQL = "update items set " +
                           "[rating]=" + CCUtility.ToSQL(Utility.GetParam("Rating_rating"), FieldTypes.Number) +
                           ",[rating_count]=" + CCUtility.ToSQL(Utility.GetParam("Rating_rating_count"), FieldTypes.Number);


                    sSQL = sSQL + " where " + sWhere;

// Rating Update Event begin
                    sSQL = "update items set rating=rating+" + Rating_rating.SelectedItem.Value + ", rating_count=rating_count+1 where item_id=" + Rating_item_id.Value;
// Rating Update Event end
                    Rating_BeforeSQLExecute(sSQL, "Update");
                    OleDbCommand cmd = new OleDbCommand(sSQL, Utility.Connection);
                    try {
                        cmd.ExecuteNonQuery();
                    } catch (Exception e) {
                        Rating_ValidationSummary.Text   += e.Message;
                        Rating_ValidationSummary.Visible = true;
                        return(false);
                    }
                }

                if (bResult)
                {
// Rating AfterUpdate Event begin
// Rating AfterUpdate Event end
                }
            }
            return(bResult);
        }
        bool Orders_update_Click(Object Src, EventArgs E)
        {
            string sWhere = "";
            string sSQL   = "";

            bool bResult = Orders_Validate();

            if (bResult)
            {
                if (p_Orders_order_id.Value.Length > 0)
                {
                    sWhere = sWhere + "order_id=" + CCUtility.ToSQL(p_Orders_order_id.Value, FieldTypes.Number);
                }

// Orders Check Event begin
// Orders Check Event end

                if (bResult)
                {
                    sSQL = "update orders set " +
                           "[member_id]=" + CCUtility.ToSQL(Utility.GetParam("Orders_member_id"), FieldTypes.Number) +
                           ",[item_id]=" + CCUtility.ToSQL(Utility.GetParam("Orders_item_id"), FieldTypes.Number) +
                           ",[quantity]=" + CCUtility.ToSQL(Utility.GetParam("Orders_quantity"), FieldTypes.Number);


                    sSQL = sSQL + " where " + sWhere;

// Orders Update Event begin
// Orders Update Event end
                    Orders_BeforeSQLExecute(sSQL, "Update");
                    OleDbCommand cmd = new OleDbCommand(sSQL, Utility.Connection);
                    try {
                        cmd.ExecuteNonQuery();
                    } catch (Exception e) {
                        Orders_ValidationSummary.Text   += e.Message;
                        Orders_ValidationSummary.Visible = true;
                        return(false);
                    }
                }

                if (bResult)
                {
// Orders AfterUpdate Event begin
// Orders AfterUpdate Event end
                }
            }
            return(bResult);
        }
예제 #21
0
        // editorials Action begin

        bool editorials_insert_Click(Object Src, EventArgs E)
        {
            string sSQL    = "";
            bool   bResult = editorials_Validate();

// editorials Check Event begin
// editorials Check Event end

            string p2_article_desc     = CCUtility.ToSQL(Utility.GetParam("editorials_article_desc"), FieldTypes.Text);
            string p2_article_title    = CCUtility.ToSQL(Utility.GetParam("editorials_article_title"), FieldTypes.Text);
            string p2_editorial_cat_id = CCUtility.ToSQL(Utility.GetParam("editorials_editorial_cat_id"), FieldTypes.Number);
            string p2_item_id          = CCUtility.ToSQL(Utility.GetParam("editorials_item_id"), FieldTypes.Number);

// editorials Insert Event begin
// editorials Insert Event end


            if (bResult)
            {
                if (sSQL.Length == 0)
                {
                    sSQL = "insert into editorials (" +
                           "article_desc," +
                           "article_title," +
                           "editorial_cat_id," +
                           "item_id)" +
                           " values (" +
                           p2_article_desc + "," +
                           p2_article_title + "," +
                           p2_editorial_cat_id + "," +
                           p2_item_id + ")";
                }
                editorials_BeforeSQLExecute(sSQL, "Insert");
                OleDbCommand cmd = new OleDbCommand(sSQL, Utility.Connection);
                try {
                    cmd.ExecuteNonQuery();
                } catch (Exception e) {
                    editorials_ValidationSummary.Text   += e.Message;
                    editorials_ValidationSummary.Visible = true;
                    return(false);
                }

// editorials AfterInsert Event begin
// editorials AfterInsert Event end
            }
            return(bResult);
        }
예제 #22
0
        bool Categories_update_Click(Object Src, EventArgs E)
        {
            string sWhere = "";
            string sSQL   = "";

            bool bResult = Categories_Validate();

            if (bResult)
            {
                if (p_Categories_category_id.Value.Length > 0)
                {
                    sWhere = sWhere + "category_id=" + CCUtility.ToSQL(p_Categories_category_id.Value, FieldTypes.Number);
                }

// Categories Check Event begin
// Categories Check Event end

                if (bResult)
                {
                    sSQL = "update categories set " +
                           "[name]=" + CCUtility.ToSQL(Utility.GetParam("Categories_name"), FieldTypes.Text);


                    sSQL = sSQL + " where " + sWhere;

// Categories Update Event begin
// Categories Update Event end
                    Categories_BeforeSQLExecute(sSQL, "Update");
                    OleDbCommand cmd = new OleDbCommand(sSQL, Utility.Connection);
                    try {
                        cmd.ExecuteNonQuery();
                    } catch (Exception e) {
                        Categories_ValidationSummary.Text   += e.Message;
                        Categories_ValidationSummary.Visible = true;
                        return(false);
                    }
                }

                if (bResult)
                {
// Categories AfterUpdate Event begin
// Categories AfterUpdate Event end
                }
            }
            return(bResult);
        }
        // Orders Action begin

        bool Orders_insert_Click(Object Src, EventArgs E)
        {
            string sSQL    = "";
            bool   bResult = Orders_Validate();

// Orders Check Event begin
// Orders Check Event end

            string p2_member_id = CCUtility.ToSQL(Utility.GetParam("Orders_member_id"), FieldTypes.Number);
            string p2_item_id   = CCUtility.ToSQL(Utility.GetParam("Orders_item_id"), FieldTypes.Number);
            string p2_quantity  = CCUtility.ToSQL(Utility.GetParam("Orders_quantity"), FieldTypes.Number);

// Orders Insert Event begin
// Orders Insert Event end


            if (bResult)
            {
                if (sSQL.Length == 0)
                {
                    sSQL = "insert into orders (" +
                           "member_id," +
                           "item_id," +
                           "quantity)" +
                           " values (" +
                           p2_member_id + "," +
                           p2_item_id + "," +
                           p2_quantity + ")";
                }
                Orders_BeforeSQLExecute(sSQL, "Insert");
                OleDbCommand cmd = new OleDbCommand(sSQL, Utility.Connection);
                try {
                    cmd.ExecuteNonQuery();
                } catch (Exception e) {
                    Orders_ValidationSummary.Text   += e.Message;
                    Orders_ValidationSummary.Visible = true;
                    return(false);
                }

// Orders AfterInsert Event begin
// Orders AfterInsert Event end
            }
            return(bResult);
        }
예제 #24
0
//===============================
// Header Show begin
        protected void Page_Load(object sender, EventArgs e)
        {	
		Utility=new CCUtility(this);
		//===============================
// Header Open Event begin
// Header Open Event end
		//===============================
		
		//===============================
// Header OpenAnyPage Event begin
// Header OpenAnyPage Event end
		//===============================
		//
		//===============================
		// Header PageSecurity begin
		// Header PageSecurity end
		//===============================

		if (!IsPostBack){
			Page_Show(sender, e);
		}
	}
예제 #25
0
        // Categories Action begin

        bool Categories_insert_Click(Object Src, EventArgs E)
        {
            string sSQL    = "";
            bool   bResult = Categories_Validate();

// Categories Check Event begin
// Categories Check Event end

            string p2_name = CCUtility.ToSQL(Utility.GetParam("Categories_name"), FieldTypes.Text);

// Categories Insert Event begin
// Categories Insert Event end


            if (bResult)
            {
                if (sSQL.Length == 0)
                {
                    sSQL = "insert into categories (" +
                           "name)" +
                           " values (" +
                           p2_name + ")";
                }
                Categories_BeforeSQLExecute(sSQL, "Insert");
                OleDbCommand cmd = new OleDbCommand(sSQL, Utility.Connection);
                try {
                    cmd.ExecuteNonQuery();
                } catch (Exception e) {
                    Categories_ValidationSummary.Text   += e.Message;
                    Categories_ValidationSummary.Visible = true;
                    return(false);
                }

// Categories AfterInsert Event begin
// Categories AfterInsert Event end
            }
            return(bResult);
        }
예제 #26
0
//===============================
// CategoriesGrid Show begin
        protected void Page_Load(object sender, EventArgs e)
        {	
		Utility=new CCUtility(this);
		//===============================
// CategoriesGrid Open Event begin
// CategoriesGrid Open Event end
		//===============================
		
		//===============================
// CategoriesGrid OpenAnyPage Event begin
// CategoriesGrid OpenAnyPage Event end
		//===============================
		//
		//===============================
		// CategoriesGrid PageSecurity begin
		Utility.CheckSecurity(2);
		// CategoriesGrid PageSecurity end
		//===============================

		if (!IsPostBack){
			Page_Show(sender, e);
		}
	}
예제 #27
0
//===============================
// AdminMenu Show begin
        protected void Page_Load(object sender, EventArgs e)
        {	
		Utility=new CCUtility(this);
		//===============================
// AdminMenu Open Event begin
// AdminMenu Open Event end
		//===============================
		
		//===============================
// AdminMenu OpenAnyPage Event begin
// AdminMenu OpenAnyPage Event end
		//===============================
		//
		//===============================
		// AdminMenu PageSecurity begin
		Utility.CheckSecurity(2);
		// AdminMenu PageSecurity end
		//===============================

		if (!IsPostBack){
			Page_Show(sender, e);
		}
	}
예제 #28
0
//===============================
// Books Show begin
        protected void Page_Load(object sender, EventArgs e)
        {
            Utility = new CCUtility(this);
            //===============================
// Books Open Event begin
// Books Open Event end
            //===============================

            //===============================
// Books OpenAnyPage Event begin
// Books OpenAnyPage Event end
            //===============================
            //
            //===============================
            // Books PageSecurity begin
            // Books PageSecurity end
            //===============================

            if (!IsPostBack)
            {
                p_Total_item_id.Value = Utility.GetParam("item_id"); Page_Show(sender, e);
            }
        }
예제 #29
0
//===============================
// Books Show begin
        protected void Page_Load(object sender, EventArgs e)
        {	
		Utility=new CCUtility(this);
		//===============================
// Books Open Event begin
// Books Open Event end
		//===============================
		
		//===============================
// Books OpenAnyPage Event begin
// Books OpenAnyPage Event end
		//===============================
		//
		//===============================
		// Books PageSecurity begin
		// Books PageSecurity end
		//===============================

		if (!IsPostBack){
			
			p_Total_item_id.Value = Utility.GetParam("item_id");Page_Show(sender, e);
		}
	}
예제 #30
0
파일: Login.cs 프로젝트: oritlieb/test1
        //===============================
        // Login Show begin
        protected void Page_Load(object sender, EventArgs e)
        {
            Utility=new CCUtility(this);
            //===============================
            // Login Open Event begin
            // Login Open Event end
            //===============================

            //===============================
            // Login OpenAnyPage Event begin
            // Login OpenAnyPage Event end
            //===============================
            //
            //===============================
            // Login PageSecurity begin
            // Login PageSecurity end
            //===============================
            if (Session["UserID"] != null && Int16.Parse(Session["UserID"].ToString()) > 0)
            Login_logged = true;

            if (!IsPostBack){
            Page_Show(sender, e);
            }
        }
예제 #31
0
//===============================
// EditorialsGrid Show begin
        protected void Page_Load(object sender, EventArgs e)
        {
            Utility = new CCUtility(this);
            //===============================
// EditorialsGrid Open Event begin
// EditorialsGrid Open Event end
            //===============================

            //===============================
// EditorialsGrid OpenAnyPage Event begin
// EditorialsGrid OpenAnyPage Event end
            //===============================
            //
            //===============================
            // EditorialsGrid PageSecurity begin
            Utility.CheckSecurity(2);
            // EditorialsGrid PageSecurity end
            //===============================

            if (!IsPostBack)
            {
                p_editorials_article_id.Value = Utility.GetParam("article_id"); Page_Show(sender, e);
            }
        }
예제 #32
0
//===============================
// EditorialsGrid Show begin
        protected void Page_Load(object sender, EventArgs e)
        {	
		Utility=new CCUtility(this);
		//===============================
// EditorialsGrid Open Event begin
// EditorialsGrid Open Event end
		//===============================
		
		//===============================
// EditorialsGrid OpenAnyPage Event begin
// EditorialsGrid OpenAnyPage Event end
		//===============================
		//
		//===============================
		// EditorialsGrid PageSecurity begin
		Utility.CheckSecurity(2);
		// EditorialsGrid PageSecurity end
		//===============================

		if (!IsPostBack){
			
			p_editorials_article_id.Value = Utility.GetParam("article_id");Page_Show(sender, e);
		}
	}
예제 #33
0
//===============================
// ShoppingCartRecord Show begin
        protected void Page_Load(object sender, EventArgs e)
        {	
		Utility=new CCUtility(this);
		//===============================
// ShoppingCartRecord Open Event begin
// ShoppingCartRecord Open Event end
		//===============================
		
		//===============================
// ShoppingCartRecord OpenAnyPage Event begin
// ShoppingCartRecord OpenAnyPage Event end
		//===============================
		//
		//===============================
		// ShoppingCartRecord PageSecurity begin
		Utility.CheckSecurity(1);
		// ShoppingCartRecord PageSecurity end
		//===============================

		if (!IsPostBack){
			
			p_ShoppingCartRecord_order_id.Value = Utility.GetParam("order_id");Page_Show(sender, e);
		}
	}
예제 #34
0
//===============================
// ShoppingCartRecord Show begin
        protected void Page_Load(object sender, EventArgs e)
        {
            Utility = new CCUtility(this);
            //===============================
// ShoppingCartRecord Open Event begin
// ShoppingCartRecord Open Event end
            //===============================

            //===============================
// ShoppingCartRecord OpenAnyPage Event begin
// ShoppingCartRecord OpenAnyPage Event end
            //===============================
            //
            //===============================
            // ShoppingCartRecord PageSecurity begin
            Utility.CheckSecurity(1);
            // ShoppingCartRecord PageSecurity end
            //===============================

            if (!IsPostBack)
            {
                p_ShoppingCartRecord_order_id.Value = Utility.GetParam("order_id"); Page_Show(sender, e);
            }
        }
예제 #35
0
//===============================
// CategoriesRecord Show begin
        protected void Page_Load(object sender, EventArgs e)
        {
            Utility = new CCUtility(this);
            //===============================
// CategoriesRecord Open Event begin
// CategoriesRecord Open Event end
            //===============================

            //===============================
// CategoriesRecord OpenAnyPage Event begin
// CategoriesRecord OpenAnyPage Event end
            //===============================
            //
            //===============================
            // CategoriesRecord PageSecurity begin
            Utility.CheckSecurity(2);
            // CategoriesRecord PageSecurity end
            //===============================

            if (!IsPostBack)
            {
                p_Categories_category_id.Value = Utility.GetParam("category_id"); Page_Show(sender, e);
            }
        }
예제 #36
0
//===============================
// CardTypesRecord Show begin
        protected void Page_Load(object sender, EventArgs e)
        {	
		Utility=new CCUtility(this);
		//===============================
// CardTypesRecord Open Event begin
// CardTypesRecord Open Event end
		//===============================
		
		//===============================
// CardTypesRecord OpenAnyPage Event begin
// CardTypesRecord OpenAnyPage Event end
		//===============================
		//
		//===============================
		// CardTypesRecord PageSecurity begin
		Utility.CheckSecurity(2);
		// CardTypesRecord PageSecurity end
		//===============================

		if (!IsPostBack){
			
			p_CardTypes_card_type_id.Value = Utility.GetParam("card_type_id");Page_Show(sender, e);
		}
	}
예제 #37
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
        }
예제 #38
0
/*===============================
*  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
        }
예제 #39
0
        ICollection Items_CreateDataSource()
        {
            // Items Show begin
            Items_sSQL      = "";
            Items_sCountSQL = "";

            string sWhere = "", sOrder = "";


            bool HasParam = false;


            //-------------------------------
            // Build ORDER BY statement
            //-------------------------------
            if (Utility.GetParam("FormItems_Sorting").Length > 0 && !IsPostBack)
            {
                ViewState["SortColumn"] = Utility.GetParam("FormItems_Sorting");
                ViewState["SortDir"]    = "ASC";
            }
            if (ViewState["SortColumn"] != null)
            {
                sOrder = "";
            }

            //-------------------------------
            // Build WHERE statement
            //-------------------------------
            System.Collections.Specialized.StringDictionary Params = new System.Collections.Specialized.StringDictionary();


            if (!Params.ContainsKey("category_id"))
            {
                string temp = Utility.GetParam("category_id");
                if (Utility.IsNumeric(null, temp) && temp.Length > 0)
                {
                    temp = CCUtility.ToSQL(temp, FieldTypes.Number);
                }
                else
                {
                    temp = "";
                }
                Params.Add("category_id", temp);
            }

            if (!Params.ContainsKey("is_recommended"))
            {
                string temp = Utility.GetParam("is_recommended");
                if (Utility.IsNumeric(null, temp) && temp.Length > 0)
                {
                    temp = CCUtility.ToSQL(temp, FieldTypes.Number);
                }
                else
                {
                    temp = "";
                }
                Params.Add("is_recommended", temp);
            }

            if (Params["category_id"].Length > 0)
            {
                HasParam = true;
                sWhere  += "i.[category_id]=" + Params["category_id"];
            }
            if (Params["is_recommended"].Length > 0)
            {
                if (sWhere.Length > 0)
                {
                    sWhere += " and ";
                }
                HasParam = true;
                sWhere  += "i.[is_recommended]=" + Params["is_recommended"];
            }


            if (HasParam)
            {
                sWhere = " AND (" + sWhere + ")";
            }

            //-------------------------------
            // Build base SQL statement
            //-------------------------------


            Items_sSQL = "select [i].[author] as i_author, " +
                         "[i].[category_id] as i_category_id, " +
                         "[i].[is_recommended] as i_is_recommended, " +
                         "[i].[item_id] as i_item_id, " +
                         "[i].[name] as i_name, " +
                         "[i].[price] as i_price, " +
                         "[c].[category_id] as c_category_id, " +
                         "[c].[name] as c_name " +
                         " from [items] i, [categories] c" +
                         " where [c].[category_id]=i.[category_id]  ";

            //-------------------------------
            //-------------------------------


            //-------------------------------

            //-------------------------------
            // Assemble full SQL statement
            //-------------------------------



            Items_sSQL = Items_sSQL + sWhere + sOrder;
            if (Items_sCountSQL.Length == 0)
            {
                int iTmpI = Items_sSQL.ToLower().IndexOf("select ");
                int iTmpJ = Items_sSQL.ToLower().LastIndexOf(" from ") - 1;
                Items_sCountSQL = Items_sSQL.Replace(Items_sSQL.Substring(iTmpI + 7, iTmpJ - 6), " count(*) ");
                iTmpI           = Items_sCountSQL.ToLower().IndexOf(" order by");
                if (iTmpI > 1)
                {
                    Items_sCountSQL = Items_sCountSQL.Substring(0, iTmpI);
                }
            }


            //-------------------------------

            OleDbDataAdapter command = new OleDbDataAdapter(Items_sSQL, Utility.Connection);
            DataSet          ds      = new DataSet();

            command.Fill(ds, (i_Items_curpage - 1) * Items_PAGENUM, Items_PAGENUM, "Items");
            OleDbCommand ccommand = new OleDbCommand(Items_sCountSQL, Utility.Connection);
            int          PageTemp = (int)ccommand.ExecuteScalar();

            Items_Pager.MaxPage = (PageTemp % Items_PAGENUM) > 0?(int)(PageTemp / Items_PAGENUM) + 1:(int)(PageTemp / Items_PAGENUM);
            bool AllowScroller = Items_Pager.MaxPage == 1?false:true;

            DataView Source;

            Source = new DataView(ds.Tables[0]);

            if (ds.Tables[0].Rows.Count == 0)
            {
                Items_no_records.Visible = true;
                AllowScroller            = false;
            }
            else
            {
                Items_no_records.Visible = false;
                AllowScroller            = AllowScroller && true;
            }

            Items_Pager.Visible = AllowScroller;
            return(Source);
            // Items Show end
        }
예제 #40
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
        }
/*===============================
*  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
        }