示例#1
0
        public string InsertUpdate(IMPORT_SCHEMAInfo obj)
        {
            string sErr = "";

            if (IsExist(
                    obj.CONN_ID,
                    obj.SCHEMA_ID
                    ))
            {
                sErr = Update(obj);
            }
            else
            {
                Add(obj, ref sErr);
            }
            return(sErr);
        }
示例#2
0
        protected override object GetDataFromDataRow(DataTable dt, int i)
        {
            IMPORT_SCHEMAInfo result = new IMPORT_SCHEMAInfo();

            result.CONN_ID       = (dt.Rows[i][IMPORT_SCHEMAInfo.Field.CONN_ID.ToString()] == DBNull.Value ? "" : Convert.ToString(dt.Rows[i][IMPORT_SCHEMAInfo.Field.CONN_ID.ToString()]));
            result.SCHEMA_ID     = (dt.Rows[i][IMPORT_SCHEMAInfo.Field.SCHEMA_ID.ToString()] == DBNull.Value ? "" : Convert.ToString(dt.Rows[i][IMPORT_SCHEMAInfo.Field.SCHEMA_ID.ToString()]));
            result.LOOK_UP       = (dt.Rows[i][IMPORT_SCHEMAInfo.Field.LOOK_UP.ToString()] == DBNull.Value ? "" : Convert.ToString(dt.Rows[i][IMPORT_SCHEMAInfo.Field.LOOK_UP.ToString()]));
            result.DESCRIPTN     = (dt.Rows[i][IMPORT_SCHEMAInfo.Field.DESCRIPTN.ToString()] == DBNull.Value ? "" : Convert.ToString(dt.Rows[i][IMPORT_SCHEMAInfo.Field.DESCRIPTN.ToString()]));
            result.FIELD_TEXT    = (dt.Rows[i][IMPORT_SCHEMAInfo.Field.FIELD_TEXT.ToString()] == DBNull.Value ? "" : Convert.ToString(dt.Rows[i][IMPORT_SCHEMAInfo.Field.FIELD_TEXT.ToString()]));
            result.DB            = (dt.Rows[i][IMPORT_SCHEMAInfo.Field.DB.ToString()] == DBNull.Value ? "" : Convert.ToString(dt.Rows[i][IMPORT_SCHEMAInfo.Field.DB.ToString()]));
            result.DAG           = (dt.Rows[i][IMPORT_SCHEMAInfo.Field.DAG.ToString()] == DBNull.Value ? "" : Convert.ToString(dt.Rows[i][IMPORT_SCHEMAInfo.Field.DAG.ToString()]));
            result.SCHEMA_STATUS = (dt.Rows[i][IMPORT_SCHEMAInfo.Field.SCHEMA_STATUS.ToString()] == DBNull.Value ? "" : Convert.ToString(dt.Rows[i][IMPORT_SCHEMAInfo.Field.SCHEMA_STATUS.ToString()]));
            result.UPDATED       = (dt.Rows[i][IMPORT_SCHEMAInfo.Field.UPDATED.ToString()] == DBNull.Value ? 0 : Convert.ToInt32(dt.Rows[i][IMPORT_SCHEMAInfo.Field.UPDATED.ToString()]));
            result.ENTER_BY      = (dt.Rows[i][IMPORT_SCHEMAInfo.Field.ENTER_BY.ToString()] == DBNull.Value ? "" : Convert.ToString(dt.Rows[i][IMPORT_SCHEMAInfo.Field.ENTER_BY.ToString()]));
            result.DEFAULT_CONN  = (dt.Rows[i][IMPORT_SCHEMAInfo.Field.DEFAULT_CONN.ToString()] == DBNull.Value ? "" : Convert.ToString(dt.Rows[i][IMPORT_SCHEMAInfo.Field.DEFAULT_CONN.ToString()]));

            return(result);
        }
示例#3
0
        /// <summary>
        /// Return 1: Table is exist Identity Field
        /// Return 0: Table is not exist Identity Field
        /// Return -1: Erro
        /// </summary>
        /// <param name="tableName"></param>
        public Int32 Add(IMPORT_SCHEMAInfo objEntr, ref string sErr)
        {
            int ret = -1;

            connect();
            InitSPCommand(_strSPInsertName);
            AddParameter(IMPORT_SCHEMAInfo.Field.CONN_ID.ToString(), objEntr.CONN_ID);
            AddParameter(IMPORT_SCHEMAInfo.Field.SCHEMA_ID.ToString(), objEntr.SCHEMA_ID);
            AddParameter(IMPORT_SCHEMAInfo.Field.LOOK_UP.ToString(), objEntr.LOOK_UP);
            AddParameter(IMPORT_SCHEMAInfo.Field.DESCRIPTN.ToString(), objEntr.DESCRIPTN);
            AddParameter(IMPORT_SCHEMAInfo.Field.FIELD_TEXT.ToString(), objEntr.FIELD_TEXT);
            AddParameter(IMPORT_SCHEMAInfo.Field.DB.ToString(), objEntr.DB);
            AddParameter(IMPORT_SCHEMAInfo.Field.DAG.ToString(), objEntr.DAG);
            AddParameter(IMPORT_SCHEMAInfo.Field.SCHEMA_STATUS.ToString(), objEntr.SCHEMA_STATUS);
            AddParameter(IMPORT_SCHEMAInfo.Field.UPDATED.ToString(), objEntr.UPDATED);
            AddParameter(IMPORT_SCHEMAInfo.Field.ENTER_BY.ToString(), objEntr.ENTER_BY);
            AddParameter(IMPORT_SCHEMAInfo.Field.DEFAULT_CONN.ToString(), objEntr.DEFAULT_CONN);

            try
            {
                //command.ExecuteNonQuery();
                object tmp = executeSPScalar();
                if (tmp != null && tmp != DBNull.Value)
                {
                    ret = Convert.ToInt32(tmp);
                }
                else
                {
                    ret = 0;
                }
            }
            catch (Exception ex)
            {
                sErr = ex.Message;
            }
            disconnect();
            if (sErr != "")
            {
                ErrorLog.SetLog(sErr);
            }

            return(ret);
        }
示例#4
0
        private string CreateWhereClause(IMPORT_SCHEMAInfo obj)
        {
            String result = "";

            return(result);
        }
示例#5
0
 public string Update(IMPORT_SCHEMAInfo obj)
 {
     return(_objDAO.Update(obj));
 }
示例#6
0
 public Int32 Add(IMPORT_SCHEMAInfo obj, ref string sErr)
 {
     return(_objDAO.Add(obj, ref sErr));
 }
示例#7
0
        public string TransferIn(DataRow row)
        {
            IMPORT_SCHEMAInfo inf = new IMPORT_SCHEMAInfo(row);

            return(InsertUpdate(inf));
        }
示例#8
0
        public DataTable ToTransferInStruct()
        {
            IMPORT_SCHEMAInfo inf = new IMPORT_SCHEMAInfo();

            return(inf.ToDataTable());
        }
示例#9
0
 public DataTableCollection Get_Page(IMPORT_SCHEMAInfo obj, string orderBy, int pageIndex, int pageSize, ref String sErr)
 {
     return(_objDAO.Get_Page(obj, orderBy, pageIndex, pageSize, ref sErr));
 }