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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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()); }
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(); }
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()); }
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); }
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); } }
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(); }
private void SaveCategory(string tbxNazwa) { ADOHelper helper = new ADOHelper("category_add"); helper.AddParameter("@cate_name", tbxNazwa); helper.ExecuteNonQuery(); }
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(); }
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(); }
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(); }
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(); }
private void GetLastOrders() { ADOHelper helper = new ADOHelper("orders_top5_get"); helper.AddParameter("@status", 1); DataTable dt = helper.Execute(); gvMessageInfo.DataSource = dt; gvMessageInfo.DataBind(); }
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(); }
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(); }
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(); }
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); }
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(); }
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); }
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); }
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(); }