protected void OnClick_LinkButton2(object sender, EventArgs e)
        {
            GridViewRow tabla = (GridViewRow)(((LinkButton)sender).Parent.Parent);

            //IdProducto = ((Label)tabla.FindControl("Label1")).Text.ToString();
            SqlDataSource10.SelectParameters["ID_Existencia"].DefaultValue = ((Label)tabla.FindControl("Label8")).Text.ToString();
            SqlDataSource10.DataSourceMode = SqlDataSourceMode.DataReader;
            SqlDataReader PRECIOPROD;

            PRECIOPROD = (SqlDataReader)SqlDataSource10.Select(DataSourceSelectArguments.Empty);
            if (PRECIOPROD.Read())
            {
                precioProducto = PRECIOPROD["PrecioUnitario"].ToString();
            }

            SqlDataSource10.InsertParameters["Cantidad"].DefaultValue      = ((Label)tabla.FindControl("Label4")).Text.ToString();
            SqlDataSource10.InsertParameters["Precio"].DefaultValue        = precioProducto;
            SqlDataSource10.InsertParameters["Total"].DefaultValue         = (Convert.ToDecimal(precioProducto) * Convert.ToDecimal(((Label)tabla.FindControl("Label4")).Text.ToString())).ToString();
            SqlDataSource10.InsertParameters["ID_Existencia"].DefaultValue = ((Label)tabla.FindControl("Label8")).Text.ToString();
            SqlDataSource10.InsertParameters["ID_Compra"].DefaultValue     = ((Label)tabla.FindControl("Label10")).Text.ToString();
            SqlDataSource10.Insert();

            //SqlDataSource10.UpdateParameters["Cantidad"].DefaultValue = ((Label)tabla.FindControl("Label8")).Text.ToString();
            //SqlDataSource10.UpdateParameters["ID_Existencia"].DefaultValue = ((Label)tabla.FindControl("Label4")).Text.ToString();
            //SqlDataSource10.Update();
            SqlDataSource4.UpdateParameters["ID_DevProPro"].DefaultValue = ((Label)tabla.FindControl("Label1")).Text.ToString();
            SqlDataSource4.UpdateParameters["Cantidad"].DefaultValue     = ((Label)tabla.FindControl("Label4")).Text.ToString();
            SqlDataSource4.UpdateParameters["idStock"].DefaultValue      = ((Label)tabla.FindControl("Label8")).Text.ToString();
            SqlDataSource4.Update();

            Response.Redirect("DevProPro.aspx");
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            try
            {
                SqlDataSource4.UpdateParameters["CardNO"].DefaultValue = Session["CardNo"].ToString();

                SqlDataSource4.UpdateParameters["deposit"].DefaultValue = TextBox1.Text;
                SqlDataSource4.Update();
                SqlDataSource2.InsertParameters["deposit"].DefaultValue  = "True";
                SqlDataSource2.InsertParameters["withdrow"].DefaultValue = "False";
                SqlDataSource2.InsertParameters["Ammount"].DefaultValue  = TextBox1.Text;
                SqlDataSource2.InsertParameters["BranchID"].DefaultValue = DropDownList1.Text;
                SqlDataSource2.InsertParameters["CardNO"].DefaultValue   = Session["CardNo"].ToString();
                SqlDataSource2.InsertParameters["date"].DefaultValue     = DateTime.Today.ToString("dd-MM-yyyy") + "   " + DateTime.Now.ToString("HH: mm:ss");
                SqlDataSource2.Insert();



                Label1.Text = "Successfull!! Done ! , Go to view Balance To Check your Update Balance!!";
            }

            catch (Exception ee)
            {
                Label1.Text = ee.StackTrace;
            }
        }
Exemple #3
0
    protected void ListView1_ItemCommand(object sender, ListViewCommandEventArgs e)
    {
        string id            = ((Label)e.Item.FindControl("Label8")).Text;
        string featurestatus = ((Label)e.Item.FindControl("Label7")).Text;
        string adminapproval = ((Label)e.Item.FindControl("Label6")).Text;


        if (e.CommandName == "Auction")
        {
            Response.Redirect("~/admin/product-setup/AllAuctions?ID=" + id);
        }


        if (e.CommandName == "Feature")
        {
            string fs;
            if (featurestatus == "Yes")
            {
                fs = "No";
            }

            else
            {
                fs = "Yes";
            }
            SqlDataSource3.UpdateParameters.Add("FeatureStatus", fs.ToString());
            SqlDataSource3.UpdateParameters.Add("ID", id);

            SqlDataSource3.Update();
            ListView1.DataBind();
        }

        if (e.CommandName == "Approval")
        {
            string AA;
            if (adminapproval == "Active")
            {
                AA = "Reject";
            }

            else
            {
                AA = "Active";
            }
            SqlDataSource4.UpdateParameters.Add("Approval", AA.ToString());
            SqlDataSource4.UpdateParameters.Add("ID", id);

            SqlDataSource4.Update();
            ListView1.DataBind();
        }

        if (e.CommandName == "Edit")
        {
            Response.Redirect("~/Seller/addproduct.aspx?ID=" + id);
        }
    }
Exemple #4
0
    protected void DataListCommentsofPost_DeleteCommand(object source, DataListCommandEventArgs e)
    {
        DataList1.SelectedIndex = e.Item.ItemIndex;
        int idkomentarz = int.Parse(((Label)(DataList1.SelectedItem.FindControl("LabelIdKomentarze"))).Text);

        SqlDataSource4.UpdateCommand = "UPDATE Komentarze SET k_usun = 1 FROM Komentarze INNER JOIN Posty ON Komentarze.Posty_id_posty = Posty.id_posty INNER JOIN Uzytkownik ON Komentarze.Uzytkownik_id_uzytkownik = Uzytkownik.id_uzytkownik WHERE (Komentarze.id_komentarze = "
                                       + idkomentarz + ")";
        SqlDataSource4.Update();
        DataBind();
    }
Exemple #5
0
 protected void Button3_Click1(object sender, EventArgs e)
 {
     try
     {
         SqlDataSource4.Update();
         Response.Write("<script language=javascript>alert('留言更改成功!')</script>");
         Response.Write("<script language=javascript>window.location.href='3.aspx'</script>");
     }
     catch
     {
         Label1.Text = "留言更改失敗!";
     }
 }
Exemple #6
0
    protected void btn_insertar_Click(object sender, EventArgs e)
    {
        int cant;

        cant = SqlDataSource4.Update();
        if (cant == 1)
        {
            lbl_resultado.Text = "El participante se ha editado correctamente.";
        }
        else
        {
            lbl_resultado.Text = "Se ha producido un error al editar" +
                                 "el participante.";
        }
    }
        protected void Button11_Click(object sender, EventArgs e)
        {
            TextBox32.Text = DateTime.Parse(TextBox30.Text).AddDays(-1).ToString("dd/MM/yyyy");

            TextBox28.Text = TextBox28.Text.ToUpper();
            TextBox29.Text = TextBox29.Text.ToUpper();

            if (TextBox45.Text.Length == 0 || TextBox45.Text.Length == 0)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                                                        "alertMessage",
                                                        "alert('ΟΙΚΟΝΟΜΙΚΟΣ ΔΙΑΧΕΙΡΙΣΤΗΣ -- Δεν έχει συμπληρωθεί το πεδίο Επώνυμο !!!!');", true);
            }
            else if (TextBox46.Text.Length == 0 || TextBox46.Text.Length == 0)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                                                        "alertMessage",
                                                        "alert('ΟΙΚΟΝΟΜΙΚΟΣ ΔΙΑΧΕΙΡΙΣΤΗΣ -- Δεν έχει συμπληρωθεί το Πεδίο Όνομα  !!!!');", true);
            }
            else if (DropDownList7.Text.Length == 0 || DropDownList7.Text.Length == 0)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                                                        "alertMessage",
                                                        "alert('ΟΙΚΟΝΟΜΙΚΟΣ ΔΙΑΧΕΙΡΙΣΤΗΣ -- Δεν έχει συμπληρωθεί o Βαθμός  !!!!');", true);
            }

            else if (TextBox47.Text.Length == 0 || TextBox47.Text.Length == 0)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                                                        "alertMessage",
                                                        "alert('ΟΙΚΟΝΟΜΙΚΟΣ ΔΙΑΧΕΙΡΙΣΤΗΣ -- Δεν έχει συμπληρωθεί το πεδίο ΑΦΜ !!!!');", true);
            }
            else if (TextBox48.Text.Length == 0 || TextBox48.Text.Length == 0)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                                                        "alertMessage",
                                                        "alert('ΔΙΑΧΕΙΡΙΣΤΗΣ -- Δεν έχει συμπληρωθεί το πεδίο ΔΟΥ !!!!');", true);
            }
            else
            {
                SqlDataSource4.Update();
                Diaxiristis_oik.Insert();
                TextBox26.Text = "";
                TextBox27.Text = "";
                TextBox28.Text = "";
                TextBox29.Text = "";
            }
        }
 protected void lbUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         SqlDataSource4.UpdateParameters["Comment"].DefaultValue    = ((TextBox)DetailsView2.FindControl("txtComment")).Text.Trim();
         SqlDataSource4.UpdateParameters["Grade"].DefaultValue      = ((TextBox)DetailsView2.FindControl("txtGrade")).Text.Trim();
         SqlDataSource4.UpdateParameters["Grade_Time"].DefaultValue = DateTime.Now.ToString();
         SqlDataSource4.UpdateParameters["Status"].DefaultValue     = "已批改";
         SqlDataSource4.Update();
         DetailsView2.ChangeMode(DetailsViewMode.ReadOnly);
         lblTooltip1.Text = "批改成功!";
     }
     catch (SqlException)
     {
         lblTooltip1.Text = "更新失败!请检查输入!";
     }
 }
Exemple #9
0
    protected void DataListCommentsofPost_UpdateCommand(object source, DataListCommandEventArgs e)
    {
        DataList1.SelectedIndex = e.Item.ItemIndex;
        string oldcoment   = ((TextBox)(DataList1.SelectedItem.FindControl("TextBox1"))).Text;
        string newcoment   = ((TextBox)(DataList1.SelectedItem.FindControl("TextBox2"))).Text;
        int    idkomentarz = int.Parse(((Label)(DataList1.SelectedItem.FindControl("LabelIdKomentarze"))).Text);

        if (!oldcoment.Equals(newcoment))
        {
            SqlDataSource4.UpdateCommand = "UPDATE Komentarze SET k_note = '" + newcoment +
                                           "', k_data = GetDate() FROM Komentarze INNER JOIN Posty ON Komentarze.Posty_id_posty = Posty.id_posty INNER JOIN Uzytkownik ON Komentarze.Uzytkownik_id_uzytkownik = Uzytkownik.id_uzytkownik WHERE (Komentarze.id_komentarze = "
                                           + idkomentarz + ")";
            SqlDataSource4.Update();
            DataBind();
            //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "success", "setInterval(function(){location.href='Comments.aspx';},5000);", true);
        }
    }
        protected void btnCadastrar_Click(object sender, EventArgs e)
        {
            Usuarios User = new Usuarios();

            User = (Usuarios)Session["usuario"];

            SqlDataSource1.SelectParameters["IDCond"].DefaultValue = Convert.ToString(User.Cond);

            SqlDataSource4.UpdateParameters["Nome"].DefaultValue  = ddlNome.SelectedItem.Value;
            SqlDataSource4.UpdateParameters["Bloco"].DefaultValue = ddlBloco.SelectedItem.Value;
            SqlDataSource4.UpdateParameters["Apart"].DefaultValue = ddlApartamento.SelectedItem.Value;

            SqlDataSource5.UpdateParameters["Nome"].DefaultValue  = ddlNome0.SelectedItem.Value;
            SqlDataSource5.UpdateParameters["Bloco"].DefaultValue = ddlBloco0.SelectedItem.Value;
            SqlDataSource5.UpdateParameters["Apart"].DefaultValue = ddlApartamento0.SelectedItem.Value;

            SqlDataSource4.Update();
            SqlDataSource5.Update();
            SqlDataSource6.Update();
        }
Exemple #11
0
 protected void btnPublish_Click(object sender, EventArgs e)
 {
     SqlDataSource4.Update();
 }
Exemple #12
0
 protected void Button11_Click(object sender, EventArgs e)
 {
     SqlDataSource4.Update();
 }
Exemple #13
0
 protected void TextBox_ThesisTopic_TextChanged(object sender, EventArgs e)
 {
     SqlDataSource4.Update();
 }