Example #1
0
        public override long m_lngInsertRelation()
        {
            if (m_dtbValues.Rows.Count > 0)
            {
                for (int i = 0; i < m_dtbValues.Rows.Count; i++)
                {
                    string strSQL = strINSERT;
                    try
                    {
                        strSQL = strSQL + int.Parse(m_dtbValues.Rows[i]["SYSFROM_INT"].ToString().Trim()).ToString() + ",";
                    }
                    catch
                    {
                        strSQL = strSQL + "0,";
                    }
                    try
                    {
                        strSQL = strSQL + int.Parse(m_dtbValues.Rows[i]["ATTACHTYPE_INT"].ToString().Trim()).ToString() + ",";
                    }
                    catch
                    {
                        strSQL = strSQL + "0,";
                    }
                    strSQL = strSQL + "'" + m_dtbValues.Rows[i]["SOURCEITEMID_VCHR"].ToString().Trim() + "',";
                    strSQL = strSQL + "'" + m_dtbValues.Rows[i]["ATTACHID_VCHR"].ToString().Trim() + "')";

                    try
                    {
                        long lngRes = new clsHRPTableService().DoExcute(strSQL);
                        int  iRes   = new clsHRPTableService().intGetNewNumericID("ATTARELAID_CHR", "T_OPR_ATTACHRELATION");
                        m_dtbValues.Rows[i]["ATTARELAID_CHR"] = iRes.ToString().PadLeft(12, '0');
                    }
                    catch (Exception ex)
                    {
                        com.digitalwave.Utility.clsLogText objLog = new com.digitalwave.Utility.clsLogText();
                        try
                        {
                            objLog.LogError(ex);
                        }
                        catch {}
                    }
                }
                return(0);
            }
            else
            {
                return(-1);
            }
        }
Example #2
0
        public override long m_lngInsertRelation()
        {
            if (m_strValues.GetLength(0) > 0)
            {
                for (int i = 0; i < m_strValues.GetLength(0); i++)
                {
                    string strSQL = strINSERT;
                    try
                    {
                        strSQL = strSQL + int.Parse(m_strValues[i, 1]).ToString() + ",";
                    }
                    catch
                    {
                        strSQL = strSQL + "0,";
                    }
                    try
                    {
                        strSQL = strSQL + int.Parse(m_strValues[i, 2]).ToString() + ",";
                    }
                    catch
                    {
                        strSQL = strSQL + "0,";
                    }
                    strSQL = strSQL + "'" + m_strValues[i, 3] + "',";
                    strSQL = strSQL + "'" + m_strValues[i, 4] + "')";

                    try
                    {
                        long lngRes = new clsHRPTableService().DoExcute(strSQL);
                        int  iRes   = new clsHRPTableService().intGetNewNumericID("ATTARELAID_CHR", "T_OPR_ATTACHRELATION");
                        m_strValues[i, 0] = iRes.ToString().PadLeft(12, '0');
                    }
                    catch (Exception ex)
                    {
                        com.digitalwave.Utility.clsLogText objLog = new com.digitalwave.Utility.clsLogText();
                        try
                        {
                            objLog.LogError(ex);
                        }
                        catch {}
                    }
                }
                return(0);
            }
            else
            {
                return(-1);
            }
        }