Exemple #1
0
    protected void btnsubmit_Click(object sender, EventArgs e)
    {
        //string man = FileUpload1.FileName;
        clsjobfunction objjobfunction = new clsjobfunction();

        objjobfunction.Whid                     = Convert.ToInt32(ddlbusiness.SelectedValue);
        objjobfunction.DesignationId            = Convert.ToInt32(ddldepartdesg.SelectedValue);
        objjobfunction.JobfunctioncategoryId    = Convert.ToInt32(ddljobfuncat.SelectedValue);
        objjobfunction.JobfunctionsubcategoryId = Convert.ToInt32(ddljobfunsubcat.SelectedValue);
        objjobfunction.Jobfunctiontitle         = txtjobfuntitle.Text;
        objjobfunction.Jobfunctiondescription   = txtjobdesc.Text;
        objjobfunction.Status                   = Convert.ToInt32(chkstatus.Checked);
        objjobfunction.executeinsertquery();

        //if (FileUpload1.HasFile)
        //{
        //    FileUpload1.SaveAs(Server.MapPath("~/NewFolder1/") + man);
        //}
        clear();
        //fillgrid();
        fillgriddata();
        lblmessage.Visible = true;
        lblmessage.Text    = "Record inserted successfully.";
        lblmessage.Visible = true;

        Panel1.Visible  = false;
        Button1.Visible = true;
        lbllegend.Text  = "";
    }
Exemple #2
0
    // protected void test()
    // {

    // }

    protected void ddlbusiness_SelectedIndexChanged(object sender, EventArgs e)
    {
        clsjobfunction objjobfunction = new clsjobfunction();

        objjobfunction.comid = Session["Comid"].ToString();

        objjobfunction.Whid = Convert.ToInt32(ddlbusiness.SelectedValue);
        DataTable dt = new DataTable();

        dt = objjobfunction.selec_deprdes();

        if (dt.Rows.Count > 0)
        {
            ddldepartdesg.DataSource     = dt;
            ddldepartdesg.DataTextField  = "name";
            ddldepartdesg.DataValueField = "DesignationMasterId";
            ddldepartdesg.DataBind();
        }
        else
        {
            ddldepartdesg.Items.Clear();
        }
        //     ddlbusiness.Items.Insert(0, "All");
        //     ddlbusiness.Items[0].Value = "0";

        filljobfuncat();
        filljobfunsubcat();
    }
Exemple #3
0
    protected void filljobfunsubcat()
    {
        ddljobfunsubcat.Items.Clear();

        clsjobfunction objjobfunction = new clsjobfunction();

        ddljobfunsubcat.Items.Clear();

        if (ddljobfuncat.SelectedIndex >= 0)
        {
            objjobfunction.JobCategoryId = Convert.ToInt32(ddljobfuncat.SelectedValue);
        }
        DataTable dt = new DataTable();

        dt = objjobfunction.selec_jobfunsubct();


        if (dt.Rows.Count > 0)
        {
            ddljobfunsubcat.DataSource     = dt;
            ddljobfunsubcat.DataTextField  = "SubCategoryName";
            ddljobfunsubcat.DataValueField = "Id";
            ddljobfunsubcat.DataBind();
        }
        ddljobfunsubcat.Items.Insert(0, "-Select-");
        ddljobfunsubcat.Items[0].Value = "0";
    }
Exemple #4
0
    protected void fillwarehouse()
    {
        clsjobfunction objjobfunction = new clsjobfunction();

        objjobfunction.comid = Session["comid"].ToString();
        DataTable ds1 = new DataTable();

        ds1 = objjobfunction.selec_filliwh();
        //      if (ds1.Rows.Count > 0)
        //      {
        ddlbusiness.DataSource     = ds1;
        ddlbusiness.DataTextField  = "Name";
        ddlbusiness.DataValueField = "WarehouseId";
        ddlbusiness.DataBind();
        //     }
        // ddlbusiness.Items.Insert(0, "All");
        //  ddlbusiness.Items[0].Value = "0";
    }
Exemple #5
0
    protected void fillgrid()
    {
        Label1.Text = ddlbusiness1.SelectedItem.Text;

        clsjobfunction objjobfunction = new clsjobfunction();

        dt = new DataTable();
        dt = objjobfunction.selec_fillinggrdvw();

        DataView myDataView = new DataView();

        myDataView = dt.DefaultView;

        if (hdnsortExp.Value != string.Empty)
        {
            myDataView.Sort = string.Format("{0} {1}", hdnsortExp.Value, hdnsortDir.Value);
        }

        GridView1.DataSource = myDataView;
        GridView1.DataBind();
    }
Exemple #6
0
    protected void filldesignation()
    {
        clsjobfunction objjobfunction = new clsjobfunction();

        objjobfunction.comid = Session["Comid"].ToString();
        objjobfunction.Whid  = Convert.ToInt32(ddlbusiness.SelectedValue);
        //  objjobfunction.DeptID = Convert.ToInt32(ddlbusiness.SelectedValue);
        DataTable dt = new DataTable();

        dt = objjobfunction.selec_deprdes();

        if (dt.Rows.Count > 0)
        {
            ddldepartdesg.DataSource     = dt;
            ddldepartdesg.DataTextField  = "name";
            ddldepartdesg.DataValueField = "DesignationMasterId";
            ddldepartdesg.DataBind();
        }
        //    ddldepartdesg.Items.Insert(0, "-Select-");
        //    ddldepartdesg.SelectedItem.Value = "0";
    }
Exemple #7
0
    protected void btnupdate_Click(object sender, EventArgs e)
    {
        clsjobfunction objjobfunction = new clsjobfunction();

        objjobfunction.Id                       = Convert.ToInt32(lblId.Text);
        objjobfunction.Whid                     = Convert.ToInt32(ddlbusiness.SelectedValue);
        objjobfunction.DesignationId            = Convert.ToInt32(ddldepartdesg.SelectedValue);
        objjobfunction.JobfunctioncategoryId    = Convert.ToInt32(ddljobfuncat.SelectedValue);
        objjobfunction.JobfunctionsubcategoryId = Convert.ToInt32(ddljobfunsubcat.SelectedValue);
        objjobfunction.Jobfunctiontitle         = txtjobfuntitle.Text;
        objjobfunction.Jobfunctiondescription   = txtjobdesc.Text;
        objjobfunction.Status                   = Convert.ToInt32(chkstatus.Checked);
        objjobfunction.executeinsertqueryupdate();



        lblId.Text = "";

        //fillgrid();
        fillgriddata();
        clear();
        btnupdate.Visible  = false;
        btnsubmit.Visible  = true;
        lblmessage.Visible = true;
        lblmessage.Text    = "Record updated successfully.";
        lblmessage.Visible = true;

        ddljobfuncat.Items.Clear();
        filljobfuncat();

        ddljobfunsubcat.Items.Clear();
        filljobfunsubcat();
        lbllegend.Text = "";

        Panel1.Visible  = false;
        Button1.Visible = true;
    }
Exemple #8
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        clsjobfunction objjobfunction = new clsjobfunction();



        if (e.CommandName == "Delete")
        {
            int i = Convert.ToInt32(e.CommandArgument);
            //  Session["ID11"] = i;


            objjobfunction.Id = i;
            objjobfunction.executeinsertquerydelet();

            //cmd = new SqlCommand("delete from JobFunction where Id=" + i ,con);
            //if (cmd.Connection.State.ToString() != "Open")
            //{
            //    con.Open();
            //}
            //cmd.ExecuteNonQuery();
            //con.Close();
            lblmessage.Visible = true;
            lblmessage.Text    = "Record deleted successfully.";
        }

        if (e.CommandName == "Edit")
        {
            lbllegend.Text = "Edit Job Function";

            Button1.Visible = false;
            Panel1.Visible  = true;
            int i = Convert.ToInt32(e.CommandArgument);
            objjobfunction.Id = i;

            lblId.Text = i.ToString();
            dt         = new DataTable();
            dt         = objjobfunction.selec_grdviewrowcomd();
            //     string str = "select * from Jobfunction where Id = '" + i + "'";
            //     SqlCommand cmd = new SqlCommand(str, con);
            //     SqlDataAdapter adpt = new SqlDataAdapter(cmd);
            //     DataTable dt = new DataTable();
            //     adpt.Fill(dt);


            fillwarehouse();
            ddlbusiness.SelectedIndex = ddlbusiness.Items.IndexOf(ddlbusiness.Items.FindByValue(dt.Rows[0]["Whid"].ToString()));


            filldesignation();
            ddldepartdesg.SelectedIndex = ddldepartdesg.Items.IndexOf(ddldepartdesg.Items.FindByValue(dt.Rows[0]["DesignationId"].ToString()));

            filljobfuncat();
            ddljobfuncat.SelectedIndex = ddljobfuncat.Items.IndexOf(ddljobfuncat.Items.FindByValue(dt.Rows[0]["JobfunctioncategoryId"].ToString()));

            filljobfunsubcat();
            ddljobfunsubcat.SelectedIndex = ddljobfunsubcat.Items.IndexOf(ddljobfunsubcat.Items.FindByValue(dt.Rows[0]["JobfunctionsubcategoryId"].ToString()));


            txtjobfuntitle.Text = dt.Rows[0]["Jobfunctiontitle"].ToString();
            txtjobdesc.Text     = dt.Rows[0]["Jobfunctiondescription"].ToString();
            chkstatus.Checked   = Convert.ToBoolean(dt.Rows[0]["Status"]);

            ddlbusiness.Focus();
        }
        if (e.CommandName == "View")
        {
            int i = Convert.ToInt32(e.CommandArgument);

            lblId.Text = i.ToString();
            // int dk = Convert.ToInt32(e.CommandArgument);
            string te = "Jobfunctionprofile.aspx?Id=" + i;
            ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "window.open('" + te + "');", true);
        }

        Session["ID11"] = lblId.Text;
        //fillgrid();
        fillgriddata();
    }