/// <summary> /// 统计发送的计费情况 /// </summary> /// <param name="sellerNick"></param> /// <returns></returns> public static DataTable GetMsgSendJifen(string startTime, string endTime) { DataTable dtTwo = MsgDAL.GetTwo(); DataTable dt = MsgDAL.GetMsgSendCount(startTime, endTime); MsgDAL.DeleteMsgRecords(); for (int i = 0; i < dt.Rows.Count; i++) { int j = 0; if (CheckTwo(dtTwo, dt.Rows[i]["sellernick"].ToString(), ref j)) { //获取卖家购买的短信包 DataTable dt1 = MsgDAL.GetMsgHisByNick(dt.Rows[i]["sellernick"].ToString()); if (dt1.Rows.Count >= 2) { if (dt1.Rows[1]["packageName"].ToString() == "店铺管家短信套餐(淘宝)200000条") { bool re = MsgDAL.InsertMsgRecords(dt.Rows[i]["sellernick"].ToString(), dt.Rows[i]["msgCount"].ToString(), (Convert.ToInt32(dt.Rows[i]["msgCount"]) * 0.034).ToString(), "3.4分/条"); } } else { if (((Convert.ToInt32(dt.Rows[i]["msgCount"])) + Convert.ToInt32(dtTwo.Rows[j]["msgCanUseCount"])) > 200000) { int price_35 = (((Convert.ToInt32(dt.Rows[i]["msgCount"])) + Convert.ToInt32(dtTwo.Rows[j]["msgCanUseCount"])) - 200000); int price_34 = (Convert.ToInt32(dt.Rows[i]["msgCount"])) - price_35; bool re = MsgDAL.InsertMsgRecords(dt.Rows[i]["sellernick"].ToString(), dt.Rows[i]["msgCount"].ToString(), (price_34 * 0.034 + price_35 * 0.035).ToString(), price_34 + "条 3.4分/条," + price_35 + "条 3.5分/条,"); } else { bool re = MsgDAL.InsertMsgRecords(dt.Rows[i]["sellernick"].ToString(), dt.Rows[i]["msgCount"].ToString(), (Convert.ToInt32(dt.Rows[i]["msgCount"]) * 0.034).ToString(), "3.4分/条"); } } } else { bool re = MsgDAL.InsertMsgRecords(dt.Rows[i]["sellernick"].ToString(), dt.Rows[i]["msgCount"].ToString(), (Convert.ToInt32(dt.Rows[i]["msgCount"]) * 0.035).ToString(), "3.5分/条"); } } //MsgDAL.InsertMsgRecords(); return(MsgDAL.GetMsgRecords("")); }
public static DataTable GetMsgHisByNick(string sellerNick) { return(MsgDAL.GetMsgHisByNick(sellerNick)); }