Esempio n. 1
0
    private void FillEmpWiseMovementText(GridView gr)
    {
        DataTable dtMovText = new DataTable();

        dtMovText.Columns.Add("EMPID");
        dtMovText.Columns.Add("PAYID");
        dtMovText.Columns.Add("EMPLOYEE");
        dtMovText.Columns.Add("REMARKS");
        dtMovText.AcceptChanges();

        foreach (GridViewRow gRow in gr.Rows)
        {
            DataRow nRow = dtMovText.NewRow();
            nRow["EMPID"]    = gRow.Cells[1].Text.Trim();
            nRow["PAYID"]    = gRow.Cells[0].Text.Trim();
            nRow["EMPLOYEE"] = gRow.Cells[1].Text.Trim() + " " + gRow.Cells[2].Text.Trim();
            nRow["REMARKS"]  = objPayRptMgr.GetPayrollRemarks(gRow.Cells[1].Text.Trim(), ddlMonth.SelectedValue.Trim(), ddlYear.SelectedValue.Trim());
            if (Common.CheckNullString(nRow["REMARKS"].ToString().Trim()) == "")
            {
                if (gRow.Cells[0].Text.Trim() == "0")
                {
                    nRow["REMARKS"] = "Seperated effective from " + Common.DisplayDate(objPayRptMgr.GetEmpJoinOrSeperateDate(gRow.Cells[1].Text.Trim(), "SeparateDate"));
                }
            }
            dtMovText.Rows.Add(nRow);
        }
        dtMovText.AcceptChanges();

        grMoveText.DataSource = dtMovText;
        grMoveText.DataBind();
    }