Exemple #1
0
    public void FetchRecordPending()
    {
        EnableControls();
        string     SqlPass = null;
        SqlCommand Cmd     = new SqlCommand();

        SqlPass         = "******";
        Cmd             = new SqlCommand(SqlPass, obj.Connection());
        Cmd.CommandType = CommandType.StoredProcedure;
        Cmd.Parameters.Add("@EmployeeCode", SqlDbType.VarChar, 10).Value = Session["EmpCode"];
        Cmd.Parameters.Add("@Param", SqlDbType.VarChar, 20).Value        = DrpLvStatus.SelectedItem.Text;
        SqlDataAdapter Da = new SqlDataAdapter(Cmd);
        DataSet        ds = new DataSet();

        Da.Fill(ds);

        if (ds.Tables.Count == 0)
        {
            GridExtTask.DataSource = null;
            GridExtTask.DataBind();
            string script = "alert('No Record Found');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "ServerControlScript", script, true);
            return;
        }
        else
        {
            GridExtTask.DataSource = ds.Tables[0];
            GridExtTask.DataBind();
        }
    }
Exemple #2
0
    public void FetchRecordPending()
    {
        //GridExtTask.DataSource = null;
        //GridExtTask.DataBind();
        string     SqlPass = null;
        SqlCommand Cmd     = new SqlCommand();

        SqlPass         = "******";
        Cmd             = new SqlCommand(SqlPass, obj.Connection());
        Cmd.CommandType = CommandType.StoredProcedure;
        Cmd.Parameters.Add("@Empcode", SqlDbType.VarChar, 10).Value = txtefffrm.Text;
        Cmd.Parameters.Add("@Yearmonth", SqlDbType.Int).Value       = Convert.ToInt32(DrpLvStatus.SelectedItem.Value);
        SqlDataAdapter Da = new SqlDataAdapter(Cmd);
        DataSet        ds = new DataSet();

        Da.Fill(ds);
        if (ds.Tables[0].Rows.Count == 0)
        {
            GridExtTask.DataSource = null;
            GridExtTask.DataBind();
            HideControls();
            return;
        }
        else
        {
            GridExtTask.DataSource = ds.Tables[0];
            GridExtTask.DataBind();
            VisibleControls();
        }
    }
Exemple #3
0
    protected void lnkapply_Click(object sender, EventArgs e)
    {
        try
        {
            DataList2.DataSource = null;
            DataList2.DataBind();
            GridExtTask.DataSource = null;
            GridExtTask.DataBind();

            string CodeYearmonth = Session["empcode"].ToString().Trim() + DrpLvStatus.SelectedItem.Value.Trim();
            BindUploadedDocs();
            FetchRecordPending();
        }
        catch (Exception ex)
        {
            string script = "alert('" + ex.Message + "');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "ServerControlScript", script, true);
        }
    }
Exemple #4
0
 protected void lnkreject_Click(object sender, EventArgs e)
 {
     try
     {
         foreach (GridViewRow gvRow in GridExtTask.Rows)
         {
             //CheckBox chkRemove = (CheckBox)gvRow.FindControl("chkCheck");
             //if (chkRemove.Checked == true)
             //{
             int        rowIndex = (int)gvRow.RowIndex;
             string     AutoID   = gvRow.Cells[0].Text.Replace(" ", "");
             string     sql      = "Jct_Payroll_Authrisation_Update_Reimbursment_Reject";
             SqlCommand cmd      = new SqlCommand(sql, obj.Connection());
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.Add("@Autoid", SqlDbType.Int).Value = Convert.ToInt32(AutoID);
             cmd.Parameters.Add("@AuthorisedBy", SqlDbType.VarChar, 10).Value = Session["EmpCode"];
             cmd.Parameters.Add("@AuthFlag", SqlDbType.Char).Value            = 'C';
             cmd.Parameters.Add("@Param", SqlDbType.VarChar, 20).Value        = DrpLvStatus.SelectedItem.Value;
             cmd.Parameters.Add("@Remarks", SqlDbType.VarChar, 100).Value     = ddlReasonReject.SelectedItem.Value;
             cmd.ExecuteNonQuery();
             GridExtTask.DataSource = null;
             GridExtTask.DataBind();
             DataList2.DataSource = null;
             DataList2.DataBind();
             HideControls();
             SendmailCancel(Convert.ToInt32(AutoID));
             GetNextRecord();
             //}
         }
         //string script = "alert('Reimbursement For The Month Of " + DrpLvStatus.SelectedItem.Value + " Successfully Rejected..');";
         string script = "alert('Record Successfully Rejected..');";
         ScriptManager.RegisterStartupScript(this, this.GetType(), "ServerControlScript", script, true);
         return;
     }
     catch (Exception ex)
     {
         string script = "alert('" + ex.Message + "');";
         ScriptManager.RegisterStartupScript(this, this.GetType(), "ServerControlScript", script, true);
     }
 }