Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataView dv3 = (DataView)SqlCheck.Select(new DataSourceSelectArguments());

            if (dv3.Count == 1)
            {
                Response.Write("<script>alert('This Room is already booked by You')</script>");
                Server.Transfer("SearchRoom.aspx");
            }
            hfStatus.Value = "Yes";
            DataView dv = (DataView)SqlCounter.Select(new DataSourceSelectArguments());

            if (dv.Count == 1)
            {
                String n = (String)dv[0][0];
                int    m = int.Parse(n);
                m = m + 1;
                String c = Convert.ToString(m);
                hfCounter.Value = c;
                SqlCounter.Update();
            }
            DataView dv1 = (DataView)SqlDisplayDetails1.Select(new DataSourceSelectArguments());

            if (dv1.Count == 1)
            {
                String n = (String)dv1[0][0];
                if (n.Equals("No"))
                {
                    lbl.Text = "This Room is already Booked But it is not confirmed by the Landlord. If You want to Book this Room then Click on the 'BookMyRoom' button below and Go to Landlord and Confirm your Booking as early as possible.";
                }
            }
        }
Exemplo n.º 2
0
 public void SqlDeleteAll(string sql, SqlCheck sqlCheck)
 {
     if (mapping.SqlDeleteAll == null)
     {
         mapping.sqldeleteall = new HbmCustomSQL();
     }
     mapping.sqldeleteall.Text           = new[] { sql };
     mapping.sqldeleteall.checkSpecified = true;
     mapping.sqldeleteall.check          = sqlCheck.ToHbmSqlCheck();
 }
Exemplo n.º 3
0
 public void SqlUpdate(string sql, SqlCheck sqlCheck)
 {
     if (mapping.SqlUpdate == null)
     {
         mapping.sqlupdate = new HbmCustomSQL();
     }
     mapping.sqlupdate.Text           = new[] { sql };
     mapping.sqlupdate.checkSpecified = true;
     mapping.sqlupdate.check          = sqlCheck.ToHbmSqlCheck();
 }
Exemplo n.º 4
0
 public void SqlInsert(string sql, SqlCheck sqlCheck)
 {
     if (mapping.SqlInsert == null)
     {
         mapping.sqlinsert = new HbmCustomSQL();
     }
     mapping.sqlinsert.Text           = new[] { sql };
     mapping.sqlinsert.checkSpecified = true;
     mapping.sqlinsert.check          = sqlCheck.ToHbmSqlCheck();
 }
Exemplo n.º 5
0
 public void SqlDelete(string sql, SqlCheck sqlCheck)
 {
     if (classMapping.SqlDelete == null)
     {
         classMapping.sqldelete = new HbmCustomSQL();
     }
     classMapping.sqldelete.Text           = new[] { sql };
     classMapping.sqldelete.checkSpecified = true;
     classMapping.sqldelete.check          = sqlCheck.ToHbmSqlCheck();
 }
Exemplo n.º 6
0
 public void SqlInsert(string sql, SqlCheck sqlCheck)
 {
     if (hbmJoin.SqlInsert == null)
     {
         hbmJoin.sqlinsert = new HbmCustomSQL();
     }
     hbmJoin.sqlinsert.Text           = new[] { sql };
     hbmJoin.sqlinsert.checkSpecified = true;
     hbmJoin.sqlinsert.check          = sqlCheck.ToHbmSqlCheck();
 }
Exemplo n.º 7
0
 public void SqlDelete(string sql, SqlCheck sqlCheck)
 {
     if (hbmJoin.SqlDelete == null)
     {
         hbmJoin.sqldelete = new HbmCustomSQL();
     }
     hbmJoin.sqldelete.Text           = new[] { sql };
     hbmJoin.sqldelete.checkSpecified = true;
     hbmJoin.sqldelete.check          = sqlCheck.ToHbmSqlCheck();
 }
Exemplo n.º 8
0
 /// <summary>
 /// Query
 /// 根据条件查询。
 /// </summary>
 /// <typeparam name="TEntity">类型参数</typeparam>
 /// <param name="connection">DbConnection</param>
 /// <param name="predicate">条件表达式目录树</param>
 /// <returns>TEntity 集合</returns>
 public static IEnumerable <TEntity> Query <TEntity>(this IDbConnection connection, Expression <Func <TEntity, bool> > predicate)
 {
     try
     {
         if (SqlCheck.Check <TEntity>(predicate))
         {
             DynamicParameters parameters;
             var querySQL = BuildSelectSql(predicate, out parameters);
             return(SqlMapper.Query <TEntity>(connection, querySQL, parameters));
         }
         else
         {
             return(DommelMapper.Select <TEntity>(connection, predicate));
         }
     }
     catch (Exception ex) { throw new Exception(ex.Message); }
 }
Exemplo n.º 9
0
        public static HbmCustomSQLCheck ToHbmSqlCheck(this SqlCheck check)
        {
            switch (check)
            {
            case SqlCheck.None:
                return(HbmCustomSQLCheck.None);

            case SqlCheck.RowCount:
                return(HbmCustomSQLCheck.Rowcount);

            case SqlCheck.Param:
                return(HbmCustomSQLCheck.Param);

            default:
                throw new ArgumentOutOfRangeException(nameof(check), check, null);
            }
        }
Exemplo n.º 10
0
 public void SqlDelete(string sql, SqlCheck sqlCheck)
 {
     CustomizersHolder.AddCustomizer(typeof(TEntity), (IClassMapper m) => m.SqlDelete(sql, sqlCheck));
 }
Exemplo n.º 11
0
 public void SqlInsert(string sql, SqlCheck sqlCheck)
 {
     CustomizersHolder.AddCustomizer(typeof(TEntity), (ISubclassMapper m) => m.SqlInsert(sql, sqlCheck));
 }
Exemplo n.º 12
0
 public static void SqlDeleteAll(this ICollectionSqlsMapper mapper, string sql, SqlCheck sqlCheck)
 {
     ReflectHelper
     .CastOrThrow <ICollectionSqlsWithCheckMapper>(mapper, "SqlDeleteAll with sqlCheck")
     .SqlDeleteAll(sql, sqlCheck);
 }
Exemplo n.º 13
0
 public void SqlUpdate(string sql, SqlCheck sqlCheck)
 {
     CustomizersHolder.AddCustomizer(typeof(TEntity), (IJoinAttributesMapper m) => m.SqlUpdate(sql, sqlCheck));
 }
 public static void SqlDelete(this IEntitySqlsMapper mapper, string sql, SqlCheck sqlCheck)
 {
     ReflectHelper
     .CastOrThrow <IEntitySqlsWithCheckMapper>(mapper, "SqlDelete with sqlCheck")
     .SqlDelete(sql, sqlCheck);
 }
		public void SqlDeleteAll(string sql, SqlCheck sqlCheck)
		{
			CustomizersHolder.AddCustomizer(PropertyPath, (ICollectionPropertiesMapper x) => x.SqlDeleteAll(sql, sqlCheck));
		}