Showing posts with label employee management system. Show all posts
Showing posts with label employee management system. Show all posts

Wednesday, July 25, 2018

news paper advisement calculation | sradha webcreations

News paper advisement calculation 


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 TOTAL_Click(object sender, EventArgs e)
    {
        string sNewPaperName;
        string sDate;
        string sFirmName;
        float fHeight;
        float fWidth;
        float fSqCm;
        float fPerSqCm;
        float Ftotal;

        sNewPaperName = TextBoxPAPER.Text;
        sDate = TextBoxDATE.Text;
        sFirmName = TextBoxFIRM.Text;
       
        fHeight = Convert.ToInt32(TextBoxHEIGHT.Text);
        fWidth = Convert.ToInt32(TextBoxWIDTH.Text);
       
        fSqCm = fHeight * fWidth;
        TextBoxSQ.Text = Convert.ToString(fSqCm);

        fSqCm = Convert.ToInt32(TextBoxSQ.Text);
        fPerSqCm = Convert.ToInt32(TextBoxPERSQ.Text);   
        Ftotal = fPerSqCm * fSqCm;
        TextBoxTOTAL.Text = Convert.ToString(Ftotal);
    }
    protected void ButtonSAVE_Click(object sender, EventArgs e)
    {
        string connectionstring = ConfigurationManager.ConnectionStrings["dbconnection"].ConnectionString;

        string insertsql = "insert into advertisement(newpaper,date,firmname,width,height,sqcm,persqcm,total)values(@newpaper,@date,@firmname,@width,@height,@sqcm,@persqcm,@total)";
        using (SqlConnection myconnection = new SqlConnection(connectionstring))
        {
            myconnection.Open();
  SqlCommand mycommand = new SqlCommand(insertsql,myconnection);
            mycommand.Parameters.AddWithValue("@newpaper",TextBoxPAPER.Text);
            mycommand.Parameters.AddWithValue("@date",TextBoxDATE.Text);
            mycommand.Parameters.AddWithValue("@firmname",TextBoxFIRM.Text);
            mycommand.Parameters.AddWithValue("@width",TextBoxWIDTH.Text);
            mycommand.Parameters.AddWithValue("@height",TextBoxHEIGHT.Text);  mycommand.Parameters.AddWithValue("@sqcm",TextBoxSQ.Text);
            mycommand.Parameters.AddWithValue("@persqcm",TextBoxPERSQ.Text);
            mycommand.Parameters.AddWithValue("@total",TextBoxTOTAL.Text);

            mycommand.ExecuteNonQuery();
            myconnection.Close();
        }
        TextBoxPAPER.Text = string.Empty;
        TextBoxDATE.Text = string.Empty;
        TextBoxFIRM.Text = string.Empty;
        TextBoxWIDTH.Text = string.Empty;
        TextBoxHEIGHT.Text = string.Empty;
        TextBoxSQ.Text = string.Empty;
        TextBoxPERSQ.Text = string.Empty;
        TextBoxTOTAL.Text = string.Empty; 
    }
}


how to calculate salary on the basic of leave day | sradha webcreations

how to calculate salary on the basic of leave day

salary calculation on the basic of leave day



EMP NAME
BASIC SALAR
LEAVE DAY
HRA
TOTAL SALARY

save


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 leaveday : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void TextBoxLEAVE_TextChanged(object sender, EventArgs e)
    {
        string sName = TextBoxNAME.Text;
        double dbasic = Convert.ToDouble(TextBoxBASIC.Text);
        int iLeave = Convert.ToInt32(TextBoxLEAVE.Text);
        double dHra;
        double dTotal;
        if (iLeave >= 15)
        {
            dHra = 0;
        }
        else
        {
            dHra = 1500;
        }
        TextBoxHRA.Text = Convert.ToString(dHra);
        dTotal = dbasic + dHra;
        TextBoxTOTAL.Text = Convert.ToString(dTotal);
    }
    protected void ButtonSAVE_Click(object sender, EventArgs e)
    {
        string ConnectionString= ConfigurationManager.ConnectionStrings["DbConnection"].ConnectionString;
        string insertsql = "insert into LeaveDay(name,basic,leave,hra,total)values(@name,@basic,@leave,@hra,@total)";
        using (SqlConnection myconnection = new SqlConnection(ConnectionString))
        {
            myconnection.Open();
    SqlCommand mycommand = new SqlCommand(insertsql,myconnection);
           mycommand.Parameters.AddWithValue("@name",TextBoxNAME.Text);
            mycommand.Parameters.AddWithValue("@basic",TextBoxBASIC.Text);
            mycommand.Parameters.AddWithValue("@leave",TextBoxLEAVE.Text);
    mycommand.Parameters.AddWithValue("@hra",TextBoxHRA.Text);
          mycommand.Parameters.AddWithValue("@total",TextBoxTOTAL.Text);

            mycommand.ExecuteNonQuery();
            myconnection.Close();
        }
        TextBoxNAME.Text = string.Empty;
        TextBoxBASIC.Text = string.Empty;
        TextBoxLEAVE.Text = string.Empty;
        TextBoxHRA.Text = string.Empty;
        TextBoxTOTAL.Text = string.Empty;
        }
}