Ejemplo n.º 1
0
        public DataTable GetALL_CoreQDD_By_QD_ID(
            String DTB,
            String QD_ID

            , ref string sErr)
        {
            CoreQDDInfo objEntr = new CoreQDDInfo();
            DataTable   list    = new DataTable();

            try
            {
                connect();
                InitSPCommand(_strSPGetAllName_By_QD_ID);
                AddParameter("DTB", DTB);
                AddParameter("QD_ID", QD_ID);
                list = executeSelectSP(command);
            }
            catch (Exception ex)
            {
                sErr = ex.Message;
            }
            finally
            {
                disconnect();
            }


            //if (dr != null) list = CBO.FillCollection(dr, ref list);
            if (sErr != "")
            {
                CoreErrorLog.SetLog(sErr);
            }
            return(list);
        }
Ejemplo n.º 2
0
        public DataTableCollection Get_Page(CoreQDDInfo obj, string orderBy, int pageIndex, int pageSize, ref String sErr)
        {
            string whereClause         = CreateWhereClause(obj);
            DataTableCollection dtList = null;

            try
            {
                connect();
                InitSPCommand(_strSPGetPages);

                AddParameter("WhereClause", whereClause);
                AddParameter("OrderBy", orderBy);
                AddParameter("PageIndex", pageIndex);
                AddParameter("PageSize", pageSize);


                dtList = executeCollectSelectSP();
            }
            catch (Exception ex)
            {
                sErr = ex.Message;
            }
            disconnect();
            if (sErr != "")
            {
                CoreErrorLog.SetLog(sErr);
            }
            return(dtList);
        }
Ejemplo n.º 3
0
 public void InsertUpdate_CoreQD(CoreQDDInfo qddInfo, ref string sErr)
 {
     if (IsExist_CoreQDD(qddInfo.DTB, qddInfo.QD_ID, qddInfo.QDD_ID))
     {
         Update_CoreQDD(qddInfo);
     }
     else
     {
         Add_CoreQDD(qddInfo, ref sErr);
     }
 }
Ejemplo n.º 4
0
        public void TransferIn(DataRow row, ref string sErr)
        {
            CoreQDInfo qdInfo = new CoreQDInfo(row);

            InsertUpdate_CoreQD(qdInfo, ref sErr);
            CoreQDDInfo qddInfo = new CoreQDDInfo();

            qddInfo.GetTransferIn(row);
            CoreQDDControl qddCtr = new CoreQDDControl();

            qddCtr.InsertUpdate_CoreQD(qddInfo, ref sErr);
        }
Ejemplo n.º 5
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_CoreQDD(CoreQDDInfo objEntr, ref string sErr)
        {
            int ret = -1;

            try
            {
                connect();
                InitSPCommand(_strSPInsertName);
                AddParameter("DTB", objEntr.DTB);
                AddParameter("QD_ID", objEntr.QD_ID);
                AddParameter("QDD_ID", objEntr.QDD_ID);
                AddParameter("CODE", objEntr.CODE);
                AddParameter("DESCRIPTN", objEntr.DESCRIPTN);
                AddParameter("F_TYPE", objEntr.F_TYPE);
                AddParameter("SORTING", objEntr.SORTING);
                AddParameter("AGREGATE", objEntr.AGREGATE);
                AddParameter("EXPRESSION", objEntr.EXPRESSION);
                AddParameter("FILTER_FROM", objEntr.FILTER_FROM);
                AddParameter("FILTER_TO", objEntr.FILTER_TO);
                AddParameter("IS_FILTER", objEntr.IS_FILTER);


                //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 != "")
            {
                CoreErrorLog.SetLog(sErr);
            }

            return(ret);
        }
Ejemplo n.º 6
0
        protected override object GetDataFromDataRow(DataTable dt, int i)
        {
            CoreQDDInfo result = new CoreQDDInfo();

            result.DTB         = (dt.Rows[i]["DTB"] == DBNull.Value ? "" : (String)dt.Rows[i]["DTB"]);
            result.QD_ID       = (dt.Rows[i]["QD_ID"] == DBNull.Value ? "" : (String)dt.Rows[i]["QD_ID"]);
            result.QDD_ID      = (dt.Rows[i]["QDD_ID"] == DBNull.Value ? -1 : (Int32)dt.Rows[i]["QDD_ID"]);
            result.CODE        = (dt.Rows[i]["CODE"] == DBNull.Value ? "" : (String)dt.Rows[i]["CODE"]);
            result.DESCRIPTN   = (dt.Rows[i]["DESCRIPTN"] == DBNull.Value ? "" : (String)dt.Rows[i]["DESCRIPTN"]);
            result.F_TYPE      = (dt.Rows[i]["F_TYPE"] == DBNull.Value ? "" : (String)dt.Rows[i]["F_TYPE"]);
            result.SORTING     = (dt.Rows[i]["SORTING"] == DBNull.Value ? "" : (String)dt.Rows[i]["SORTING"]);
            result.AGREGATE    = (dt.Rows[i]["AGREGATE"] == DBNull.Value ? "" : (String)dt.Rows[i]["AGREGATE"]);
            result.EXPRESSION  = (dt.Rows[i]["EXPRESSION"] == DBNull.Value ? "" : (String)dt.Rows[i]["EXPRESSION"]);
            result.FILTER_FROM = (dt.Rows[i]["FILTER_FROM"] == DBNull.Value ? "" : (String)dt.Rows[i]["FILTER_FROM"]);
            result.FILTER_TO   = (dt.Rows[i]["FILTER_TO"] == DBNull.Value ? "" : (String)dt.Rows[i]["FILTER_TO"]);
            result.IS_FILTER   = (dt.Rows[i]["IS_FILTER"] == DBNull.Value ? true : (Boolean)dt.Rows[i]["IS_FILTER"]);

            return(result);
        }
Ejemplo n.º 7
0
        public CoreQDDInfo Get_CoreQDD(
            String DTB,
            String QD_ID,
            Int32 QDD_ID
            , ref string sErr)
        {
            CoreQDDInfo objEntr = new CoreQDDInfo();
            DataTable   list    = new DataTable();

            try
            {
                connect();
                InitSPCommand(_strSPGetName);
                AddParameter("DTB", DTB);
                AddParameter("QD_ID", QD_ID);
                AddParameter("QDD_ID", QDD_ID);


                list = executeSelectSP(command);
            }
            catch (Exception ex)
            {
                sErr = ex.Message;
            }
            disconnect();

            if (list.Rows.Count > 0)
            {
                objEntr = (CoreQDDInfo)GetDataFromDataRow(list, 0);
            }
            //if (dr != null) list = CBO.FillCollection(dr, ref list);
            if (sErr != "")
            {
                CoreErrorLog.SetLog(sErr);
            }
            return(objEntr);
        }
Ejemplo n.º 8
0
        public string Update_CoreQDD(CoreQDDInfo objEntr)
        {
            string sErr = "";

            try
            {
                connect();
                InitSPCommand(_strSPUpdateName);

                AddParameter("DTB", objEntr.DTB);
                AddParameter("QD_ID", objEntr.QD_ID);
                AddParameter("QDD_ID", objEntr.QDD_ID);
                AddParameter("CODE", objEntr.CODE);
                AddParameter("DESCRIPTN", objEntr.DESCRIPTN);
                AddParameter("F_TYPE", objEntr.F_TYPE);
                AddParameter("SORTING", objEntr.SORTING);
                AddParameter("AGREGATE", objEntr.AGREGATE);
                AddParameter("EXPRESSION", objEntr.EXPRESSION);
                AddParameter("FILTER_FROM", objEntr.FILTER_FROM);
                AddParameter("FILTER_TO", objEntr.FILTER_TO);
                AddParameter("IS_FILTER", objEntr.IS_FILTER);


                excuteSPNonQuery();
            }
            catch (Exception ex)
            {
                sErr = ex.Message;
            }
            disconnect();
            if (sErr != "")
            {
                CoreErrorLog.SetLog(sErr);
            }
            return(sErr);
        }
Ejemplo n.º 9
0
        private string CreateWhereClause(CoreQDDInfo obj)
        {
            String result = "";

            return(result);
        }
Ejemplo n.º 10
0
        /*  public string Delete_CoreQDD(String arrID)
         * {
         *    string kq = "";
         *    string[] arrStrID = arrID.Split(',');
         *    foreach (string strID in arrStrID)
         *    {
         *        if (strID != "")
         *        {
         *            int ID = Convert.ToInt32(strID);
         *            kq += _CoreQDDDAO.Delete_CoreQDD(ID);
         *        }
         *    }
         *    return kq;
         * } */

        public DataTableCollection Get_Page(CoreQDDInfo obj, string orderBy, int pageIndex, int pageSize, ref String sErr)
        {
            return(_CoreQDDDAO.Get_Page(obj, orderBy, pageIndex, pageSize, ref sErr));
        }
Ejemplo n.º 11
0
 public string Update_CoreQDD(CoreQDDInfo obj)
 {
     return(_CoreQDDDAO.Update_CoreQDD(obj));
 }
Ejemplo n.º 12
0
 public Int32 Add_CoreQDD(CoreQDDInfo obj, ref string sErr)
 {
     return(_CoreQDDDAO.Add_CoreQDD(obj, ref sErr));
 }