コード例 #1
0
        public static DataSet GetAdminSearch(string startDate, string endDate, int branchID)
        {
            SqlParameter[] arrParams = new SqlParameter[4];

            arrParams[0] = new SqlParameter("@startDate", GlobalUtilities.DBSafeDate(startDate));
            arrParams[1] = new SqlParameter("@endDate", GlobalUtilities.DBSafeDate(endDate)); // (string.IsNullOrEmpty(endDate) ? (object)DBNull.Value : DateTime.Parse(endDate)));
            arrParams[2] = new SqlParameter("@branchID", branchID);
            arrParams[3] = new SqlParameter("@TenID",
                                            (HttpContext.Current.Session["TenantID"] == null || HttpContext.Current.Session["TenantID"].ToString() == "" ?
                                             -1 :
                                             (int)HttpContext.Current.Session["TenantID"])
                                            );

            return(SqlHelper.ExecuteDataset(conn, CommandType.StoredProcedure, "app_Event_GetAdminSearch", arrParams));
        }
コード例 #2
0
ファイル: Event.cs プロジェクト: iafb/greatreadingadventure
        public static DataSet GetUpcomingDisplay(string startDate, string endDate, int systemID, int branchID, string searchText)
        {
            var arrParams = new List<SqlParameter>();

            arrParams.Add(new SqlParameter("@startDate", GlobalUtilities.DBSafeDate(startDate)));
            arrParams.Add(new SqlParameter("@endDate", GlobalUtilities.DBSafeDate(endDate)));
            arrParams.Add(new SqlParameter("@branchID", branchID));
            arrParams.Add(new SqlParameter("@systemID", systemID));
            if (!string.IsNullOrWhiteSpace(searchText))
            {
                arrParams.Add(new SqlParameter("@searchText",
                    new DatabaseTools().PrepareSearchString(searchText.Trim())));
            }
            arrParams.Add(new SqlParameter("@TenID",
                                (HttpContext.Current.Session["TenantID"] == null || HttpContext.Current.Session["TenantID"].ToString() == "" ?
                                        -1 :
                                        (int)HttpContext.Current.Session["TenantID"])));

            return SqlHelper.ExecuteDataset(conn,
                CommandType.StoredProcedure,
                "app_Event_GetUpcomingDisplay",
                arrParams.ToArray());
        }
コード例 #3
0
        private DataSet GetReportData()
        {
            // need to add the parameters ...

            var arrParams = new SqlParameter[4];

            if (ProgID.SelectedValue == "0")
            {
                arrParams[0] = new SqlParameter("@MGID", DBNull.Value);
            }
            else
            {
                arrParams[0] = new SqlParameter("@MGID", ProgID.SelectedValue);
            }
            if (StartDate.Text == "")
            {
                arrParams[1] = new SqlParameter("@start", DBNull.Value);
            }
            else
            {
                arrParams[1] = new SqlParameter("@start", GlobalUtilities.DBSafeDate(StartDate.Text));
            }
            if (EndDate.Text == "")
            {
                arrParams[2] = new SqlParameter("@end", DBNull.Value);
            }
            else
            {
                arrParams[2] = new SqlParameter("@end", GlobalUtilities.DBSafeDate(EndDate.Text));
            }
            arrParams[3] = new SqlParameter("@TenID", CRTenantID == null ? -1 : CRTenantID);


            var ds = SqlHelper.ExecuteDataset(conn, CommandType.StoredProcedure, "rpt_MiniGameStats", arrParams);

            return(ds);
        }