本文整理汇总了C#中BLL.orders.GetCountByOrderNO方法的典型用法代码示例。如果您正苦于以下问题:C# BLL.orders.GetCountByOrderNO方法的具体用法?C# BLL.orders.GetCountByOrderNO怎么用?C# BLL.orders.GetCountByOrderNO使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLL.orders
的用法示例。
在下文中一共展示了BLL.orders.GetCountByOrderNO方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BathcUseOrder
public void BathcUseOrder(string jsondata, string version, string equType, string equName)
{
if (string.IsNullOrEmpty(jsondata))
{
Context.Response.Write("{\"status\":\"false\",\"data\":\"参数不能为空!\"}");
HttpContext.Current.ApplicationInstance.CompleteRequest();
return;
}
try
{
JavaScriptSerializer serializer = new JavaScriptSerializer();
Dictionary<string, object> json = (Dictionary<string, object>)serializer.DeserializeObject(jsondata);
string order_no = json["order_no"].ToString();
if (string.IsNullOrEmpty(order_no))
{
Context.Response.Write("{\"status\":\"false\",\"data\":\"对不起,订单号不能为空!\"}");
HttpContext.Current.ApplicationInstance.CompleteRequest();
return;
}
BLL.orders bll_order = new BLL.orders();
//验证票的状态是否可以进行消费
if (bll_order.ValidateOrder(order_no) == 0)
{
Context.Response.Write("{\"status\":\"false\",\"data\":\"定单未支付!\"}");
HttpContext.Current.ApplicationInstance.CompleteRequest();
return;
}
int menpiao_type = 0;
int count = 0;
object[] arrlist = ((object[])json["order_lst"]);
Dictionary<string, object> d = null;
string json_result = string.Empty;
foreach (var _item in arrlist)
{
d = (Dictionary<string, object>)_item;
int.TryParse(d["menpiao_type"].ToString(), out menpiao_type);
int.TryParse(d["count"].ToString(), out count);
//查未消费的count
int unCount = bll_order.GetCountByOrderNO(order_no, menpiao_type);
if (unCount < count)
{
//Context.Response.Write("{\"status\":\"true\",\"data\":\"" + GetMenPiaoTypeName(menpiao_type) + "的余票数量不足!" + (string.IsNullOrEmpty(json_result) ? "" : "消费明细:" + json_result.Remove(json_result.LastIndexOf(','))) + "\"}");
// HttpContext.Current.ApplicationInstance.CompleteRequest();
//return;
json_result += GetMenPiaoTypeName(menpiao_type) + "的余票数量不足!,";
continue;
}
int result = bll_order.BathcUseOrder(order_no, menpiao_type, count);
json_result += GetMenPiaoTypeName(menpiao_type) + "消费成功:" + count + "张,";
}
WriteWebServiceLog(version, equType, equName, "BathcUseOrder", "");
Context.Response.Write("{\"status\":\"true\",\"data\":\"消费明细:" + json_result.Remove(json_result.LastIndexOf(',')) + "\"}");
HttpContext.Current.ApplicationInstance.CompleteRequest();
}
catch (Exception ex)
{
WriteWebServiceLog(version, equType, equName, "BathcUseOrder", "");
Context.Response.Write("{\"status\":\"false\",\"data\":\"消费失败,请联系管理员!\"}");
HttpContext.Current.ApplicationInstance.CompleteRequest();
return;
}
}