| Server IP : 104.21.93.206  /  Your IP : 172.71.255.6 Web Server : Microsoft-IIS/10.0 System : Windows NT WAVE 10.0 build 20348 (Windows Server 2016) AMD64 User : IWPD_458(indias) ( 0) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : D:/inetpub/vhosts/indiasmartbazaar.com/pimsharyana.in/admin/ | 
| Upload File : | 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using DevExpress.Web;
public partial class admin_career : System.Web.UI.Page
{
    SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["con"].ConnectionString);
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            getdata();
        }
    }
    private void getdata()
    {
        SqlCommand cmd = new SqlCommand("SELECT * FROM [tbl_job] ORDER BY [ID] DESC", con);
        SqlDataAdapter Da = new SqlDataAdapter(cmd);
        DataTable Dt = new DataTable();
        Da.Fill(Dt);
        if(Dt.Rows.Count>0)
        {
            ASPxGridView1.DataSource = Dt;
            ASPxGridView1.DataBind();
        }
    }
    protected void Page_Init(object sender, EventArgs e)
    {
        SqlCommand cmd = new SqlCommand("SELECT * FROM [tbl_job] ORDER BY [ID] DESC", con);
        SqlDataAdapter Da = new SqlDataAdapter(cmd);
        DataTable Dt = new DataTable();
        Da.Fill(Dt);
        if (Dt.Rows.Count > 0)
        {
            ASPxGridView1.DataSource = Dt;
            ASPxGridView1.DataBind();
        }
    }
    protected void btnsubmit_Click(object sender, EventArgs e)
    {
        TimeZoneInfo INDIAN_ZONE = TimeZoneInfo.FindSystemTimeZoneById("India Standard Time");
        DateTime indianTime = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, INDIAN_ZONE);
        //Console.WriteLine(indianTime.ToString("F"));
        // lbldate.Text = indianTime.ToString("dd-MM-yyyy hh:mm tt");
        DateTime today = indianTime;
        var day = today.ToString("dd");
        var mm = today.ToString("MM");
        var yyyy = today.ToString("yyyy");
        var time = today.ToString("hh:mm tt");
        SqlCommand cmd = new SqlCommand("SP_Post_job", con);
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.Add("jobpost", SqlDbType.NVarChar).Value = txtheading.Text;
        cmd.Parameters.Add("Description", SqlDbType.NVarChar).Value = txtdescription.Text;
        cmd.Parameters.Add("Qualification", SqlDbType.NVarChar).Value = txtQualification.Text;
        cmd.Parameters.Add("Expereice", SqlDbType.NVarChar).Value = txtExpereice.Text;
        cmd.Parameters.Add("Postition", SqlDbType.NVarChar).Value = txtPostition.Text;
        cmd.Parameters.Add("Datetime", SqlDbType.NVarChar).Value = txtCalender.Text;
        con.Open();
        int RA = cmd.ExecuteNonQuery();
        con.Close();
        if (RA > 0)
        {
            lblsucess.Visible = true;
            lblfailed.Visible = false;
        }
        else
        {
            lblfailed.Visible = true;
            lblsucess.Visible = false;
        }
    }
    protected void btndelete_Command(object sender, CommandEventArgs e)
    {
        String @ID = e.CommandArgument.ToString();
        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["con"].ConnectionString);
        SqlCommand cmd = new SqlCommand("SP_delete_job", con);
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.Add("@ID", SqlDbType.Int).Value = ID;
        con.Open();
        int RA = cmd.ExecuteNonQuery();
        con.Close();
        if (RA > 0)
        {
            getdata();
        }
    }
    protected void grd_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
    {
        if (e.CommandArgs.CommandName == "Edit")
        {
            var gv = sender as ASPxGridView;
            var id = gv.GetRowValues(e.VisibleIndex, new string[] { "ID" });
            Response.Redirect(string.Format("updatecareer.aspx?ID={0}", id));
        }
     
    }
}