コード例 #1
0
        public void Load(List <ParamsVo> parameters, int mainId, string filtro)
        {
            DataTable table = select(mainId, filtro, false);

            for (int i = 0; i < table.DefaultView.Count; i++)
            {
                ParamsVo param = new ParamsVo();

                Load(param, mainId, null, table.Rows[i]);

                parameters.Add(param);
            }
        }
コード例 #2
0
        public int save(ParamsVo param)
        {
            int iRet = 0;

            if (param.ID == 0)
            {
                iRet = insert(param);
            }
            else
            {
                iRet = update(param);
            }
            return(iRet);
        }
コード例 #3
0
        public int update(ParamsVo param)
        {
            this.QUERY = new StringBuilder();

            this.addInQuery(fromDatabase);
            this.addInQuery("UPDATE params");
            this.addInQuery("   SET tamanho = " + param.TAMANHO + "");
            this.addInQuery("     , tabela  = '" + param.TABELA + "'");
            this.addInQuery("     , campo   = '" + param.CAMPO + "'");
            this.addInQuery("     , formato = '" + param.FORMATO + "'");
            this.addInQuery("     , objeto  = '" + param.OBJETO + "'");
            this.addInQuery(" WHERE id = " + param.ID);

            return(getData().DefaultView.Count);
        }
コード例 #4
0
        public int insert(ParamsVo param)
        {
            this.QUERY = new StringBuilder();

            this.addInQuery(fromDatabase);
            this.addInQuery("INSERT INTO params (mainId, tabela, campo, formato, tamanho, objeto)");
            this.QUERY.Append("VALUES (");
            this.QUERY.Append("" + param.MAINID + ",");
            this.QUERY.Append("'" + param.TABELA + "',");
            this.QUERY.Append("'" + param.CAMPO + "',");
            this.QUERY.Append("'" + param.FORMATO + "',");
            this.QUERY.Append("'" + param.TAMANHO + "',");
            this.QUERY.Append("'" + param.OBJETO + "'");
            this.QUERY.AppendLine(")");

            return(getData().DefaultView.Count);
        }
コード例 #5
0
        public void Load(ParamsVo param, int mainId, string filtro, DataRow row)
        {
            if (row == null)
            {
                DataTable dados = select(mainId, filtro, true);
                if (dados.DefaultView.Count > 0)
                {
                    row = dados.Rows[0];
                }
            }

            if (row != null)
            {
                param.MAINID = mainId;

                param.ID      = (int)row["id"];
                param.TABELA  = (string)row["tabela"];
                param.TAMANHO = (int)row["tamanho"];
                param.CAMPO   = (string)row["campo"];
                param.FORMATO = (string)row["formato"];
                param.OBJETO  = (string)row["objeto"];
            }
        }
コード例 #6
0
 public void Load(ParamsVo param, int mainId, string filtro)
 {
     Load(param, mainId, filtro, null);
 }
コード例 #7
0
 public void Load(ParamsVo param, int mainId)
 {
     Load(param, mainId, null);
 }
コード例 #8
0
 public int delete(ParamsVo param)
 {
     return(delete(param.MAINID, "id = " + param.ID));
 }