Showing posts with label ERP management. Show all posts
Showing posts with label ERP management. Show all posts

Tuesday, August 7, 2018

how to create event management system website | Sradha WebCreations

how to create event management system website /Web applications / database management 


<%@ Page Language="C#" %>
<%@ Import Namespace="System.IO" %>

<script runat="server">

    protected void btnAdd_Click(object sender, EventArgs e)
    {
        if (upImage.HasFile)
        {
            if (CheckFileType(upImage.FileName))
            {
                upImage.SaveAs(MapPath(upImage.FileName));
            }
        }
    }

    bool CheckFileType(string fileName)
    {
        string ext = Path.GetExtension(fileName);
        switch (ext.ToLower())
        {
            case ".gif":
                return true;
            case ".png":
                return true;   
            case ".jpg":
                return true;           
            case ".jpeg":
                return true;
            default:
                return false;       
        }
    }

    void Page_PreRender()
    {
        string upFolder = MapPath(".");
        DirectoryInfo dir = new DirectoryInfo(upFolder);
        dlstImages.DataSource = dir.GetFiles();
        dlstImages.DataBind();
    }
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>FileUpload File</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>

    <asp:Label
        id="lblImageFile"
        Text="Image File:"
        AssociatedControlID="upImage"
        Runat="server" />

    <asp:FileUpload
        id="upImage"
        Runat="server" />

    <br /><br />
    
    <asp:Button
        id="btnAdd"
        Text="Add Image"
        OnClick="btnAdd_Click"
        Runat="server" />

    <hr />
   
    <asp:DataList
        id="dlstImages"
        RepeatColumns="4"
        runat="server" Width="764px">
        <ItemTemplate>
        <asp:Image ID="Image1"
            ImageUrl='<%# Eval("Name", "./{0}") %>'
            style="width:200px"
            Runat="server" />
        <br />
        <%# Eval("Name") %>   
        </ItemTemplate>
    </asp:DataList>
   
    </div>
    </form>
</body>
</html>


fileUpload.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FileUpload.aspx.cs" Inherits="FileUpload" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
        <asp:FileUpload ID="FileUpload1" runat="server" />
        <br />
        <asp:Button ID="UPloadButton" runat="server" onclick="UPloadButton_Click"
            Text="Upload" />
        <br />
        <asp:Label ID="Status_Label" runat="server" Text="Up Load Status"></asp:Label>
   
    </div>
    </form>
</body>
</html>

fileUpload.aspx.cs

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



public partial class FileUpload : System.Web.UI.Page
{
   
    protected void UPloadButton_Click(object sender, EventArgs e)
    {
       
    if (FileUpload1.HasFile)
    {
        try
        {
            string filename =Path.GetFileName(FileUpload1.FileName);
           FileUpload1.SaveAs(Server.MapPath("~/") + filename);
            Status_Label.Text = "Upload status: File uploaded!";
        }
        catch(Exception ex)
        {
            Status_Label.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message;
        }
    }

        if(FileUpload1.HasFile)
        {
            try
            {
                if(FileUpload1.PostedFile.ContentType=="image/jpeg")
                {
                    if(FileUpload1.PostedFile.ContentLength<200)
                    {
           string filename = Path.GetFileName(FileUpload1.FileName);
                           
              FileUpload1. SaveAs(Server.MapPath("~/") + filename);
               Status_Label.Text = "Upload status: File uploaded!";
                    }
                    Else
Status_Label.Text = "Upload status: The file has to be less than 100 kb!";
                }
                else
  Status_Label.Text = "Upload status: Only JPEG files are accepted!";
            }
            catch (Exception ex)
            {
Status_Label.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message;
            }
        }
    }
}





Monday, July 30, 2018

how to create Employee management system asp & sql server | sradha webcreations


Employee management system asp & sql server





using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

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

    }
    double dBasic;
    double dWash;
    double dMedical;
    double dOther;

    double dPBasic;
    double dPWash;
    double dPMedical;
    double dPOther;

       
    string sDay;
    double dPtotal;
    protected void DropDownListMONTH_SelectedIndexChanged(object sender, EventArgs e)
    {
        //string sMonth;
        string sDay;
        if (DropDownListMONTH.SelectedIndex == 2)
        {
            sDay = "28";
        }
        else if (DropDownListMONTH.SelectedIndex == 4 || DropDownListMONTH.SelectedIndex == 6 || DropDownListMONTH.SelectedIndex == 9 || DropDownListMONTH.SelectedIndex == 11)
        {
            sDay = "30";
        }
        else
        {
            sDay ="31";
        }
        TextBoxDAY.Text = Convert.ToString(sDay);
    }
 protected void TextBoxPIADdUTY_TextChanged(object sender, EventArgs e)
    {
     
        double dPaidDuibty;
     int  iDay = Convert.ToInt32(TextBoxDAY.Text);
        dPaidDuibty = Convert.ToDouble(TextBoxPIADdUTY.Text);
        dBasic = Convert.ToDouble(TextBoxBASIC.Text);
        dPBasic = dPaidDuibty * dBasic / iDay;
        TextBoxPBASIC.Text = Convert.ToString(dPBasic);
        dWash = Convert.ToDouble(TextBoxWASH.Text);
        dPWash = dPaidDuibty * dWash / iDay;
        TextBoxPWASH.Text = Convert.ToString(dPWash);
        dMedical = Convert.ToDouble(TextBoxMEDICAL.Text);
        dPMedical = dPaidDuibty * dMedical / iDay;
        TextBoxPMEDICAL.Text = Convert.ToString(dPMedical);
        dOther = Convert.ToDouble(TextBoxOTHER.Text);
        dPOther = dPaidDuibty * dOther / iDay;
        TextBoxPOTHER.Text = Convert.ToString(dPOther);   
        double dPtotal;
        dPtotal = dPBasic + dPWash + dPWash + dPMedical + dPOther;
        TextBoxPAYBLETOTAL.Text = Convert.ToString(dPtotal);
    }
    protected void TextBox2_TextChanged(object sender, EventArgs e)
    {
        double dRemunaretion;
        dRemunaretion = Convert.ToDouble(TextBoxREMUNARETION.Text);
        double dTotal;
        dBasic = (dRemunaretion * 80 / 100);
        TextBoxBASIC.Text = Convert.ToString(dBasic);
        dWash = (dRemunaretion * 5 / 100);
        TextBoxWASH.Text = Convert.ToString(dWash);
        dMedical = (dRemunaretion * 5 / 100);
        TextBoxMEDICAL.Text = Convert.ToString(dMedical);
        dOther = (dRemunaretion * 10 / 100);
        TextBoxOTHER.Text = Convert.ToString(dOther);
        dTotal = dBasic + dWash + dMedical + dOther;
        TextBoxTOTAL.Text = Convert.ToString(dTotal);
    }

    protected void TextBoxTDS_TextChanged(object sender, EventArgs e)
    {
       
        double dPtotal=Convert.ToDouble(TextBoxPAYBLETOTAL.Text);
        double dTDS=Convert.ToDouble(TextBoxTDS.Text);
        double WF = 100;
        double dGrandTotal;
        dGrandTotal = dPtotal + WF + dTDS;
        TextBoxGRANDTOTAL.Text = Convert.ToString(dGrandTotal);
        TextBoxWF.Text = Convert.ToString(WF);
    }



}