Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Session["User_ID"] == null)
                {
                    Response.Redirect("SessionExpired.aspx", false);
                }
                else
                {
                    SqlConnection con = new SqlConnection(constr.getconstr());
                    con.Open();

                    Session["Doc_ID"] = Request.QueryString["Doc_ID"];

                    SqlCommand cmd = new SqlCommand();
                    cmd.CommandText = "Get_AD";
                    cmd.Connection  = con;
                    cmd.CommandType = CommandType.StoredProcedure;
                    string doc = Session["Doc_ID"].ToString();
                    cmd.Parameters.AddWithValue("@Doc_ID", doc);

                    SqlDataAdapter ad = new SqlDataAdapter(cmd);
                    DataSet        ds = new DataSet();
                    ad.Fill(ds);
                    Grd_Get_SOP_List.DataSource = ds.Tables[0];
                    Grd_Get_SOP_List.DataBind();
                }
            }
            catch (Exception ex)
            {
                lblErrorMsg.Text = "";
                lblErrorMsg.Text = ex.Message;
            }
        }
Exemple #2
0
        protected void btn_Get_Doc_List_Click(object sender, EventArgs e)
        {
            try
            {
                SqlConnection con = new SqlConnection(constr.getconstr());
                SqlCommand    cmd = new SqlCommand("View_User_TP", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@Action", "Approve");
                cmd.Parameters.AddWithValue("@User_Name", Drp_User.SelectedValue);
                cmd.Parameters.AddWithValue("@Dept_Name", Drp_Dept.SelectedValue);

                SqlDataAdapter ad = new SqlDataAdapter(cmd);

                DataSet ds = new DataSet();
                ad.Fill(ds);
                Grd_Get_SOP_List.DataSource = ds.Tables[0];
                Grd_Get_SOP_List.DataBind();
            }

            catch (Exception ex)
            {
                lblErrorMsg.Text = "";
                lblErrorMsg.Text = ex.Message;
            }
        }