Showing posts with label visual studio. Show all posts
Showing posts with label visual studio. Show all posts

Thursday, August 9, 2018

Check Box uses | Multiple selections Option in online software | web Applications | Sradha webcreations

Check Box uses | Multiple selections Option in online software | web Applications | Websites 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class CHECK_BOX_MAILBOX : System.Web.UI.Page
{
    string sName;
    string sdob;
   
    protected void CheckBoxSPORTS_CheckedChanged(object sender, EventArgs e)
    {
        string sname = TextBox1.Text;
        string sdob = TextBox2.Text;
        if (CheckBoxSPORTS.Checked == true)
        {
            TextBox3.Visible = true;
            TextBox3.Text = "SPORTS";
        }
        else
        {
            TextBox3.Visible = false;
        }
    }
    protected void CheckBoxDANCING_CheckedChanged(object sender, EventArgs e)
    {
        string sname = TextBox1.Text;
        string sdob = TextBox2.Text;
        if (CheckBoxSPORTS.Checked == true)
        {
            TextBox4.Visible = true;
            TextBox4.Text = "DANCING";
        }
        else
        {
            TextBox4.Visible = false;
        }
    }
   
    protected void CheckBoxTRAVELLING_CheckedChanged1(object sender, EventArgs e)
    {
        string sname = TextBox1.Text;
        string sdob = TextBox2.Text;
        if (CheckBoxSPORTS.Checked == true)
        {
            TextBox5.Visible = true;
            TextBox5.Text = "TRAVELLING";
        }
        else
        {
            TextBox5.Visible = false;
        }
    }
    protected void CheckBoxSINGING_CheckedChanged1(object sender, EventArgs e)
    {

        string sname = TextBox1.Text;
        string sdob = TextBox2.Text;
        if (CheckBoxSPORTS.Checked == true)
        {
            TextBox6.Visible = true;
            TextBox6.Text = "SINGING";
        }
        else
        {
            TextBox6.Visible = false;
        }
    }
}

Saturday, July 28, 2018

how to create Employee management system | Sradha webcreations

Employee management system in asp.net + Sql Server

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Web.Security;

public partial class if_else_SalaryCalculation : System.Web.UI.Page
{
       
    protected void TextBoxEXPERIENCE_TextChanged(object sender, EventArgs e)
    {
        string sEmployeeName = TextBoxEMPLOYEE.Text;
        double dBasic =Convert.ToDouble( TextBoxBASIC.Text);
        double dAnual;
        double dtotal;
       
        dAnual = dBasic * 12;
        TextBoxANUAL.Text = Convert.ToString(dAnual);

        int iAge = Convert.ToInt32(TextBoxAGE.Text);
        double dExperience = Convert.ToDouble(TextBoxEXPERIENCE.Text);
        double dBonus;
        if (iAge > 35 && dExperience > 3)
        {
            dBonus = dAnual * 11 / 100;
            dtotal = dAnual + dBonus;
        }
        else
        {
            dBonus = 0;
            dtotal = dAnual;
        }
        TextBoxBONUS.Text = Convert.ToString(dBonus);
        TextBoxTOTAL.Text = Convert.ToString(dtotal);
        }
    }








Wednesday, July 25, 2018

how to calculate Finance in asp.net | sradha webcreations

how to calculate Finance in asp.net 


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Web.Security;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class finance_calculator : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    double dSowRoomPrice;
    double dBalance;
    double dTotalFinanceAmount;

    protected void TextBoxDownPayment_TextChanged(object sender, EventArgs e)
    {
        double dDownPayment;
        double dDownpaymentAmount;
       // float fBalance;

        dSowRoomPrice = Convert.ToDouble(TextBoxShowRoomPrice.Text);
        dDownPayment = Convert.ToDouble(TextBoxDownPayment.Text);
        dDownpaymentAmount = dSowRoomPrice * 30 / 100;
 TextBoxDownPaymentAmount.Text = Convert.ToString(dDownpaymentAmount);
       dBalance = dSowRoomPrice - dDownpaymentAmount;
       TextBoxBalance.Text = Convert.ToString(dBalance);   
    }

    protected void TextBoxRateOfIntrest_TextChanged(object sender, EventArgs e)
   
{
        double dRateOfIntrest;
        double dTotalRateOfIntrestAmount;
      //  float fTotalFinanceAmount;
    
        dRateOfIntrest = Convert.ToDouble(TextBoxRateOfIntrest.Text);
        dBalance=Convert.ToDouble(TextBoxBalance.Text);
        dTotalRateOfIntrestAmount = dBalance * dRateOfIntrest / 100  TextBoxTotalIntrest.Text = Convert.ToString(dTotalRateOfIntrestAmount);
        dTotalFinanceAmount = dBalance + dTotalRateOfIntrestAmount;
TextBoxTotalFinanceAmount.Text = Convert.ToString(dTotalFinanceAmount);
    }

    protected void TextBoxDuration_TextChanged(object sender, EventArgs e)
    {
        int iDuration;
        double dEMI;

        iDuration = Convert.ToInt32(TextBoxDuration.Text);
TotalFinanceAmount = Convert.ToDouble(TextBoxTotalFinanceAmount.Text);
        dEMI = dTotalFinanceAmount / iDuration;
        TextBoxEMI.Text = Convert.ToString(dEMI);
    }

    protected void ButtonSAVE_Click(object sender, EventArgs e)
    {
        string connectionstring = ConfigurationManager.ConnectionStrings["DbConnection"].ConnectionString;

        string insertsql = "insert into financecalculator(showroomprice,downpayment,downpaymentamount,balance,rateofintrest,intrestamount,totalfinance,duration,emi)values(@showroomprice,@downpayment,@downpaymentamount,@balance,@rateofintrest,@intrestamount,@totalfinance,@duration,@emi)";

        using (SqlConnection myconnection = new SqlConnection(connectionstring))
        {
            myconnection.Open();
       SqlCommand mycommand = new SqlCommand(insertsql,myconnection);
     mycommand.Parameters.AddWithValue("@showroomprice",TextBoxShowRoomPrice.Text);
   mycommand.Parameters.AddWithValue("@downpayment",TextBoxDownPayment.Text);         mycommand.Parameters.AddWithValue("@downpaymentamount",TextBoxDownPaymentAmount.Text);
mycommand.Parameters.AddWithValue("@balance",TextBoxBalance.Text);
mycommand.Parameters.AddWithValue("@rateofintrest",TextBoxRateOfIntrest.Text);
mycommand.Parameters.AddWithValue("@intrestamount",TextBoxTotalIntrest.Text);
mycommand.Parameters.AddWithValue("@totalfinance",TextBoxTotalFinanceAmount.Text);
mycommand.Parameters.AddWithValue("@duration",TextBoxDuration.Text);
            mycommand.Parameters.AddWithValue("@emi",TextBoxEMI.Text);

            mycommand.ExecuteNonQuery();
            myconnection.Close();

        }
        TextBoxShowRoomPrice.Text = string.Empty;
        TextBoxDownPayment.Text = string.Empty;
        TextBoxDownPaymentAmount.Text = string.Empty;
        TextBoxBalance.Text = string.Empty;
        TextBoxRateOfIntrest.Text = string.Empty;
        TextBoxTotalIntrest.Text = string.Empty;
        TextBoxTotalFinanceAmount.Text = string.Empty;
        TextBoxDuration.Text = string.Empty;
        TextBoxEMI.Text = string.Empty;
    }
}


Tuesday, July 24, 2018

how to calculate AREA OF A CIRCLE in asp.net | sradha webcreations



AREA OF A CIRCLE


            ENTER RADIUS OF A CIRCLE


            THE AREA OF CIRCLE IS




using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Web.Security;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void ButtonCALCULATE_Click(object sender, EventArgs e)
    {
        float fRadius;
        float fArea;

        fRadius = Convert.ToInt32(TXTRADIUS.Text);
        fArea = (3*(fRadius*fRadius));
        TXTAREA.Text = Convert.ToString(fArea);

    }
    protected void ButtonSAVE_Click(object sender, EventArgs e)
    {
  string connectionString = ConfigurationManager.ConnectionStrings["dbconnection"].ConnectionString;
string insertSql = "INSERT INTO circle(radious,area) VALUES(@radious,@area)";

        using (SqlConnection myConnection = new SqlConnection(connectionString))
        {
            myConnection.Open();
  SqlCommand myCommand = new SqlCommand(insertSql, myConnection);
  myCommand.Parameters.AddWithValue("@radious", TXTRADIUS.Text);
  myCommand.Parameters.AddWithValue("@area", TXTAREA.Text);

            myCommand.ExecuteNonQuery();
            myConnection.Close();
        }

        // "Reset" the Subject and Body TextBoxes
        TXTRADIUS.Text = string.Empty;
        TXTAREA.Text = string.Empty;
        
    }
}