protected void ShowRecords(object sender, EventArgs e)
 {
     SqlDataSource8.DataBind();
     GridView2.DataBind();
     UpdatePanel1.Update();
     Button1.Visible       = true;
     Panel1.Visible        = true;
     DropDownList4.Visible = true;
     Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('UpdateMarks')", true);
 }
Ejemplo n.º 2
0
 protected void ASPxGridView2_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
 {
     SqlDataSource1.DataBind();
     ASPxGridView1.DataBind();
     SqlDataSource13.DataBind();
     ASPxGridView3.DataBind();
     SqlDataSource15.DataBind();
     ASPxGridView5.DataBind();
     SqlDataSource8.DataBind();
     ASPxGridView7.DataBind();
 }
Ejemplo n.º 3
0
    protected void Button12_Click(object sender, EventArgs e)
    {
        DataView  dv = (DataView)SqlDataSource5.Select(DataSourceSelectArguments.Empty);
        DataTable dt = dv.ToTable();

        Label2.Text = dt.Rows[0][0].ToString();
        SqlDataSource8.Delete();
        SqlDataSource5.Delete();

        Response.Redirect("~/UserPage/UserElectricityServices.aspx");
    }
Ejemplo n.º 4
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        DataView dvieww;
        string   SMTP;
        string   BCC;
        string   EmailFrom;
        string   Password;

        dvieww    = (DataView)SqlDataSource8.Select(DataSourceSelectArguments.Empty);
        SMTP      = (string)dvieww.Table.Rows[0]["SMTP"];
        BCC       = (string)dvieww.Table.Rows[0]["BCC"];
        EmailFrom = (string)dvieww.Table.Rows[0]["EmailFrom"];
        Password  = (string)dvieww.Table.Rows[0]["Password"];


        MailMessage mail       = new MailMessage();
        SmtpClient  SmtpServer = new SmtpClient(SMTP.ToString());

        mail.From = new MailAddress(EmailFrom.ToString());
        //Email acpe = new Email();
        mail.To.Add(TextBox2.Text);
        mail.Bcc.Add(BCC.ToString());

        StreamReader reader   = new StreamReader(Server.MapPath("~/email/Contact.html"));
        string       readFile = reader.ReadToEnd();
        string       myString = "";

        myString = readFile;
        //string name = HttpUtility.UrlEncode(Encrypt(Session["UserName"].ToString().Trim()));
        //string technology = HttpUtility.UrlEncode(Encrypt(ddlTechnology.SelectedItem.Value));

        myString = myString.Replace("{#Name}", TextBox1.Text);
        myString = myString.Replace("{#Email}", TextBox2.Text);
        myString = myString.Replace("{#Message}", TextBox3.Text);
        //myString = myString.Replace("{#message}", TextBox4.Text);


        mail.Subject           = "New Contact on onlinehcs.com";
        mail.IsBodyHtml        = true;
        mail.Body              = myString.ToString();
        SmtpServer.Port        = 8889;
        SmtpServer.Credentials = new System.Net.NetworkCredential(EmailFrom.ToString(), Password.ToString());
        SmtpServer.EnableSsl   = false;
        object userState = mail;

        SmtpServer.SendCompleted += new SendCompletedEventHandler(SMTPClientForAsy.SmtpClient_OnCompleted);
        SmtpServer.SendAsync(mail, userState);

        TextBox1.Text = string.Empty;
        TextBox2.Text = string.Empty;
        TextBox3.Text = string.Empty;

        Label5.Text = "Submitted Successfully";
    }
Ejemplo n.º 5
0
 protected void Button3_Click(object sender, EventArgs e)
 {
     try
     {
         SqlDataSource8.SelectParameters["Codigo"].DefaultValue = TextBox6.Text;
         SqlDataSource8.DataSourceMode = SqlDataSourceMode.DataReader;
         SqlDataReader Producto;
         Producto = (SqlDataReader)SqlDataSource8.Select(DataSourceSelectArguments.Empty);
         if (Producto.Read())
         {
             TextBox7.Text = Producto["Descripcion"].ToString();
             Label1.Text   = Producto["ID_Producto"].ToString();
         }
         else
         {
             Response.Write("<script>alert('Este producto no existe')</script>");
         }
     }
     catch
     {
         Response.Write("<script>alert('Ingrese un codigo!')</script>");
     }
     //DataTable TB = new DataTable();
     //TB = datosProd.BuscarProducto2(TextBox6.Text);
     //try
     //{
     //    ViewState["Estado"] = TB;
     //    if (ViewState["Estado"] == null)
     //    {
     //        Response.Write("<script>alert('Este producto no existe')</script>");
     //    }
     //    else
     //    {
     //        TextBox7.Text = TB.Rows[0][1].ToString();
     //    }
     //}
     //catch
     //{
     //    Response.Write("<script>alert('Este producto no existe')</script>");
     //}
 }
Ejemplo n.º 6
0
 protected void Button3_Click(object sender, EventArgs e)
 {
     try
     {
         SqlDataSource8.SelectParameters["Codigo"].DefaultValue = TextBox6.Text;
         SqlDataSource8.DataSourceMode = SqlDataSourceMode.DataReader;
         SqlDataReader Producto;
         Producto = (SqlDataReader)SqlDataSource8.Select(DataSourceSelectArguments.Empty);
         if (Producto.Read())
         {
             TextBox7.Text = Producto["Descripcion"].ToString();
             Label1.Text   = Producto["ID_Producto"].ToString();
         }
         else
         {
             Response.Write("<script>alert('Este producto no existe')</script>");
         }
     }
     catch
     {
         Response.Write("<script>alert('Ingrese un codigo!')</script>");
     }
 }
Ejemplo n.º 7
0
        protected void Button4_Click(object sender, EventArgs e)
        {
            int estado = 0;

            if (TextBox6.Text != "")
            {
                SqlDataSource8.InsertParameters["Anio"].DefaultValue = TextBox6.Text;
                estado = SqlDataSource8.Insert();
                if (estado == 1)
                {
                    Response.Write("<script>alert('Año agregado correctamente.')</script>");
                    borrar();
                }
                else
                {
                    Response.Write("<script>alert('Error, resive los datos')</script>");
                }
            }
            else
            {
                Response.Write("<script>alert('Error, resive los datos')</script>");
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            DataView    dv  = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);
            DataRowView drv = dv[0];

            Table1.Rows[1].Cells[0].Text = drv["BUGS"].ToString();

            DataView    dv1  = (DataView)SqlDataSource2.Select(DataSourceSelectArguments.Empty);
            DataRowView drv1 = dv1[0];

            Table1.Rows[1].Cells[1].Text = drv1["BUGS"].ToString();

            DataView    dv2  = (DataView)SqlDataSource3.Select(DataSourceSelectArguments.Empty);
            DataRowView drv2 = dv2[0];

            Table1.Rows[1].Cells[2].Text = drv2["BUGS"].ToString();

            DataView    dv3  = (DataView)SqlDataSource4.Select(DataSourceSelectArguments.Empty);
            DataRowView drv3 = dv3[0];

            Table1.Rows[1].Cells[3].Text = drv3["BUGS"].ToString();

            DataView    dv5  = (DataView)SqlDataSource5.Select(DataSourceSelectArguments.Empty);
            DataRowView drv5 = dv5[0];

            Table2.Rows[1].Cells[0].Text = drv5["BUGS"].ToString();

            DataView    dv6  = (DataView)SqlDataSource6.Select(DataSourceSelectArguments.Empty);
            DataRowView drv6 = dv6[0];

            Table2.Rows[1].Cells[1].Text = drv6["BUGS"].ToString();

            DataView    dv7  = (DataView)SqlDataSource7.Select(DataSourceSelectArguments.Empty);
            DataRowView drv7 = dv7[0];

            Table2.Rows[1].Cells[2].Text = drv7["BUGS"].ToString();

            DataView    dv8  = (DataView)SqlDataSource8.Select(DataSourceSelectArguments.Empty);
            DataRowView drv8 = dv8[0];

            Table2.Rows[1].Cells[3].Text = drv8["BUGS"].ToString();

            DataView    dv9  = (DataView)SqlDataSource9.Select(DataSourceSelectArguments.Empty);
            DataRowView drv9 = dv9[0];

            Table3.Rows[1].Cells[0].Text = drv9["BUGS"].ToString();

            DataView    dv10  = (DataView)SqlDataSource10.Select(DataSourceSelectArguments.Empty);
            DataRowView drv10 = dv10[0];

            Table3.Rows[1].Cells[1].Text = drv10["BUGS"].ToString();

            DataView    dv11  = (DataView)SqlDataSource11.Select(DataSourceSelectArguments.Empty);
            DataRowView drv11 = dv11[0];

            Table3.Rows[1].Cells[2].Text = drv11["BUGS"].ToString();

            DataView    dv12  = (DataView)SqlDataSource12.Select(DataSourceSelectArguments.Empty);
            DataRowView drv12 = dv12[0];

            Table3.Rows[1].Cells[3].Text = drv12["BUGS"].ToString();
        }
Ejemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Double   oa  = 0;
        Double   pb  = 0;
        DataView dv1 = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);

        Label1.Text = (string)dv1.Table.Rows[0][1];
        Label2.Text = (string)dv1.Table.Rows[0][2];
        DateTime rdate = (DateTime)dv1.Table.Rows[0][6];

        Label3.Text = rdate.ToString("MM/dd/yyyy");

        Double era = (Double)dv1.Table.Rows[0][4];

        if (dv1.Table.Rows[0][5] is DBNull)
        {
            Label6.Text = ""; Label7.Text = "";
        }
        else
        {
            pb          = (Double)dv1.Table.Rows[0][5];
            Label6.Text = "Performance Bond";
            Label7.Text = pb.ToString("n2");
        }

        if (dv1.Table.Rows[0][3] is DBNull)
        {
        }
        else
        {
            oa          = (Double)dv1.Table.Rows[0][3];
            Label5.Text = oa.ToString("n2");
        }

        Label4.Text = era.ToString("n2");

        era         = oa + era + pb;
        Label8.Text = era.ToString("n2");

        if (dv1.Table.Rows[0][7] is DBNull)
        {
            Label9.Text = "No Reservation Fee.";
        }
        else
        {
            Double rf = (Double)dv1.Table.Rows[0][7];
            Label9.Text = rf.ToString("n2");
        }
        int vid = (int)dv1.Table.Rows[0][8];

        TextBox4.Text = vid.ToString();
        TextBox8.Text = Request.QueryString["newId"];
        DataView dvy = (DataView)SqlDataSource8.Select(DataSourceSelectArguments.Empty);

        if ((int)dvy.Table.Rows[0][0] >= 1)
        {
            DataView dvx = (DataView)SqlDataSource6.Select(DataSourceSelectArguments.Empty);
            Double   tl  = (Double)dvx.Table.Rows[0][0];
            Label10.Text = tl.ToString("n2");
        }
        else
        {
            Label10.Text = "0";
        }

        DataView dva = (DataView)rsvamntyCount.Select(DataSourceSelectArguments.Empty);

        if ((int)dva.Table.Rows[0][0] >= 1)
        {
            DataView dvb = (DataView)rsvamntySum.Select(DataSourceSelectArguments.Empty);
            Double   tl2 = (Double)dvb.Table.Rows[0][0];
            Label12.Text = tl2.ToString("n2");
        }
        else
        {
            Label12.Text = "0";
        }
        DataView dvz = (DataView)rsvmiscCount.Select(DataSourceSelectArguments.Empty);

        if ((int)dvz.Table.Rows[0][0] >= 1)
        {
            DataView dvw = (DataView)rsvmiscSum.Select(DataSourceSelectArguments.Empty);
            Double   tl3 = (Double)dvw.Table.Rows[0][0];
            Label13.Text = tl3.ToString("n2");
        }
        else
        {
            Label13.Text = "0";
        }

        Label11.Text      = "";
        TextBox3.ReadOnly = true;

        Double gtotal = Convert.ToDouble(Label8.Text) + Convert.ToDouble(Label10.Text) + Convert.ToDouble(Label12.Text) + Convert.ToDouble(Label13.Text);

        Label14.Text = gtotal.ToString("n2");
        rsvupdatetotal.Update();
    }
Ejemplo n.º 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String y = "select DISTINCT [Year] from SchoolTable";

        SqlDataSource9.SelectCommand = y;
        DataView dv = (DataView)SqlDataSource9.Select(new DataSourceSelectArguments());

        for (int i = 0; i < dv.Count; i++)
        {
            if (dv[i][0] != DBNull.Value)
            {
                String year = (String)dv[i][0];

                String sql1 = "select count(UnitName) from SchoolTable where UnitType='Cub' AND Year='" + year + "' AND Status='Activated'";
                SqlDataSource1.SelectCommand = sql1;
                DataView dv1 = (DataView)SqlDataSource1.Select(new DataSourceSelectArguments());
                int      cub = (int)dv1[0][0];

                String sql2 = "select count(UnitName) from SchoolTable where UnitType='Scout' AND Year='" + year + "' AND Status='Activated'";
                SqlDataSource2.SelectCommand = sql2;
                DataView dv2   = (DataView)SqlDataSource2.Select(new DataSourceSelectArguments());
                int      scout = (int)dv2[0][0];

                String sql3 = "select count(UnitName) from SchoolTable where UnitType='Rover' AND Year='" + year + "' AND Status='Activated'";
                SqlDataSource3.SelectCommand = sql3;
                DataView dv3   = (DataView)SqlDataSource3.Select(new DataSourceSelectArguments());
                int      rover = (int)dv3[0][0];

                String sql4 = "select count(UnitName) from SchoolTable where UnitType='Bulbul' AND Year='" + year + "' AND Status='Activated'";
                SqlDataSource4.SelectCommand = sql4;
                DataView dv4    = (DataView)SqlDataSource4.Select(new DataSourceSelectArguments());
                int      bulbul = (int)dv4[0][0];

                String sql5 = "select count(UnitName) from SchoolTable where UnitType='Guide' AND Year='" + year + "' AND Status='Activated'";
                SqlDataSource5.SelectCommand = sql5;
                DataView dv5   = (DataView)SqlDataSource5.Select(new DataSourceSelectArguments());
                int      guide = (int)dv5[0][0];

                String sql6 = "select count(UnitName) from SchoolTable where UnitType='Ranger' AND Year='" + year + "' AND Status='Activated'";
                SqlDataSource6.SelectCommand = sql6;
                DataView dv6    = (DataView)SqlDataSource6.Select(new DataSourceSelectArguments());
                int      ranger = (int)dv6[0][0];

                String sql7 = "select count(UnitName) from SchoolTable where UnitType='Bunny' AND Year='" + year + "' AND Status='Activated'";
                SqlDataSource7.SelectCommand = sql7;
                DataView dv7   = (DataView)SqlDataSource7.Select(new DataSourceSelectArguments());
                int      bunny = (int)dv7[0][0];

                int total = cub + scout + rover + bulbul + guide + ranger + bunny;

                String sql9 = "select count(StudFullName) from StudentTable where UnitType='Cub' AND Year='" + year + "' AND Status='Activated'";
                SqlDataSource9.SelectCommand = sql9;
                DataView dv9  = (DataView)SqlDataSource9.Select(new DataSourceSelectArguments());
                int      cub1 = (int)dv9[0][0];

                String sql10 = "select count(StudFullName) from StudentTable where UnitType='Scout' AND Year='" + year + "' AND Status='Activated'";
                SqlDataSource10.SelectCommand = sql10;
                DataView dv10   = (DataView)SqlDataSource10.Select(new DataSourceSelectArguments());
                int      scout1 = (int)dv10[0][0];

                String sql11 = "select count(StudFullName) from StudentTable where UnitType='Rover' AND Year='" + year + "' AND Status='Activated'";
                SqlDataSource11.SelectCommand = sql11;
                DataView dv11   = (DataView)SqlDataSource11.Select(new DataSourceSelectArguments());
                int      rover1 = (int)dv11[0][0];

                String sql12 = "select count(StudFullName) from StudentTable where UnitType='Bulbul' AND Year='" + year + "' AND Status='Activated'";
                SqlDataSource12.SelectCommand = sql12;
                DataView dv12    = (DataView)SqlDataSource12.Select(new DataSourceSelectArguments());
                int      bulbul1 = (int)dv12[0][0];

                String sql13 = "select count(StudFullName) from StudentTable where UnitType='Guide' AND Year='" + year + "' AND Status='Activated'";
                SqlDataSource13.SelectCommand = sql13;
                DataView dv13   = (DataView)SqlDataSource13.Select(new DataSourceSelectArguments());
                int      guide1 = (int)dv13[0][0];

                String sql14 = "select count(StudFullName) from StudentTable where UnitType='Ranger' AND Year='" + year + "' AND Status='Activated'";
                SqlDataSource14.SelectCommand = sql14;
                DataView dv14    = (DataView)SqlDataSource14.Select(new DataSourceSelectArguments());
                int      ranger1 = (int)dv14[0][0];

                String sql15 = "select count(StudFullName) from StudentTable where UnitType='Bunny' AND Year='" + year + "' AND Status='Activated'";
                SqlDataSource15.SelectCommand = sql15;
                DataView dv15   = (DataView)SqlDataSource15.Select(new DataSourceSelectArguments());
                int      bunny1 = (int)dv7[0][0];

                int total1 = cub1 + scout1 + rover1 + bulbul1 + guide1 + ranger1 + bunny1;

                String sql16 = "select count(UnitName) from SchoolTable where Year='" + year + "' AND Status='Activated'";
                SqlDataSource16.SelectCommand = sql16;
                DataView dv16 = (DataView)SqlDataSource16.Select(new DataSourceSelectArguments());
                int      unit = (int)dv16[0][0];

                String sql17 = "select SUM(khTotalContri) from SchoolTable where Year='" + year + "'";
                SqlDataSource17.SelectCommand = sql17;
                DataView dv17 = (DataView)SqlDataSource17.Select(new DataSourceSelectArguments());
                int      amt;
                if (dv17[0][0] != DBNull.Value)
                {
                    amt = (int)dv17[0][0];
                }
                else
                {
                    amt = 0;
                }
                String sql18 = "select count(SchoolName) from SchoolTable where Year='" + year + "' AND Status='Activated'";
                SqlDataSource18.SelectCommand = sql18;
                DataView dv18 = (DataView)SqlDataSource18.Select(new DataSourceSelectArguments());
                int      sch  = (int)dv18[0][0];

                String sql19 = "select count(SchoolName) from SchoolTable where SchoolType='PrimarySchool' AND Year='" + year + "' AND Status='Activated'";
                SqlDataSource19.SelectCommand = sql19;
                DataView dv19 = (DataView)SqlDataSource19.Select(new DataSourceSelectArguments());
                int      sch1 = (int)dv19[0][0];

                String sql20 = "select count(SchoolName) from SchoolTable where SchoolType='SecondarySchool' AND Year='" + year + "' AND Status='Activated'";
                SqlDataSource20.SelectCommand = sql20;
                DataView dv20 = (DataView)SqlDataSource20.Select(new DataSourceSelectArguments());
                int      sch2 = (int)dv20[0][0];

                int    total3 = sch1 + sch2;
                String update = "Select * from StatisticalData where Year='" + year + "'";
                SqlDataSource21.SelectCommand = update;
                DataView dv21 = (DataView)SqlDataSource21.Select(new DataSourceSelectArguments());
                if (dv21.Count != 0)
                {
                    String query = "update StatisticalData set Cub=" + cub + ", Scout=" + scout + ", Rover=" + rover + ", Bulbul=" + bulbul + ", Guide=" + guide + ", Ranger=" + ranger + ", Bunny=" + bunny + ", Total=" + total + ", Cub1=" + cub1 + ", Scout1=" + scout1 + ", Rover1=" + rover1 + ", Bulbul1=" + bulbul1 + ", Guide1=" + guide1 + ", Ranger1=" + ranger1 + ", Bunny1=" + bunny1 + ", Total1=" + total1 + ", TotalUnits=" + unit + ", CollectedFees=" + amt + ", TotalParticipatedSchools=" + sch + ", PrimarySchool=" + sch1 + ", SecondarySchool=" + sch2 + ", TotalMembers=" + total3 + " where Year='" + year + "'";
                    SqlDataSource22.UpdateCommand = query;
                    int n = SqlDataSource22.Update();
                }
                else
                {
                    String insert1 = "insert into StatisticalData (Year, Cub, Scout, Rover, Bulbul, Guide, Ranger, Bunny, Total, Cub1, Scout1, Rover1, Bulbul1, Guide1, Ranger1, Bunny1, Total1, TotalUnits, CollectedFees, TotalParticipatedSchools, PrimarySchool, SecondarySchool, TotalMembers) Values('" + year + "'," + cub + "," + scout + "," + rover + "," + bulbul + "," + guide + "," + ranger + "," + bunny + "," + total + "," + cub1 + "," + scout1 + "," + rover1 + "," + bulbul1 + "," + guide1 + "," + ranger1 + "," + bunny1 + "," + total1 + "," + unit + "," + amt + "," + sch + "," + sch1 + "," + sch2 + "," + total3 + ")";
                    SqlDataSource8.InsertCommand = insert1;
                    int n1 = SqlDataSource8.Insert();
                }
            }
        }
        Server.Transfer("Statistical2.aspx");
    }