Exemple #1
0
        public List <GK_OA_ComBookModel> GetGK_OA_ComBookList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, string CompanyEqual, string UnitCodeEqual, string UserCodeEqual, string TelephoneEqual, string HandleTelephoneEqual, string MSNEqual, string QQEqual, string EmailEqual, string UrgePhoneEqual, string PrepField1Equal, string PrepField2Equal, string PrepField3Equal)
        {
            List <GK_OA_ComBookModel> models        = new List <GK_OA_ComBookModel>();
            GK_OA_ComBookQueryModel   objQueryModel = new GK_OA_ComBookQueryModel();

            objQueryModel.StartRecord          = StartRecord;
            objQueryModel.MaxRecords           = MaxRecords;
            objQueryModel.SortColumns          = SortColumns;
            objQueryModel.CodeEqual            = CodeEqual;
            objQueryModel.CompanyEqual         = CompanyEqual;
            objQueryModel.UnitCodeEqual        = UnitCodeEqual;
            objQueryModel.UserCodeEqual        = UserCodeEqual;
            objQueryModel.TelephoneEqual       = TelephoneEqual;
            objQueryModel.HandleTelephoneEqual = HandleTelephoneEqual;
            objQueryModel.MSNEqual             = MSNEqual;
            objQueryModel.QQEqual         = QQEqual;
            objQueryModel.EmailEqual      = EmailEqual;
            objQueryModel.UrgePhoneEqual  = UrgePhoneEqual;
            objQueryModel.PrepField1Equal = PrepField1Equal;
            objQueryModel.PrepField2Equal = PrepField2Equal;
            objQueryModel.PrepField3Equal = PrepField3Equal;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    models = new GK_OA_ComBookBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Exemple #2
0
        private List <GK_OA_ComBookModel> _Select(GK_OA_ComBookQueryModel qmObj)
        {
            List <GK_OA_ComBookModel> list    = new List <GK_OA_ComBookModel>();
            StringBuilder             builder = new StringBuilder();

            builder.Append("select * from GK_OA_ComBook ");
            builder.Append(qmObj.QueryConditionStr);
            if (qmObj.SortColumns.Length == 0)
            {
                builder.Append(" ORDER BY Code desc");
            }
            else
            {
                builder.Append(" ORDER BY " + qmObj.SortColumns);
            }
            this._DataProcess.CommandText   = builder.ToString();
            this._DataProcess.SqlParameters = qmObj.Parameters;
            SqlDataReader sqlDataReader = null;
            int           num           = 0;

            try
            {
                try
                {
                    sqlDataReader = this._DataProcess.GetSqlDataReader();
                    while (sqlDataReader.Read())
                    {
                        if ((num >= qmObj.StartRecord) && ((list.Count < qmObj.MaxRecords) || (qmObj.MaxRecords == -1)))
                        {
                            GK_OA_ComBookModel model = new GK_OA_ComBookModel();
                            this.Initialize(sqlDataReader, model);
                            list.Add(model);
                        }
                        num++;
                    }
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            finally
            {
                if (sqlDataReader != null)
                {
                    sqlDataReader.Close();
                }
            }
            return(list);
        }
Exemple #3
0
        public List <GK_OA_ComBookModel> GetGK_OA_ComBookList(GK_OA_ComBookQueryModel QueryModel)
        {
            List <GK_OA_ComBookModel> models = new List <GK_OA_ComBookModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    if (QueryModel == null)
                    {
                        QueryModel = new GK_OA_ComBookQueryModel();
                    }
                    models = new GK_OA_ComBookBLL().GetModels(QueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Exemple #4
0
 public List <GK_OA_ComBookModel> Select(GK_OA_ComBookQueryModel qmObj)
 {
     return(this._Select(qmObj));
 }
Exemple #5
0
        public List <GK_OA_ComBookModel> Select()
        {
            GK_OA_ComBookQueryModel qmObj = new GK_OA_ComBookQueryModel();

            return(this._Select(qmObj));
        }
Exemple #6
0
        public List <GK_OA_ComBookModel> GetModels(GK_OA_ComBookQueryModel ObjQueryModel, SqlTransaction Transaction)
        {
            GK_OA_ComBookDAL kdal = new GK_OA_ComBookDAL(Transaction);

            return(kdal.Select(ObjQueryModel));
        }