1, public decimal getTotal()
{
decimal TotalMoney1 = 0;
string strCmd = "select bm from orders where AccountID=@AccountID and LendTime<=@LendTime and keep1=1";//and State=2 ";
SqlParameter[] paras = {
new SqlParameter("@AccountID",Request.QueryString["AccountId"].ToString()),
new SqlParameter("@LendTime",new DateTime(DateTime.Now.Year,DateTime.Now.Month,26).ToShortDateString())
};
DataSet da = HTDT.DbUtility.AosySql.ExecuteforDataSet(strCmd, CommandType.Text, paras);
if (da.Tables[0].Rows.Count > 0)
{
for (int i = 0; i < da.Tables[0].Rows.Count; i++)
{
TotalMoney1 += Convert.ToDecimal(da.Tables[0].Rows[i]["bm"].ToString());
}
}
return TotalMoney1;
}
2,if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
{Label lblOfZhaiqian = e.Item.FindControl("zhaiquan") as Label;
decimal moenyzhaiqian = Convert.ToDecimal(lblOfZhaiqian.Text.ToString());
totalMoneyOfBorrow += moenyzhaiqian;
totalMoneyOfTranfer += moenyzhaiqian;
}
if (e.Item.ItemType == ListItemType.Footer)
{
Label lblOfTransFer = e.Item.FindControl("lblOfTransFer") as Label;
Label lblOfMoney = e.Item.FindControl("lblOfMoney") as Label;
lblOfTransFer.Text = String.Format("{0:f2}", totalMoneyOfBorrow);
lblOfMoney.Text = String.Format("{0:f2}", totalMoneyOfTranfer);
}
3, try
{
List<string> SqlStr = new List<string>();
string sqlUpDate = "update HT_Customer set UpgradeImg='" + UpImage + "' Where AccountID='" + ProductNum + "'";
//string sqlUpdate1 = "update HT_ProductOrder set IsApplyForSuccess=1 where FK_Customer_Id in (select ID from HT_Customer where AccountID='" + Request.QueryString["AccountId"].ToString() + "')";
int countRow = 0;
for (int i = 0; i < HT_ApplyForProduct.Rows.Count; i++)
{
CheckBox ck = (CheckBox)HT_ApplyForProduct.Rows[i].FindControl("selectid");
if (ck.Checked)
{
Label lblLendNum = HT_ApplyForProduct.Rows[i].FindControl("lblLendNum") as Label;
string sql = " update HT_ProductOrder set IsApplyForSuccess=1 where lendNum='" + lblLendNum.Text + "'";
string sql2 = "update HT_ProductOrder set keep2='2' where Substring(lendNum,0,17)=" + lblLendNum.Text.Substring(0, 16);
SqlStr.Add(sql);
SqlStr.Add(sql2);
countRow++;
}
}
if (countRow < 2)
{
Msg.Show("请正确选择升级产品!");
return;
}
SqlStr.Add(sqlUpDate);
//SqlStr.Add(sqlUpdate1);
int count = HTDT.DbUtility.AosySql.ExecuteListSQL(SqlStr);
if (SqlStr.Count == count)
{
Msg.ShowAndRedirect("成功!", "../HT_Mangge/Manage_HT_ProductOrderForBackMoney.aspx?AccountId=" + Request.QueryString["AccountId"].ToString());
}
else
{
Msg.Show("失败!");
}