コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Session["SaveSuccess"].ToString() == "1")
                {
                    Success.Text = "Element został dodany";
                }
            }
            catch
            {
            }
            Session["SaveSuccess"] = "0";
            ControlProject.CheckSession(this);
            ControlProject.VisibleMenu(true, this);
            Status.Text = "";



            if (!IsPostBack)
            {
                GetData();
            }
            ADOHelper helper = new ADOHelper("products_get");

            helper.AddParameter("@banner", 0);
            helper.AddParameter("@prod_quantity", -1);
            DataTable dt = helper.Execute();

            gvMessageInfo.DataSource = dt;
            gvMessageInfo.DataBind();
        }
コード例 #2
0
        private void SaveGroup(string tbxNazwa, int tbxPerm, int UserId)
        {
            ADOHelper helper = new ADOHelper("group_add");

            helper.AddParameter("@grou_name", tbxNazwa);
            helper.AddParameter("@grou_permissions", tbxPerm);
            helper.AddParameter("@grou_user_id", UserId);
            helper.ExecuteNonQuery();
        }
コード例 #3
0
        private void UpdateOrderStatus(int OrderId, int ddlStatuses, int IdUser)
        {
            ADOHelper helper = new ADOHelper("order_update");

            helper.AddParameter("@orde_id", OrderId);
            helper.AddParameter("@orde_stat_id", ddlStatuses);
            helper.AddParameter("@user_id", IdUser);
            helper.ExecuteNonQuery();
        }
コード例 #4
0
        private void UpdateOrderProductStatus(int OrderProductId, int status, int IdUser)
        {
            ADOHelper helper = new ADOHelper("order_product_update");

            helper.AddParameter("@orpr_id", OrderProductId);
            helper.AddParameter("@orpr_status", status);
            helper.AddParameter("@orpr_user_mod", IdUser);
            helper.ExecuteNonQuery();
        }
コード例 #5
0
ファイル: ControlProject.cs プロジェクト: Miilla/shopApp
        public static void SavePassword(string pass, int userID, int userModID)
        {
            ADOHelper helper = new ADOHelper("user_password_save");

            helper.AddParameter("@user_password", Decode.Encrypt(pass, CommonConst.MilaKey));
            helper.AddParameter("@user_id", userID);
            helper.AddParameter("@user_mod_id", userModID);
            helper.ExecuteNonQuery();
        }
コード例 #6
0
ファイル: AddOrder.aspx.cs プロジェクト: Miilla/shopApp
        private void SaveProductInOrder(string orderID, int IdProduktu, int IdUser)
        {
            ADOHelper helper = new ADOHelper("order_product_insert");

            helper.AddParameter("@orde_id", orderID);
            helper.AddParameter("@prod_id", IdProduktu);
            helper.AddParameter("@user_id", IdUser);
            helper.ExecuteNonQuery();
        }
コード例 #7
0
ファイル: AddOrder.aspx.cs プロジェクト: Miilla/shopApp
        private string SaveOrder(int ddlClient, int IdUser)
        {
            ADOHelper helper = new ADOHelper("order_insert");

            helper.AddParameter("@clie_id", ddlClient);
            helper.AddParameter("@user_id", IdUser);
            var a = helper.ExecuteScalar();

            return(a.ToString());
        }
コード例 #8
0
        private void GetData2()
        {
            ADOHelper helper = new ADOHelper("products_get");

            helper.AddParameter("@banner", 0);
            helper.AddParameter("@prod_quantity", -1);
            DataTable dt = helper.Execute();

            gvMessageInfo.DataSource = dt;
            gvMessageInfo.DataBind();
        }
コード例 #9
0
ファイル: AddClient.aspx.cs プロジェクト: Miilla/shopApp
        private string SaveUser(string tbxFname, string tbxLname, string tbxLogin, int IdUser)
        {
            ADOHelper helper = new ADOHelper("user_insert");

            helper.AddParameter("@user_grou_id", 6);
            helper.AddParameter("@user_fname", tbxFname);
            helper.AddParameter("@user_lname", tbxLname);
            helper.AddParameter("@user_login", tbxLogin);
            helper.AddParameter("@user_user_mod_id", IdUser);
            var a = helper.ExecuteScalar();

            return(a.ToString());
        }
コード例 #10
0
        protected void gvMessageInfo_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
        {
            lbtnData.BorderWidth     = 1;
            lbtnPassword.BorderWidth = 0;
            dData.Visible            = true;
            dPassword.Visible        = false;
            GridViewRow row = gvMessageInfo.Rows[e.NewSelectedIndex];

            pUser.Visible    = true;
            tbxImię.Text     = row.Cells[3].Text;
            tbxNazwisko.Text = row.Cells[4].Text;
            if (row.Cells[5].Text == "Tak")
            {
                cbActive.Checked = true;
            }
            else
            {
                cbActive.Checked = false;
            }
            tbxLogin.Text          = row.Cells[6].Text;
            ddlGroup.SelectedValue = row.Cells[2].Text;
            setSelectedRow(row.Cells[1].Text, row.Cells[6].Text);


            ADOHelper helper = new ADOHelper("user_history_get");

            helper.AddParameter("@user_id", row.Cells[1].Text);
            DataTable dt = helper.Execute();

            gvHistory.DataSource = dt;
            gvHistory.DataBind();

            ChangeColumns(sender);
        }
コード例 #11
0
ファイル: ChangeData.aspx.cs プロジェクト: Miilla/shopApp
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (int.Parse(Session["GroupID"].ToString()) > 5)
                {
                    aUsers.Visible  = false;
                    aGroups.Visible = false;
                }
                UserId = int.Parse(Session["IdUser"].ToString());
            }
            catch (Exception)
            {
                throw;
            }
            ADOHelper helper = new ADOHelper("client_get");

            helper.AddParameter("@user_id", UserId);
            DataTable dt = helper.Execute();

            if (!IsPostBack)
            {
                ControlProject.VisibleMenu(true, this);
                ControlProject.CheckSession(this);
                SetData(dt);
            }
        }
コード例 #12
0
ファイル: AddClient.aspx.cs プロジェクト: Miilla/shopApp
        private void SaveClient(string UserId, string dateTime, string ddlPlec, string tbxNip, string tbxStreet, string tbxHome, string tbxCity, string tbxZip, int IdUser)
        {
            ADOHelper helper = new ADOHelper("client_add");

            helper.AddParameter("@clie_user_id", UserId);
            helper.AddParameter("@clie_bdate", dateTime);
            helper.AddParameter("@clie_sex", ddlPlec);
            helper.AddParameter("@clie_saldo", 0);
            helper.AddParameter("@clie_nip", tbxNip);
            helper.AddParameter("@clie_street", tbxStreet);
            helper.AddParameter("@clie_home", tbxHome);
            helper.AddParameter("@clie_city", tbxCity);
            helper.AddParameter("@clie_zip", tbxZip);
            helper.AddParameter("@clie_user_mod_id", IdUser);
            helper.ExecuteNonQuery();
        }
コード例 #13
0
        private void SaveCategory(string tbxNazwa)
        {
            ADOHelper helper = new ADOHelper("category_add");

            helper.AddParameter("@cate_name", tbxNazwa);
            helper.ExecuteNonQuery();
        }
コード例 #14
0
        protected void gvProducts_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
        {
            ChangeColumns2(sender);
            ChangeColumnsHistory(gvHistory);
            GridViewRow row = gvProducts.Rows[e.NewSelectedIndex];

            dStatus.Visible = true;
            string value = ddlOrderStatus.Items.FindByText(row.Cells[7].Text).Value;

            ddlOrderStatus.SelectedValue = value;
            tbxProductName.Text          = row.Cells[4].Text;
            setSelectedRow2(row.Cells[1].Text);
            image.Width       = 200;
            image.Height      = 200;
            image.BorderColor = Color.Black;
            image.BorderWidth = 1;
            image.ImageUrl    = "~/Images/" + row.Cells[6].Text + ".jpg";


            ADOHelper helper = new ADOHelper("order_product_history_get");

            helper.AddParameter("@orpr_orde_id", row.Cells[2].Text);
            DataTable dt = helper.Execute();

            gvHistoryOrderProduct.DataSource = dt;
            gvHistoryOrderProduct.DataBind();
        }
コード例 #15
0
ファイル: AddOrder.aspx.cs プロジェクト: Miilla/shopApp
        protected void Page_Load(object sender, EventArgs e)
        {
            ADOHelper helper = new ADOHelper("categories_get");
            DataTable dt     = helper.Execute();

            if (!IsPostBack)
            {
                ddlCategories.DataTextField  = "cate_name";
                ddlCategories.DataValueField = "cate_id";
                ddlCategories.DataSource     = dt;
                ddlCategories.DataBind();

                helper = new ADOHelper("client_for_order_get");
                dt     = helper.Execute();
                ddlClient.DataTextField  = "name";
                ddlClient.DataValueField = "id";
                ddlClient.DataSource     = dt;
                ddlClient.DataBind();


                ControlProject.VisibleMenu(true, this);
                ControlProject.CheckSession(this);

                if (ViewState["Products"] == null)
                {
                    DataTable dtProducts = new DataTable();
                    dtProducts.Columns.AddRange(new DataColumn[3] {
                        new DataColumn("ProductId", typeof(int)),
                        new DataColumn("ProductName", typeof(string)), new DataColumn("ProductPrice", typeof(string))
                    });
                    //dtProducts.Columns["FruitId"].AutoIncrement = true;
                    //dtProducts.Columns["FruitId"].AutoIncrementSeed = 1;
                    //dtProducts.Columns["FruitId"].AutoIncrementStep = 1;
                    ViewState["Products"] = dtProducts;
                }
            }
            helper = new ADOHelper("products_get");
            helper.AddParameter("@banner", 1);
            helper.AddParameter("@prod_quantity", 0);
            dt = helper.Execute();
            gvMessageInfo.DataSource = dt;
            gvMessageInfo.DataBind();
            lbProducts.DataBind();
        }
コード例 #16
0
        private void UpdateProduct(int ProductId, string tbxNazwa, string tbxIlosc, decimal tbxPrice, bool cbBanner, string tbxOpis, string tbxPath, int ddlCategories, int IdUser)
        {
            ADOHelper helper = new ADOHelper("product_update");

            helper.AddParameter("@prod_id", ProductId);
            helper.AddParameter("@prod_name", tbxNazwa);
            helper.AddParameter("@prod_quantity", tbxIlosc);
            helper.AddParameter("@prod_price", tbxPrice);
            helper.AddParameter("@prod_banner", cbBanner);
            helper.AddParameter("@prod_desc", tbxOpis);
            helper.AddParameter("@prod_path", tbxPath);
            helper.AddParameter("@prod_cate_id", ddlCategories);
            helper.AddParameter("@prod_user_id", IdUser);
            helper.ExecuteNonQuery();
        }
コード例 #17
0
        private void GetOrders()
        {
            ADOHelper helper = new ADOHelper("orders_for_client_get");

            helper.AddParameter("@clie_id", 1);
            DataTable dt = helper.Execute();

            gvMessageInfo.DataSource = dt;
            gvMessageInfo.DataBind();
        }
コード例 #18
0
ファイル: StoreDashboard.aspx.cs プロジェクト: Miilla/shopApp
        private void GetLastOrders()
        {
            ADOHelper helper = new ADOHelper("orders_top5_get");

            helper.AddParameter("@status", 1);
            DataTable dt = helper.Execute();

            gvMessageInfo.DataSource = dt;
            gvMessageInfo.DataBind();
        }
コード例 #19
0
ファイル: PaymentsReport.aspx.cs プロジェクト: Miilla/shopApp
        private void GetData()
        {
            ADOHelper helper = new ADOHelper("payments_get");

            helper.AddParameter("@user_id", Session["IdUser"].ToString());
            DataTable dt = helper.Execute();

            gvMessageInfo.DataSource = dt;
            gvMessageInfo.DataBind();
        }
コード例 #20
0
        private void GetData()
        {
            ADOHelper helper = new ADOHelper("categories_get");
            DataTable dt     = helper.Execute();


            ddlCategories.DataTextField  = "cate_name";
            ddlCategories.DataValueField = "cate_id";
            ddlCategories.DataSource     = dt;
            ddlCategories.DataBind();
            Session["categories"] = dt;
            //dt.Columns.Remove("user_password");
            //dt.Columns.Remove("user_date_pass");
            helper = new ADOHelper("products_get");
            helper.AddParameter("@banner", 0);
            helper.AddParameter("@prod_quantity", 0);
            dt = helper.Execute();
            gvMessageInfo.DataSource = dt;
            gvMessageInfo.DataBind();
        }
コード例 #21
0
        private void setSelectedRow(string OrderId)
        {
            Session["OrderId"] = OrderId;
            ADOHelper helper = new ADOHelper("order_product_get");

            helper.AddParameter("@orpr_orde_id", OrderId);
            DataTable dt = helper.Execute();

            gvProducts.DataSource = dt;
            gvProducts.DataBind();
        }
コード例 #22
0
ファイル: ClientsReport.aspx.cs プロジェクト: Miilla/shopApp
        protected void gvMessageInfo_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
        {
            Success.Text = "";
            //lbtnData.BorderWidth = 1;
            //lbtnPassword.BorderWidth = 0;
            dData.Visible = true;
            GridViewRow row = gvMessageInfo.Rows[e.NewSelectedIndex];

            pClient.Visible  = true;
            tbxBDate.Text    = row.Cells[3].Text.Substring(0, 10);
            tbxImię.Text     = row.Cells[4].Text;
            tbxNazwisko.Text = row.Cells[5].Text;
            tbxSaldo.Text    = row.Cells[7].Text;
            tbxNip.Text      = row.Cells[8].Text;
            tbxStreet.Text   = row.Cells[9].Text;
            tbxHome.Text     = row.Cells[10].Text;
            tbxCity.Text     = row.Cells[11].Text;
            tbxZip.Text      = row.Cells[12].Text;
            //ddlPlec.SelectedValue = row.Cells[6].Text;
            if (row.Cells[6].Text == "Mężczyzna")
            {
                ddlPlec.SelectedValue = "m";
            }
            else
            {
                ddlPlec.SelectedValue = "k";
            }
            //tbxPath.Text = row.Cells[8].Text;
            //ddlCategories.SelectedItem.Text = row.Cells[4].Text;
            //setSelectedRow(row.Cells[1].Text);
            ddlGroup.SelectedValue = row.Cells[15].Text;
            cbActive.Checked       = row.Cells[16].Text == "1" ? true : false;
            tbxLogin.Text          = row.Cells[17].Text;
            Session["ClieId"]      = row.Cells[1].Text;
            ADOHelper helper = new ADOHelper("client_history_get");

            helper.AddParameter("@clie_id", row.Cells[1].Text);
            DataTable dt = helper.Execute();

            gvHistory.DataSource = dt;
            gvHistory.DataBind();
            SwitchDiv(true);

            helper = new ADOHelper("user_history_get");
            helper.AddParameter("@user_id", row.Cells[2].Text);
            dt = helper.Execute();
            gvHistoryUser.DataSource = dt;
            gvHistoryUser.DataBind();

            ChangeColumns(sender);
        }
コード例 #23
0
        private void SaveUserData(string tbxImię, string tbxLogin, string tbxNazwisko, bool cbActive, string ddlGroup, int UserIdtoChange, int UserId)
        {
            ADOHelper helper = new ADOHelper("user_data_save");

            helper.AddParameter("@user_fname", tbxImię);
            helper.AddParameter("@user_login", tbxLogin);
            helper.AddParameter("@user_lname", tbxNazwisko);
            helper.AddParameter("@user_active", cbActive ? 1 : 0);
            helper.AddParameter("@user_grou_id", ddlGroup);
            helper.AddParameter("@user_id", UserIdtoChange);
            helper.AddParameter("@user_user_mod", UserId);
            helper.ExecuteNonQuery();
        }
コード例 #24
0
        protected void gvMessageInfo_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
        {
            Success.Text = "";
            //lbtnData.BorderWidth = 1;
            //lbtnPassword.BorderWidth = 0;
            dData.Visible = true;
            //dPassword.Visible = false;
            GridViewRow row = gvMessageInfo.Rows[e.NewSelectedIndex];

            pProduct.Visible = true;
            tbxNazwa.Text    = row.Cells[2].Text;
            tbxIlosc.Text    = row.Cells[3].Text;
            tbxPrice.Text    = row.Cells[5].Text;
            tbxOpis.Text     = row.Cells[6].Text;
            if (row.Cells[7].Text == "1")
            {
                cbBanner.Checked = true;
            }
            else
            {
                cbBanner.Checked = false;
            }
            tbxPath.Text      = row.Cells[8].Text;
            image.Width       = 220;
            image.Height      = 200;
            image.BorderColor = Color.Black;
            image.BorderWidth = 1;
            image.ImageUrl    = "~/Images/" + row.Cells[8].Text + ".jpg";
            //tbxLogin.Text = row.Cells[6].Text;
            ddlCategories.SelectedItem.Text = row.Cells[4].Text;
            setSelectedRow(row.Cells[1].Text);


            ADOHelper helper = new ADOHelper("product_history_get");

            helper.AddParameter("@prod_id", row.Cells[1].Text);
            DataTable dt = helper.Execute();

            gvHistory.DataSource = dt;
            gvHistory.DataBind();

            ChangeColumns(sender);
        }
コード例 #25
0
        protected void gvMessageInfo_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
        {
            Success.Text             = "";
            lbtnData.BorderWidth     = 1;
            lbtnProducts.BorderWidth = 0;
            lbtnFaktura.BorderWidth  = 0;
            dData.Visible            = true;
            dProducts.Visible        = false;
            dDocuments.Visible       = false;
            GridViewRow row = gvMessageInfo.Rows[e.NewSelectedIndex];

            pProduct.Visible = true;
            tbxImie.Text     = row.Cells[4].Text;
            tbxNazwisko.Text = row.Cells[5].Text;
            tbxCity.Text     = row.Cells[6].Text;
            tbxZip.Text      = row.Cells[9].Text;
            // if (row.Cells[7].Text == "1") cbBanner.Checked = true;
            //else cbBanner.Checked = false;
            tbxStreet.Text = row.Cells[7].Text;
            tbxHome.Text   = row.Cells[8].Text;
            string value = ddlStatuses.Items.FindByText(row.Cells[10].Text).Value;

            ddlStatuses.SelectedValue = value;

            tbxDate.Text = row.Cells[11].Text;
            setSelectedRow(row.Cells[1].Text);

            ADOHelper helper = new ADOHelper("order_history_get");

            helper.AddParameter("@orde_id", row.Cells[1].Text);
            DataTable dt = helper.Execute();

            gvHistory.DataSource = dt;
            gvHistory.DataBind();

            ChangeColumns(sender);
        }
コード例 #26
0
ファイル: ChangeData.aspx.cs プロジェクト: Miilla/shopApp
        private void UpdateClient(string tbxBDate, string tbxImię, string tbxNazwisko, string tbxNip, string tbxStreet, string tbxHome, string tbxCity, string tbxZip, string ddlPlec, int ClieId, int UserId)
        {
            ADOHelper helper = new ADOHelper("client_update");

            helper.AddParameter("@clie_id", ClieId);
            helper.AddParameter("@clie_bdate", tbxBDate);
            helper.AddParameter("@user_fname", tbxImię);
            helper.AddParameter("@user_lname", tbxNazwisko);
            helper.AddParameter("@clie_nip", tbxNip);
            helper.AddParameter("@clie_street", tbxStreet);
            helper.AddParameter("@clie_home", tbxHome);
            helper.AddParameter("@clie_city", tbxCity);
            helper.AddParameter("@clie_zip", tbxZip);
            helper.AddParameter("@clie_sex", ddlPlec);
            helper.AddParameter("@clie_user_id", UserId);
            helper.ExecuteNonQuery();
        }