public static bool AddJifen(Jifen jifen) { try { string query = @"insert into BuyerJifen(buyer_nick,orderNo,jifenHis,jifenAmount,jifenComeFrom,createDate,sellerNick)values (@buyer_nick,@orderNo,@jifenHis,@jifenAmount,@jifenComeFrom,getdate(),@sellerNick)"; //如果第一次增加积分 int initJifen = Convert.ToInt32(GetBuyerTotalJifen(jifen.Buyer_Nick, jifen.SellerNick)); if (initJifen == 0) { initJifen = jifen.jifenHis; } else { initJifen = initJifen + jifen.jifenHis; } SqlParameter[] param = new SqlParameter[] { new SqlParameter("@buyer_nick", jifen.Buyer_Nick), new SqlParameter("@orderNo", jifen.OrderNo), new SqlParameter("@jifenHis", jifen.jifenHis), //累计买家剩余积分 new SqlParameter("@jifenAmount", initJifen), new SqlParameter("@sellerNick", jifen.SellerNick), new SqlParameter("@jifenComeFrom", jifen.JifenComeFrom) }; DataBase.ExecuteSql(query, param); return(true); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return(false); } }
/// <summary> /// 订单按日期下载 /// </summary> /// <param name="strSessionKey"></param> /// <param name="startTime"></param> /// <param name="endTime"></param> /// <param name="pageNo"></param> /// <param name="pageSize"></param> /// <param name="hasNext"></param> /// <returns></returns> public static List <Trade> GetTradeByDate(string strSessionKey, string startTime, string endTime, string pageNo, string pageSize, string buyer_nick, string type, ref Boolean hasNext) { try { ITopClient client = TBManager.GetClient(); TradesSoldGetRequest req = new TradesSoldGetRequest(); req.Fields = @"tid,type,buyer_nick,receiver_name,receiver_state,receiver_city,receiver_district,receiver_address, receiver_mobile,receiver_phone,receiver_zip,buyer_area,post_fee,created,seller_nick,payment,status,shipping_type,pay_time,modified, orders.outer_iid,orders.discount_fee,orders.payment,orders.refund_status,orders.status,orders.pic_path,orders.sku_properties_name,orders.adjust_fee, orders.outer_sku_id,orders.cid,orders.refund_id,orders.item_meal_name,orders.num,orders.title,orders.price,orders.oid,orders.total_fee,orders.num_iid,orders.sku_id,orders.seller_type"; req.StartCreated = Convert.ToDateTime(startTime); req.EndCreated = Convert.ToDateTime(endTime); req.PageSize = Convert.ToInt64(pageSize); req.PageNo = Convert.ToInt64(pageNo); if (!string.IsNullOrEmpty(buyer_nick)) { req.BuyerNick = buyer_nick; } if (!string.IsNullOrEmpty(type)) { req.Type = type; } TradesSoldGetResponse rsp = client.Execute(req, strSessionKey); hasNext = rsp.HasNext; return(rsp.Trades); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi); return(null); } }
/// <summary> /// 调用API获取会员数据 /// </summary> /// <param name="currentPage"></param> /// <param name="pagesize"></param> /// <param name="total"></param> /// <returns></returns> public List <CrmMember> GetBuyer(string strSessionKey, Int64 currentPage, Int64 pagesize, ref Int64 total) { try { if (currentPage == 0) { currentPage = 1L; } if (pagesize == 0) { pagesize = 100; } ITopClient client = TBManager.GetClient(); CrmMembersSearchRequest req = new CrmMembersSearchRequest(); //req.MaxLastTradeTime = DateTime.Now.AddMonths(-3); req.CurrentPage = currentPage; req.PageSize = pagesize; CrmMembersSearchResponse response = client.Execute(req, strSessionKey); if (response.IsError) { ExceptionReporter.WriteLog(response.SubErrMsg, ExceptionPostion.TopApi, ExceptionRank.important); } total = response.TotalResult; return(response.Members); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi); return(null); } }
public static bool UpdateOrderStatus(string orderNo, string sellerNick, string id, string status, string memo) { try { string query = @"update BatchShipping set status = @status, memo = @memo where OrderNo = @OrderNo and sellerNick = @sellerNick and id = @id"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@OrderNo", orderNo), new SqlParameter("@sellerNick", sellerNick), new SqlParameter("@id", id), new SqlParameter("@status", status), new SqlParameter("@memo", memo) }; DataBase.ExecuteSql(query, param); return(true); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return(false); } }
public static bool AddNoteTradeToDB(NotifyTrade trade) { try { string query = @"INSERT INTO NotifyTrade(tid,buyer_nick,nick,status,oid,payment,seller_nick,createDate) VALUES(@tid,@buyer_nick,@nick,@status,@oid,@payment,@seller_nick,getdate())"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@tid", trade.Tid), new SqlParameter("@buyer_nick", trade.BuyerNick), new SqlParameter("@nick", trade.SellerNick), new SqlParameter("@status", trade.Status), new SqlParameter("@oid", trade.Oid), new SqlParameter("@payment", trade.Payment), new SqlParameter("@seller_nick", trade.SellerNick) }; DataBaseTool.ExecuteSql(query, param); return(true); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return(false); } }
public static bool AddTrade(Trade o) { try { string query = @"insert into Trade(tid,title,status,buyer_nick,buyer_alipay_no,seller_nick) values(@tid,@title,@status,@buyer_nick,@buyer_alipay_no,@seller_nick)"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@tid", o.Tid), new SqlParameter("@title", o.Title == null?"":o.Title), new SqlParameter("@status", o.Status == null?"":o.Status), new SqlParameter("@buyer_nick", o.BuyerNick == null ? "":o.BuyerNick), new SqlParameter("@seller_nick", o.SellerNick == null?"":o.SellerNick), new SqlParameter("@buyer_alipay_no", o.BuyerAlipayNo == null?"":o.BuyerAlipayNo) }; DataBase.ExecuteSql(query, param); return(true); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return(false); } }
public static bool AddOrder(Order o, Int64 tid) { try { string query = @"insert into TradeOrder(oid,status,title,seller_nick,buyer_nick,tid,price,num,refund_status)values(@oid,@status,@title,@seller_nick,@buyer_nick,@tid,@price,@num,@refund_status)"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@oid", o.Oid), new SqlParameter("@status", o.Status == null?"":o.Status), new SqlParameter("@title", o.Title == null?"":o.Title), new SqlParameter("@seller_nick", o.SellerNick), new SqlParameter("@buyer_nick", o.BuyerNick == null?"":o.BuyerNick), new SqlParameter("@tid", tid), new SqlParameter("@price", o.Price == null?"":o.Price), new SqlParameter("@num", o.Num), new SqlParameter("@refund_status", o.RefundStatus == null?"":o.RefundStatus) }; DataBase.ExecuteSql(query, param); return(true); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return(false); } }
/// <summary> /// 卖家手动添加其他店铺的买家基本信息. /// </summary> /// <param name="o"></param> /// <param name="sellerID"></param> /// <returns></returns> public bool AddBuyerOtherShop(Buyers o) { try { string query = @"insert into Buyer(buyer_id,SELLER_ID,buyer_nick,province,city,address,buyer_credit,createDate,buyerType) values(@buyer_id,@SELLER_ID,@buyer_nick,@province,@city,@address,@buyer_credit,getdate(),@buyerType)"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@buyer_id", o.BuyerId), new SqlParameter("@SELLER_ID", o.SELLER_ID), new SqlParameter("@buyer_nick", o.BuyerNick), new SqlParameter("@province", o.BuyerProvince.ToString()), new SqlParameter("@city", o.City == null?"":o.City), new SqlParameter("@address", o.Address == null ? "" : o.Address), new SqlParameter("@buyerType", o.BuyerType), new SqlParameter("@buyer_credit", o.Buyer_credit == null ? "0" : o.Buyer_credit) }; DataBase.ExecuteSql(query, param); return(true); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return(false); } }
protected void ImageButton2_Click(object sender, ImageClickEventArgs e) { try { Mobile obj = new Mobile(); if (!rdoMsgTemp1.Checked && !rdoMsgTemp2.Checked && !rdoMsgTemp3.Checked && !rdoMsgTemp4.Checked) { lbMsg.Text = "请选择短信模版!"; return; } //验证测试手机号码 if (!String.IsNullOrEmpty(txtTestMsg.Text.Trim())) { if (!Utility.IsCellPhone(txtTestMsg.Text.Trim())) { lbMsg.Text = "请输入正确的手机号码!"; } else { //发送消息 string msgContent = ""; if (rdoMsgTemp1.Checked) { msgContent = rdoMsgTemp1.Text; } if (rdoMsgTemp2.Checked) { msgContent = rdoMsgTemp2.Text; } if (rdoMsgTemp3.Checked) { msgContent = rdoMsgTemp3.Text; } if (rdoMsgTemp4.Checked) { msgContent = rdoMsgTemp4.Text; } msgContent = msgContent.Replace("**店铺名称**", Session["ShopName"] == null ? "" : Session["ShopName"].ToString()) + "【" + Users.Nick + "】"; List <string> lstCellPhoneNo = new List <string>(); lstCellPhoneNo.Add(txtTestMsg.Text.Trim()); string sendStatus = Mobile.sendMsg(lstCellPhoneNo, msgContent); if (sendStatus.Equals("0"))//限制测试用户一天只能发送一次。方式利用此漏洞群发。 { lbMsg.Text = "发送成功!"; lbMsg.ForeColor = Color.Blue; txtTestMsg.Text = ""; //更新DB发送标示 } } } else { lbMsg.Text = "手机号码不能为空!"; } } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Web_UI); } }
public static bool UpdateForHistory(Buyers o) { try { string query = @"update Buyer set buyer_reallName = @buyer_reallName, cellPhone = @cellPhone, province = @province, buyer_credit = @buyer_credit, address = @address, updateDate = getdate() WHERE buyer_nick = @buyer_nick and SELLER_ID = @SELLER_ID"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@buyer_nick", o.BuyerNick == null?"":o.BuyerNick), new SqlParameter("@buyer_reallName", o.Buyer_reallName == null?"":o.Buyer_reallName), new SqlParameter("@cellPhone", o.CellPhone == null ?"":o.CellPhone), new SqlParameter("@province", o.BuyerProvince == null?"":o.BuyerProvince.ToString()), new SqlParameter("@buyer_credit", o.Buyer_credit == null?"1":o.Buyer_credit), new SqlParameter("@address", o.Address == null?"":o.Address), new SqlParameter("@SELLER_ID", o.SELLER_ID) }; DataBase.ExecuteSql(query, param); return(true); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return(false); } }
/// <summary> /// 卖家手动添加买家基本信息. /// </summary> /// <param name="o"></param> /// <param name="sellerID"></param> /// <returns></returns> public bool AddBuyerBySeller(Buyers o) { try { string query = @"insert into Buyer(buyer_id,SELLER_ID,buyer_nick,buyer_reallName,cellPhone,Phone,qq,msn,zipCode, email,sinaWeibo,qqWeibo,province,city,createDate,buyerType) values(@buyer_id,@SELLER_ID,@buyer_nick,@buyer_reallName,@cellPhone,@Phone,@qq,@msn,@zipCode, @email,@sinaWeibo,@qqWeibo,@province,@city,getdate(),@buyerType)"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@buyer_id", o.BuyerId), new SqlParameter("@SELLER_ID", o.SELLER_ID), new SqlParameter("@buyer_nick", o.BuyerNick), new SqlParameter("@buyer_reallName", o.Buyer_reallName), new SqlParameter("@cellPhone", o.CellPhone), new SqlParameter("@Phone", o.Phone), new SqlParameter("@qq", o.QQ), new SqlParameter("@msn", o.MSN), new SqlParameter("@zipCode", o.ZipCode), new SqlParameter("@email", o.Email), new SqlParameter("@sinaWeibo", o.SinaWeibo), new SqlParameter("@qqWeibo", o.QQWeibo), new SqlParameter("@province", o.BuyerProvince.ToString()), new SqlParameter("@city", o.City == null?"":o.City), new SqlParameter("@buyerType", o.BuyerType) }; DataBase.ExecuteSql(query, param); return(true); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return(false); } }
public static String GetBuyerCount(string flag, string sellerNick) { try { string query = ""; if (!string.IsNullOrEmpty(flag) && flag.Equals("1")) { query = @"select count(1) as buyerCount from Buyer where SELLER_ID = @nick"; } else { query = @"select count(1) as buyerCount from Buyer where SELLER_ID = @nick and cellPhone is not null"; } SqlParameter[] param = new SqlParameter[] { new SqlParameter("@nick", sellerNick) }; DataTable dt = DataBase.ExecuteDt(query, param, CommandType.Text); if (dt != null && dt.Rows.Count == 1) { return(dt.Rows[0]["buyerCount"].ToString()); } return("0"); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return("0"); } }
public static bool update(string sellerID, int status, int count) { try { string query = @"UPDATE [msgSending] SET [sendStaus] = @sendStaus ,[sendDate] = @sendDate ,[count] = @count WHERE sellerNick=@sellerNick"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@sellerNick", sellerID), new SqlParameter("@sendStaus", status), new SqlParameter("@count", count), new SqlParameter("@sendDate", DateTime.Now) }; DataBase.ExecuteSql(query, param); return(true); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return(false); } }
public static bool Add(string sellerID) { try { string query = @"INSERT INTO [msgSending] ([sellerNick] ,[sendStaus] ,[sendDate] ,[count]) VALUES ( @sellerNick ,0 ,@sendDate ,0)"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@sellerNick", sellerID), new SqlParameter("@sendDate", DateTime.Now) }; DataBase.ExecuteSql(query, param); return(true); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return(false); } }
/// <summary> /// 根据条件过滤需要评价的交易数据 /// </summary> /// <param name="sellerNick"></param> /// <param name="fliterRow"></param> /// <param name="startDate"></param> /// <param name="endDate"></param> /// <param name="hasNextPage"></param> /// <param name="sesionKey"></param> /// <returns></returns> public static DataTable GetRateTradeData(string sellerNick, DataRow fliterRow, DateTime startDate, DateTime endDate, string sesionKey) { try { //默认取第一页 Boolean hasNextPage = false; long pageNo = 0; //返回需要评价的交易数据源:根据保存的评价配置策略 DataTable dtAllOrder = new DataTable(); dtAllOrder.Columns.Add("tid"); dtAllOrder.Columns.Add("oid"); dtAllOrder.Columns.Add("blackBuyerRatedIsRate");//如果黑名单买家已评之后的处理方式 //取得设定条件内的订单数据 do { pageNo++; GetCanRateTID(sellerNick, fliterRow, startDate, endDate, ref hasNextPage, sesionKey, pageNo, dtAllOrder); }while (hasNextPage); return(dtAllOrder); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return(null); } }
public static bool AddTuiGuang(TuiguangPro tuiguang) { try { string query = @"insert into TuiguangPro(itemNo,sellerNick,itemPicUrl,itemTitle,itemUrl,price, inventory,tuiStatus,tuiAddress,createTime,endUseTime,openId) values(@itemNo,@sellerNick,@itemPicUrl,@itemTitle,@itemUrl,@price, @inventory,@tuiStatus,@tuiAddress,getdate(),@endUseTime,@openId)"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@itemNo", string.IsNullOrEmpty(tuiguang.ItemNo)?"":tuiguang.ItemNo), new SqlParameter("@sellerNick", string.IsNullOrEmpty(tuiguang.SellerNick)?"":tuiguang.SellerNick), new SqlParameter("@itemPicUrl", string.IsNullOrEmpty(tuiguang.ItemPicUrl)?"":tuiguang.ItemPicUrl), new SqlParameter("@itemTitle", string.IsNullOrEmpty(tuiguang.ItemTitle)?"":tuiguang.ItemTitle), new SqlParameter("@itemUrl", string.IsNullOrEmpty(tuiguang.ItemUrl)?"":tuiguang.ItemUrl), new SqlParameter("@price", string.IsNullOrEmpty(tuiguang.Price)?"":tuiguang.Price), new SqlParameter("@inventory", string.IsNullOrEmpty(tuiguang.Inventory)?"":tuiguang.Inventory), new SqlParameter("@tuiStatus", string.IsNullOrEmpty(tuiguang.TuiStatus)?"":tuiguang.TuiStatus), new SqlParameter("@tuiAddress", string.IsNullOrEmpty(tuiguang.TuiAddress)?"":tuiguang.TuiAddress), new SqlParameter("@endUseTime", string.IsNullOrEmpty(tuiguang.EndUseTime)?"":tuiguang.EndUseTime), new SqlParameter("@openId", string.IsNullOrEmpty(tuiguang.OpenId)?"":tuiguang.OpenId) }; DataBase.ExecuteSql(query, param); return(true); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return(false); } }
/// <summary> /// 刷新 /// </summary> public void ReSet() { try { //检查卖家最后一次申请状态 int status = BuyerexportBLL.CheckEndStatus(Users.SellerId); if (status == 2) { imgbtnExport.ImageUrl = "~/Win_Image/exportSucess.png"; ImageButtonCancle.Visible = false; } else if (status == 1) { imgbtnExport.ImageUrl = "~/Win_Image/exporting.png"; ImageButtonCancle.Visible = true; } else if (status == 0) { imgbtnExport.ImageUrl = "~/Win_Image/export.png"; ImageButtonCancle.Visible = false; } DataTable dt = BuyerexportBLL.GetBuyerExportAll(Users.SellerId); GridView_Jilv.DataSource = dt; GridView_Jilv.DataBind(); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Web_UI); } }
public static DataTable GetTuiGuangLog(string sellerNick, string startDate, string endDate) { try { string query = @"select * from TuiguangLog where 1 = 1 "; List <SqlParameter> list = new List <SqlParameter>(); if (!string.IsNullOrEmpty(sellerNick)) { query += " AND sellerNick = @sellerNick "; SqlParameter p1 = new SqlParameter("@sellerNick", sellerNick); list.Add(p1); } if (!string.IsNullOrEmpty(startDate)) { query += " AND createTime >= @startDate "; SqlParameter P2 = new SqlParameter("@startDate", Convert.ToDateTime(startDate)); list.Add(P2); } if (!string.IsNullOrEmpty(endDate)) { query += " AND createTime <= @endDate "; SqlParameter P3 = new SqlParameter("@endDate", Convert.ToDateTime(endDate).AddDays(1)); list.Add(P3); } query += " order by createTime desc"; SqlParameter[] strParam = list.ToArray(); DataTable dt = DataBase.ExecuteDt(query, strParam, CommandType.Text); return(dt); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return(null); } }
/// <summary> /// 查询物流未签收的买家订单 /// </summary> /// <param name="sellerNick"></param> /// <param name="status"></param> /// <returns></returns> public static DataTable GetTradeDataNoSuccess(string sellerNick, string status) { try { string query = @" select a.buyer_nick,a.tid,a.payment,a.createDate,'未签收,未收货' as stutas , b.company_name from NotifyTrade as a,tab_logistics as b where a.tid=b.tid and a.status!='taobao_trade_TradeSuccess' and b.action not in('SIGNED','TRADE_SUCCESS')"; List <SqlParameter> list = new List <SqlParameter>(); if (!string.IsNullOrEmpty(sellerNick)) { SqlParameter p1 = new SqlParameter("@nick", sellerNick); list.Add(p1); query += " and a.seller_nick =@nick"; } SqlParameter[] strParam = list.ToArray(); DataTable dt = DataBase.ExecuteDt(query, strParam, CommandType.Text); return(dt); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return(null); } }
public static bool AddDianPu(SellerShopForTuiGuang obj) { try { string query = @"insert into SellerShopForTuiGuang(sellerNick,shopName,cateName,type,address,huoyuan,hasShiTiShop,hasFactory,createTime) values(@sellerNick,@shopName,@cateName,@type,@address,@huoyuan,@hasShiTiShop,@hasFactory,getdate())"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@sellerNick", string.IsNullOrEmpty(obj.SellerNick)?"":obj.SellerNick), new SqlParameter("@shopName", string.IsNullOrEmpty(obj.ShopName)?"":obj.ShopName), new SqlParameter("@cateName", string.IsNullOrEmpty(obj.CateName)?"":obj.CateName), new SqlParameter("@type", string.IsNullOrEmpty(obj.Type)?"":obj.Type), new SqlParameter("@address", string.IsNullOrEmpty(obj.Address)?"":obj.Address), new SqlParameter("@huoyuan", string.IsNullOrEmpty(obj.Huoyuan)?"":obj.Huoyuan), new SqlParameter("@hasShiTiShop", string.IsNullOrEmpty(obj.HasShiTiShop)?"":obj.HasShiTiShop), new SqlParameter("@hasFactory", string.IsNullOrEmpty(obj.HasFactory)?"":obj.HasFactory) }; DataBase.ExecuteSql(query, param); return(true); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return(false); } }
public static bool AddBatchShipping(BatchShipping o) { try { string query = @"insert into BatchShipping(sellerNick,OrderNo,subOrderNo,yunDanNo,commpany,status,createDate) values(@sellerNick,@OrderNo,@subOrderNo,@yunDanNo,@commpany,@status,@createDate)"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@sellerNick", o.SellerNick), new SqlParameter("@OrderNo", o.OrderNo), new SqlParameter("@subOrderNo", o.SubOrderNo), new SqlParameter("@yunDanNo", o.YunDanNo), new SqlParameter("@commpany", o.Commpany), new SqlParameter("@status", o.Status), new SqlParameter("@createDate", DateTime.Now.ToShortDateString()) }; DataBase.ExecuteSql(query, param); return(true); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return(false); } }
public static bool UpdateDianPu(SellerShopForTuiGuang obj) { try { string query = @"update SellerShopForTuiGuang set shopName = @shopName,cateName = @cateName,type = @type, address = @address,huoyuan = @huoyuan,hasShiTiShop = @hasShiTiShop,hasFactory = @hasFactory where sellerNick = @sellerNick"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@sellerNick", string.IsNullOrEmpty(obj.SellerNick)?"":obj.SellerNick), new SqlParameter("@shopName", string.IsNullOrEmpty(obj.ShopName)?"":obj.ShopName), new SqlParameter("@cateName", string.IsNullOrEmpty(obj.CateName)?"":obj.CateName), new SqlParameter("@type", string.IsNullOrEmpty(obj.Type)?"":obj.Type), new SqlParameter("@address", string.IsNullOrEmpty(obj.Address)?"":obj.Address), new SqlParameter("@huoyuan", string.IsNullOrEmpty(obj.Huoyuan)?"":obj.Huoyuan), new SqlParameter("@hasShiTiShop", string.IsNullOrEmpty(obj.HasShiTiShop)?"":obj.HasShiTiShop), new SqlParameter("@hasFactory", string.IsNullOrEmpty(obj.HasFactory)?"":obj.HasFactory) }; DataBase.ExecuteSql(query, param); return(true); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return(false); } }
public static bool UpdateOrderInfo(BatchShipping o) { try { string query = @"update BatchShipping set OrderNo = @OrderNo,subOrderNo = @subOrderNo,yunDanNo = @yunDanNo,commpany = @commpany where id = @id"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@OrderNo", o.OrderNo), new SqlParameter("@subOrderNo", o.SubOrderNo), new SqlParameter("@yunDanNo", o.YunDanNo), new SqlParameter("@commpany", o.Commpany), new SqlParameter("@id", o.Id) }; DataBase.ExecuteSql(query, param); return(true); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return(false); } }
public static bool UpdateHuiZJMsgConfig(MsgSendConfig o) { try { string query = @"update MsgSendConfig set huiZJType = @huiZJType, huiZJNofityMsg = @huiZJNofityMsg, huiZJNofityMsgCus= @huiZJNofityMsgCus, isHuiZJMsgCus = @isHuiZJMsgCus, updateDate = GETDATE() where sellerNick = @sellerNick"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@huiZJType", o.HuiZJType), new SqlParameter("@huiZJNofityMsg", o.HuiZJNofityMsg), new SqlParameter("@huiZJNofityMsgCus", o.HuiZJNofityMsgCus), new SqlParameter("@isHuiZJMsgCus", o.IsHuiZJMsgCus), new SqlParameter("@sellerNick", o.SellerNick) }; DataBase.ExecuteSql(query, param); return(true); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return(false); } }
private void MsgDataBind() { try { dt = SellersBLL.GetSellerMsgAccount(txtTitle.Text.Trim(), txt_StartTime.Value, txt_EndTime.Value); grdCus.DataSource = dt; grdCus.DataBind(); DataTable tb = SellersBLL.GetUnUsedMsgAccount(); if (tb != null && tb.Rows.Count == 1) { lbMsgCount.Text = "剩余短信: " + tb.Rows[0]["totalCount"].ToString() + " 条";; lbSpendFee.Text = "未消费成本:" + tb.Rows[0]["spendMoney"].ToString() + " 元"; DateTime dd = Convert.ToDateTime(dt.Rows[0]["unUseDate"]); } else { lbMsgCount.Text = "剩余短信: 0 条"; lbSpendFee.Text = "未消费成本: 0 元"; } } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Web_UI); } }
/// <summary> /// 添加警告2016-10-09 yao c /// </summary> /// <param name="o"></param> /// <returns></returns> public static Boolean addWarnConfig(MsgSendConfig o) { try { string query = @"insert into tab_MsgConfig(sellerNick,unPayType,unpayMsg,threeDayType,blackListType,areaList,areaType,warnType,createDate,amount,amountMax)" + "values(@sellerNick,@unPayType,@unpayMsg,@threeDayType,@blackListType,@areaList,@areaType,@warnType,getdate(),@amount,@amountMax)"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@sellerNick", o.SellerNick), new SqlParameter("@unPayType", o.UnPayType), new SqlParameter("@unpayMsg", string.IsNullOrEmpty(o.UnpayMsg)?"":o.UnpayMsg), new SqlParameter("@threeDayType", o.threeDayType), new SqlParameter("@blackListType", o.blackListType), new SqlParameter("@areaList", string.IsNullOrEmpty(o.areList)?"":o.areList), new SqlParameter("@areaType", o.areType), new SqlParameter("@warnType", o.warnType), new SqlParameter("@amount", o.Amount), new SqlParameter("@amountMax", o.AmountMax) }; DataBase.ExecuteSql(query, param); return(true); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return(false); } }
/// <summary> /// 调用API获取会员数据 /// </summary> /// <param name="currentPage"></param> /// <param name="pagesize"></param> /// <returns></returns> public List <CrmMember> GetBuyer(string strSessionKey, Int64 currentPage, Int64 pagesize) { try { if (currentPage == 0) { currentPage = 1L; } if (pagesize == 0) { pagesize = 100; } ITopClient client = TBManager.GetClient(); CrmMembersSearchRequest req = new CrmMembersSearchRequest(); req.CurrentPage = currentPage; req.PageSize = pagesize; CrmMembersSearchResponse response = client.Execute(req, strSessionKey); if (response.IsError) { ExceptionReporter.WriteLog("GetBuyer:" + response.SubErrCode + ":" + response.SubErrMsg, null, ExceptionPostion.TopApi, ExceptionRank.important); } return(response.Members); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi); return(null); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { userName = Users.Nick == null ? "美国佐敦飞人" : Users.Nick; orderVersion = string.IsNullOrEmpty(Users.OrderVersion) ? "最高版本" : Users.OrderVersion.ToString(); deadline = Users.Deadline == null ? "当前" : Users.Deadline; } DataTable tb = MsgBLL.GetSellerMsgStatus(Users.Nick); if (tb != null && tb.Rows.Count > 0) { msgCount = tb.Rows[0]["msgCanUseCount"].ToString() + "条"; } else { msgCount = "0条"; } } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Web_UI); } }
/// <summary> /// 商品图片上传 /// </summary> /// <param name="numIid">商品数字ID</param> /// <param name="filePath">文件路径</param> /// <param name="isMagor">是否将图片设置为主图</param> public string ItemImgUpload(Int64 numIid, string filePath, Boolean isMagor, string sessionKey) { try { ITopClient client = TBManager.GetClient(); PictureUploadRequest req = new PictureUploadRequest(); //req.NumIid = numIid; req.ClientType = "client:phone"; var fileInfo = new FileInfo(filePath); FileItem fItem = new FileItem(fileInfo); req.ImageInputTitle = fileInfo.Name; req.PictureCategoryId = 0; req.Img = fItem; //req.IsMajor = true; //req.Position = 6; PictureUploadResponse response = client.Execute(req, sessionKey); //#if DEBUG // return filePath; //#else return(response.Picture.PicturePath); //#endif } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi); return(null); } }
public static bool MinusJifen(Jifen jifen) { try { string query = @"insert into BuyerJifen(buyer_nick,orderNo,jifenHis,jifenAmount,jifenComeFrom,createDate,sellerNick)values (@buyer_nick,@orderNo,@jifenHis,@jifenAmount,@jifenComeFrom,getdate(),@sellerNick)"; int jifenAmount = Convert.ToInt32(GetBuyerTotalJifen(jifen.Buyer_Nick, jifen.SellerNick)) - Convert.ToInt32(jifen.jifenHis); if (jifenAmount < 0) { return(false); } SqlParameter[] param = new SqlParameter[] { new SqlParameter("@buyer_nick", jifen.Buyer_Nick), new SqlParameter("@orderNo", jifen.OrderNo), new SqlParameter("@jifenHis", Convert.ToInt32("-" + jifen.jifenHis)), //累计买家剩余积分 new SqlParameter("@jifenAmount", Convert.ToString(Convert.ToInt32(GetBuyerTotalJifen(jifen.Buyer_Nick, jifen.SellerNick)) - Convert.ToInt32(jifen.jifenHis))), new SqlParameter("@jifenComeFrom", "手工消耗积分"), new SqlParameter("@sellerNick", jifen.SellerNick) }; DataBase.ExecuteSql(query, param); return(true); } catch (Exception ex) { ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data); return(false); } }