Ejemplo n.º 1
0
    public void INSERT_EmpInfoChangeLog(GridView grEmpDesig, string strChangeType, string strInsBy, string strInsDate, string strLastUpFrom)
    {
        int i = 0;

        SqlCommand[] command = new SqlCommand[grEmpDesig.Rows.Count * 2];

        string sSeqId = Common.getMaxId("EmpInfoChangeLog", "SeqId");

        if (grEmpDesig.Rows.Count > 0)
        {
            foreach (GridViewRow gRow in grEmpDesig.Rows)
            {
                command[i] = InsertEmpInfoChangeLog(sSeqId, gRow.Cells[0].Text.Trim(), gRow.Cells[1].Text.Trim(), gRow.Cells[2].Text.Trim(),
                                                    strChangeType, strInsBy, strInsDate, strLastUpFrom);
                sSeqId = Convert.ToString(Convert.ToInt32(sSeqId) + 1);
                i++;

                command[i] = objEmpMgr.InsertEmpInfoLog(gRow.Cells[0].Text.Trim());
                i++;
            }
        }
        try
        {
            objDC.MakeTransaction(command);
        }
        catch (Exception ex)
        {
            throw (ex);
        }
        finally
        {
            command = null;
        }
    }