Пример #1
0
        protected override object GetDataFromDataRow(DataTable dt, int i)
        {
            CoreQDInfo result = new CoreQDInfo();

            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.DESCRIPTN   = (dt.Rows[i]["DESCRIPTN"] == DBNull.Value ? "" : (String)dt.Rows[i]["DESCRIPTN"]);
            result.OWNER       = (dt.Rows[i]["OWNER"] == DBNull.Value ? "" : (String)dt.Rows[i]["OWNER"]);
            result.SHARED      = (dt.Rows[i]["SHARED"] == DBNull.Value ? true : (Boolean)dt.Rows[i]["SHARED"]);
            result.LAYOUT      = (dt.Rows[i]["LAYOUT"] == DBNull.Value ? "" : (String)dt.Rows[i]["LAYOUT"]);
            result.ANAL_Q0     = (dt.Rows[i]["ANAL_Q0"] == DBNull.Value ? "" : (String)dt.Rows[i]["ANAL_Q0"]);
            result.ANAL_Q9     = (dt.Rows[i]["ANAL_Q9"] == DBNull.Value ? "" : (String)dt.Rows[i]["ANAL_Q9"]);
            result.ANAL_Q8     = (dt.Rows[i]["ANAL_Q8"] == DBNull.Value ? "" : (String)dt.Rows[i]["ANAL_Q8"]);
            result.ANAL_Q7     = (dt.Rows[i]["ANAL_Q7"] == DBNull.Value ? "" : (String)dt.Rows[i]["ANAL_Q7"]);
            result.ANAL_Q6     = (dt.Rows[i]["ANAL_Q6"] == DBNull.Value ? "" : (String)dt.Rows[i]["ANAL_Q6"]);
            result.ANAL_Q5     = (dt.Rows[i]["ANAL_Q5"] == DBNull.Value ? "" : (String)dt.Rows[i]["ANAL_Q5"]);
            result.ANAL_Q4     = (dt.Rows[i]["ANAL_Q4"] == DBNull.Value ? "" : (String)dt.Rows[i]["ANAL_Q4"]);
            result.ANAL_Q3     = (dt.Rows[i]["ANAL_Q3"] == DBNull.Value ? "" : (String)dt.Rows[i]["ANAL_Q3"]);
            result.ANAL_Q2     = (dt.Rows[i]["ANAL_Q2"] == DBNull.Value ? "" : (String)dt.Rows[i]["ANAL_Q2"]);
            result.ANAL_Q1     = (dt.Rows[i]["ANAL_Q1"] == DBNull.Value ? "" : (String)dt.Rows[i]["ANAL_Q1"]);
            result.SQL_TEXT    = (dt.Rows[i]["SQL_TEXT"] == DBNull.Value ? "" : (String)dt.Rows[i]["SQL_TEXT"]);
            result.HEADER_TEXT = (dt.Rows[i]["HEADER_TEXT"] == DBNull.Value ? "" : (String)dt.Rows[i]["HEADER_TEXT"]);
            result.FOOTER_TEXT = (dt.Rows[i]["FOOTER_TEXT"] == DBNull.Value ? "" : (String)dt.Rows[i]["FOOTER_TEXT"]);

            return(result);
        }
Пример #2
0
        public DataTable GetAll_CoreQD(String DTB, ref string sErr)
        {
            CoreQDInfo objEntr = new CoreQDInfo(); DataTable list = new DataTable();

            try
            {
                connect();
                InitSPCommand(_strSPGetAllName);
                AddParameter("DTB", DTB);


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


            //if (dr != null) list = CBO.FillCollection(dr, ref list);
            if (sErr != "")
            {
                CoreErrorLog.SetLog(sErr);
            }
            return(list);
        }
Пример #3
0
        public DataTableCollection Get_Page(CoreQDInfo 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);
        }
Пример #4
0
 public void InsertUpdate_CoreQD(CoreQDInfo CoreQDInfo, ref string sErr)
 {
     if (IsExist_CoreQD(CoreQDInfo.DTB, CoreQDInfo.QD_ID))
     {
         sErr = Update_CoreQD(CoreQDInfo);
     }
     else
     {
         Add_CoreQD(CoreQDInfo, ref sErr);
     }
 }
Пример #5
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);
        }
Пример #6
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_CoreQD(CoreQDInfo objEntr, ref string sErr)
        {
            int ret = -1; try

            {
                connect();
                InitSPCommand(_strSPInsertName);
                AddParameter("DTB", objEntr.DTB);
                AddParameter("QD_ID", objEntr.QD_ID);
                AddParameter("DESCRIPTN", objEntr.DESCRIPTN);
                AddParameter("OWNER", objEntr.OWNER);
                AddParameter("SHARED", objEntr.SHARED);
                AddParameter("LAYOUT", objEntr.LAYOUT);
                AddParameter("ANAL_Q0", objEntr.ANAL_Q0);
                AddParameter("ANAL_Q9", objEntr.ANAL_Q9);
                AddParameter("ANAL_Q8", objEntr.ANAL_Q8);
                AddParameter("ANAL_Q7", objEntr.ANAL_Q7);
                AddParameter("ANAL_Q6", objEntr.ANAL_Q6);
                AddParameter("ANAL_Q5", objEntr.ANAL_Q5);
                AddParameter("ANAL_Q4", objEntr.ANAL_Q4);
                AddParameter("ANAL_Q3", objEntr.ANAL_Q3);
                AddParameter("ANAL_Q2", objEntr.ANAL_Q2);
                AddParameter("ANAL_Q1", objEntr.ANAL_Q1);
                AddParameter("SQL_TEXT", objEntr.SQL_TEXT);
                AddParameter("HEADER_TEXT", objEntr.HEADER_TEXT);
                AddParameter("FOOTER_TEXT", objEntr.FOOTER_TEXT);


                //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);
        }
Пример #7
0
        public string Update_CoreQD(CoreQDInfo objEntr)
        {
            string sErr = "";

            try
            {
                connect();
                InitSPCommand(_strSPUpdateName);

                AddParameter("DTB", objEntr.DTB);
                AddParameter("QD_ID", objEntr.QD_ID);
                AddParameter("DESCRIPTN", objEntr.DESCRIPTN);
                AddParameter("OWNER", objEntr.OWNER);
                AddParameter("SHARED", objEntr.SHARED);
                AddParameter("LAYOUT", objEntr.LAYOUT);
                AddParameter("ANAL_Q0", objEntr.ANAL_Q0);
                AddParameter("ANAL_Q9", objEntr.ANAL_Q9);
                AddParameter("ANAL_Q8", objEntr.ANAL_Q8);
                AddParameter("ANAL_Q7", objEntr.ANAL_Q7);
                AddParameter("ANAL_Q6", objEntr.ANAL_Q6);
                AddParameter("ANAL_Q5", objEntr.ANAL_Q5);
                AddParameter("ANAL_Q4", objEntr.ANAL_Q4);
                AddParameter("ANAL_Q3", objEntr.ANAL_Q3);
                AddParameter("ANAL_Q2", objEntr.ANAL_Q2);
                AddParameter("ANAL_Q1", objEntr.ANAL_Q1);
                AddParameter("SQL_TEXT", objEntr.SQL_TEXT);
                AddParameter("HEADER_TEXT", objEntr.HEADER_TEXT);
                AddParameter("FOOTER_TEXT", objEntr.FOOTER_TEXT);


                excuteSPNonQuery();
            }
            catch (Exception ex)
            {
                sErr = ex.Message;
            }
            disconnect();
            if (sErr != "")
            {
                CoreErrorLog.SetLog(sErr);
            }
            return(sErr);
        }
Пример #8
0
        public DataTable GetAll_CoreQD_USER(string database, string user, ref string sErr)
        {
            CoreQDInfo objEntr = new CoreQDInfo();
            DataTable  list    = new DataTable();

            try
            {
                connect();
                InitSPCommand(_strSPGetAllByUserName);
                AddParameter("DTB", database);
                AddParameter("USER_ID", user);


                list = executeSelectSP(command);
            }
            catch (Exception ex)
            {
                sErr = ex.Message;
            }
            disconnect();
            return(list);
        }
Пример #9
0
        public CoreQDInfo Get_CoreQD(
            String DTB,
            String QD_ID
            , ref string sErr)
        {
            CoreQDInfo objEntr = new CoreQDInfo();
            DataTable  list    = new DataTable();

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



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

            if (list.Rows.Count > 0)
            {
                objEntr = (CoreQDInfo)GetDataFromDataRow(list, 0);
            }
            //if (dr != null) list = CBO.FillCollection(dr, ref list);
            if (sErr != "")
            {
                CoreErrorLog.SetLog(sErr);
            }
            return(objEntr);
        }
Пример #10
0
        private string CreateWhereClause(CoreQDInfo obj)
        {
            String result = "";

            return(result);
        }
Пример #11
0
        /*  public string Delete_CoreQD(String arrID)
         * {
         *    string kq = "";
         *    string[] arrStrID = arrID.Split(',');
         *    foreach (string strID in arrStrID)
         *    {
         *        if (strID != "")
         *        {
         *            int ID = Convert.ToInt32(strID);
         *            kq += _CoreQDDAO.Delete_CoreQD(ID);
         *        }
         *    }
         *    return kq;
         * } */

        public DataTableCollection Get_Page(CoreQDInfo obj, string orderBy, int pageIndex, int pageSize, ref String sErr)
        {
            return(_CoreQDDAO.Get_Page(obj, orderBy, pageIndex, pageSize, ref sErr));
        }
Пример #12
0
 public string Update_CoreQD(CoreQDInfo obj)
 {
     return(_CoreQDDAO.Update_CoreQD(obj));
 }
Пример #13
0
 public Int32 Add_CoreQD(CoreQDInfo obj, ref string sErr)
 {
     return(_CoreQDDAO.Add_CoreQD(obj, ref sErr));
 }