public void BindInfo() { PropID = Utility.Common.GetStringOfUrl("id").ToString(); DataRow dr = new BLL.DaoJu().GetInfo(Utility.Common.SqlEncode(PropID)); if (dr != null) { PropName = dr["PropName"].ToString(); PropDesc = dr["Descript"].ToString(); } }
public void BindInfo() { PropID = Utility.Common.GetStringOfUrl( "id" ).ToString(); DataRow dr = new BLL.DaoJu().GetInfo( Utility.Common.SqlEncode( PropID ) ); if( dr != null ) { PropName = dr["PropName"].ToString(); PropDesc = dr["Descript"].ToString(); } }
public void BindDaoJu() { //DataTable dt = new BLL.DaoJu().List(0); //rpDaoJu.DataSource = dt.DefaultView; //rpDaoJu.DataBind(); string where = string.Empty; int counts; DataTable dt = new BLL.DaoJu().PagerList(/*WebPager1.PageSize, WebPager1.CurrentPageIndex,*/ anpPageIndex.PageSize, PageIndex, out counts, " and proptype=0"); anpPageIndex.CurrentPageIndex = PageIndex; anpPageIndex.RecordCount = counts; rpDaoJu.DataSource = dt.DefaultView; rpDaoJu.DataBind(); }
public void BindPropFasci() { UserFasci = new BLL.Member().GetUserFasci(UiCommon.UserLoginInfo.UserID); DataTable dt = new BLL.DaoJu().GetInfoOfPropFasci(); if (dt != null) { this.ddlType.Items.Clear(); for (int i = 0; i < dt.Rows.Count; i++) { this.ddlType.Items.Add(new ListItem(dt.Rows[i]["Title"].ToString(), dt.Rows[i]["ID"].ToString())); } rptList.DataSource = dt; rptList.DataBind(); } }
protected void button5_ServerClick( object sender, EventArgs e ) { if( !CommonManager.Web.CheckPostSource() ) { return; } int pPrice = 0, pFasci = 0; int clearFasci = 0, afterFasci = 0; if( UserFasci >= 0 ) { lblMsg.Text = "ֻ������ֵС����ʱ���ſ��Թ���ʹ�ô˵��ߣ�"; return; } int iPropID = Convert.ToInt32( ddlType.SelectedValue );//����ID�� DataRow dr = new BLL.DaoJu().GetPropFasciForID( iPropID ); if( dr != null ) { pPrice = Convert.ToInt32( dr["Price"].ToString() );// ���۸� pFasci = Convert.ToInt32( dr["DecFasci"].ToString() );//������������������� } //�ж����е�Ǯ�Ƿ��㹻 Int64 bankMoney = new BLL.Member().GetBankMoney( UiCommon.UserLoginInfo.UserID ); if( bankMoney < pPrice ) { lblMsg.Text = "�������е�" + UiCommon.StringConfig.MoneyName + "���㣬���ֵ���ٹ���"; return; } int iLeaveFasci = UserFasci + pFasci; if( iLeaveFasci <= 0 ) { clearFasci = pFasci;//����������ֵ���� afterFasci = iLeaveFasci; } else { clearFasci = pFasci - iLeaveFasci;//����������ֵ���� afterFasci = 0; } //int iRows = new BLL.Member().BuyPropFasci( UiCommon.UserLoginInfo.UserID, iPropID, pPrice, clearFasci, UserFasci, afterFasci ); Dictionary<string, object> dic = new Dictionary<string, object>(); DbSession.Default.FromProc( "Web_pClearFasciPropBuyLog" ) .AddInputParameter( "@UserID", DbType.String, UiCommon.UserLoginInfo.UserID ) .AddInputParameter( "@FasciPropID", DbType.String, iPropID ) .AddReturnValueParameter( "@ReturnValue", DbType.Int32 ) .Execute( out dic ); if( dic.Count > 0 ) { string mgs = ""; switch( (int)dic["ReturnValue"] ) { case 1: mgs = "ʹ�óɹ������Ѿ�������" + clearFasci + "������ֵ��"; break; case -9: mgs = "��Ǹ����������"; break; case -8: mgs = "��Ǹ���û������ڣ�"; break; case -7: mgs = "��Ǹ����������߲����ڣ�"; break; case -6: mgs = "��Ǹ������ֵ������С������ܹ�ִ�����������"; break; default: mgs = "��Ǹ������ʧ�ܣ����ܷ�����æ�����Ժ����ԣ�"; break; } CommonManager.Web.RegJs( this, "alert('" + mgs + "');location.href=location.href;", true ); } else { CommonManager.Web.RegJs( this, "alert('��Ǹ������ʧ�ܣ����ܷ�����æ�����Ժ����ԣ�');location.href=location.href;", true ); } }
public void BindPropFasci() { UserFasci = new BLL.Member().GetUserFasci( UiCommon.UserLoginInfo.UserID ); DataTable dt = new BLL.DaoJu().GetInfoOfPropFasci(); if( dt != null ) { this.ddlType.Items.Clear(); for( int i = 0; i < dt.Rows.Count; i++ ) { this.ddlType.Items.Add( new ListItem( dt.Rows[i]["Title"].ToString(), dt.Rows[i]["ID"].ToString() ) ); } rptList.DataSource = dt; rptList.DataBind(); } }
protected void button5_ServerClick(object sender, EventArgs e) { if (!CommonManager.Web.CheckPostSource()) { return; } int pPrice = 0, pFasci = 0; int clearFasci = 0, afterFasci = 0; if (UserFasci >= 0) { lblMsg.Text = "只有魅力值小于零时,才可以购买并使用此道具!"; return; } int iPropID = Convert.ToInt32(ddlType.SelectedValue); //道具ID号 DataRow dr = new BLL.DaoJu().GetPropFasciForID(iPropID); if (dr != null) { pPrice = Convert.ToInt32(dr["Price"].ToString()); // 道具价格 pFasci = Convert.ToInt32(dr["DecFasci"].ToString()); //道具能清除的魅力点数 } //判断银行的钱是否足够 Int64 bankMoney = new BLL.Member().GetBankMoney(UiCommon.UserLoginInfo.UserID); if (bankMoney < pPrice) { lblMsg.Text = "您银行中的" + UiCommon.StringConfig.MoneyName + "不足,请充值后再购买!"; return; } int iLeaveFasci = UserFasci + pFasci; if (iLeaveFasci <= 0) { clearFasci = pFasci; //已清掉的魅力值点数 afterFasci = iLeaveFasci; } else { clearFasci = pFasci - iLeaveFasci; //已清掉的魅力值点数 afterFasci = 0; } //int iRows = new BLL.Member().BuyPropFasci( UiCommon.UserLoginInfo.UserID, iPropID, pPrice, clearFasci, UserFasci, afterFasci ); Dictionary <string, object> dic = new Dictionary <string, object>(); DbSession.Default.FromProc("Web_pClearFasciPropBuyLog") .AddInputParameter("@UserID", DbType.String, UiCommon.UserLoginInfo.UserID) .AddInputParameter("@FasciPropID", DbType.String, iPropID) .AddReturnValueParameter("@ReturnValue", DbType.Int32) .Execute(out dic); if (dic.Count > 0) { string mgs = ""; switch ((int)dic["ReturnValue"]) { case 1: mgs = "使用成功!您已经清零了" + clearFasci + "点魅力值。"; break; case -9: mgs = "抱歉,参数有误!"; break; case -8: mgs = "抱歉,用户不存在!"; break; case -7: mgs = "抱歉,该清零道具不存在!"; break; case -6: mgs = "抱歉,魅力值必须是小于零才能够执行清零操作!"; break; default: mgs = "抱歉,操作失败,可能服务器忙,请稍候再试!"; break; } CommonManager.Web.RegJs(this, "alert('" + mgs + "');location.href=location.href;", true); } else { CommonManager.Web.RegJs(this, "alert('抱歉,操作失败,可能服务器忙,请稍候再试!');location.href=location.href;", true); } }
public void BindDaoJu() { //DataTable dt = new BLL.DaoJu().List(0); //rpDaoJu.DataSource = dt.DefaultView; //rpDaoJu.DataBind(); string where = string.Empty; int counts; DataTable dt = new BLL.DaoJu().PagerList(/*WebPager1.PageSize, WebPager1.CurrentPageIndex,*/ anpPageIndex.PageSize, PageIndex, out counts, " and proptype=0" ); anpPageIndex.CurrentPageIndex = PageIndex; anpPageIndex.RecordCount = counts; rpDaoJu.DataSource = dt.DefaultView; rpDaoJu.DataBind(); }