/// <summary> /// 取消訂單通知列表 /// </summary> /// <param name="ocm"></param> /// <param name="totalCount"></param> /// <returns></returns> public List<OrderCancelMsgQuery> Query(OrderCancelMsgQuery ocm, out int totalCount) { StringBuilder sql = new StringBuilder(); sql.AppendLine(@"select ocm.cancel_id,ocm.order_id,ocm.cancel_type,ocm.cancel_status,ocm.cancel_content,"); sql.AppendLine(@"FROM_UNIXTIME(ocm.cancel_createdate) as cancel_createdate,ocm.cancel_ipfrom,"); sql.AppendLine(@"om.order_amount,om.order_status,om.order_payment,om.order_name,om.order_mobile,u.user_email "); sql.AppendLine(@" from order_cancel_msg ocm,order_master om, users u"); sql.AppendLine(@" where ocm.cancel_status = 0 and ocm.order_id = om.order_id and om.user_id = u.user_id "); sql.AppendLine(@" order by cancel_id asc"); //分頁 totalCount = 0; try { if (ocm.IsPage) { System.Data.DataTable _dt = _accessMySql.getDataTable(sql.ToString()); if (_dt != null && _dt.Rows.Count > 0) { totalCount = _dt.Rows.Count; } sql.AppendFormat(" limit {0},{1}", ocm.Start, ocm.Limit); } return _accessMySql.getDataTableForObj<OrderCancelMsgQuery>(sql.ToString()); } catch (Exception ex) { throw new Exception(" OrderCancelMsgDao-->Query-->" + ex.Message + sql.ToString() + sql.ToString(), ex); } }
public List<OrderCancelMsgQuery> Query(OrderCancelMsgQuery ocm, out int totalCount) { try { return icancelDao.Query(ocm, out totalCount); } catch (Exception ex) { throw new Exception("OrderCancelMsgMgr.Query-->" + ex.Message, ex); } }
//public HttpResponseBase GetReturnMasterList() //{ // List<OrderReturnUserQuery> stores = new List<OrderReturnUserQuery>(); // string json = string.Empty; // try // { // OrderReturnUserQuery query = new OrderReturnUserQuery(); // IReturnMasterImplMgr _Iretrunlistmgr = new ReturnMasterMgr(mySqlConnectionString); // StringBuilder sb = new StringBuilder(); // query.Start = Convert.ToInt32(Request.Params["start"] ?? "0");//用於分頁的變量 // query.Limit = Convert.ToInt32(Request.Params["limit"] ?? "20");//用於分頁的變量 // #region 查詢條件 // if (!string.IsNullOrEmpty(Request.Params["selecttype"])) // { // query.selecttype = Request.Params["selecttype"].ToString(); // } // if (!string.IsNullOrEmpty(Request.Params["searchcon"])) // { // query.searchcon = Request.Params["searchcon"].ToString(); // } // if (!string.IsNullOrEmpty(Request.Params["seldate"])) // { // query.seldate = Request.Params["seldate"].ToString(); // } // if (!string.IsNullOrEmpty(Request.Params["timestart"])) // { // query.timestart = Int32.Parse(CommonFunction.GetPHPTime(Request.Params["timestart"]).ToString()); // } // if (!string.IsNullOrEmpty(Request.Params["dateTwo"])) // { // query.timeend = Int32.Parse(CommonFunction.GetPHPTime(Request.Params["dateTwo"]).ToString()); // } // if (!string.IsNullOrEmpty(Request.Params["temp_status"])) // { // query.temp_status = uint.Parse(Request.Params["temp_status"].ToString()); // } // #endregion // int totalCount = 0; // stores = _Iretrunlistmgr.GetOrderTempReturnList(query, out totalCount); // foreach (var item in stores) // { // item.user_return_createdates = CommonFunction.GetNetTime(item.user_return_createdate); // item.user_return_updatedates = CommonFunction.GetNetTime(item.user_return_updatedate); // } // IsoDateTimeConverter timeConverter = new IsoDateTimeConverter(); // //这里使用自定义日期格式,如果不使用的话,默认是ISO8601格式 // timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; // //listUser是准备转换的对象 // json = "{success:true,'msg':'user',totalCount:" + totalCount + ",data:" + JsonConvert.SerializeObject(stores, Formatting.Indented, timeConverter) + "}";//返回json數據 // } // catch (Exception ex) // { // Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); // logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); // logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; // log.Error(logMessage); // json = "{success:true,totalCount:0,data:[]}"; // } // this.Response.Clear(); // this.Response.Write(json); // this.Response.End(); // return this.Response; //} //public HttpResponseBase UpdateReturnMaster() //{// 暫存退貨單未歸檔送出 // OrderReturnUserQuery query = new OrderReturnUserQuery(); // IReturnMasterImplMgr _Iordertempretrunlistmgr = new ReturnMasterMgr(mySqlConnectionString); // Serial serial = new Serial(); // string json = string.Empty; // try // { // if (!string.IsNullOrEmpty(Request.Params["user_return_id"])) // { // query.user_return_id = Convert.ToUInt32(Request.Params["user_return_id"].ToString()); // } // else // { // query.user_return_id = 0; // } // if (!string.IsNullOrEmpty(Request.Params["detail_id"])) // { // query.detail_id = Convert.ToUInt32(Request.Params["detail_id"].ToString()); // } // else // { // query.detail_id = 0; // } // if (!string.IsNullOrEmpty(Request.Params["return_reason"])) // { // query.return_reason = Convert.ToUInt32(Request.Params["return_reason"].ToString()); // } // else // { // query.return_reason = 0; // } // if (!string.IsNullOrEmpty(Request.Params["temp_status"])) // { // query.temp_status = Convert.ToUInt32(Request.Params["temp_status"].ToString()); // if (query.temp_status == 1) // { // DataTable _dt = _Iordertempretrunlistmgr.GetOrderReturnCount(query); // if (int.Parse(_dt.Rows[0][0].ToString()) != 0) // { // string err = string.Empty; // err = "{success:true,msg:\"退貨單已存在,請洽諮訊部" + "\"}"; // this.Response.Clear(); // this.Response.Write(err); // this.Response.End(); // return this.Response; // } // else // { // #region 當狀態要改為歸檔時,新增一條退貨單數據 // ISerialImplMgr _serial = new SerialMgr(mySqlConnectionString); // serial = _serial.GetSerialById(45); // query.return_id = Convert.ToUInt32((serial.Serial_Value + 1).ToString()); // if (!string.IsNullOrEmpty(Request.Params["order_id"])) // { // query.order_id = uint.Parse(Request.Params["order_id"]); // } // else // { // query.order_id = 0; // } // if (!string.IsNullOrEmpty(Request.Params["item_vendor_id"])) // { // query.item_vendor_id = uint.Parse(Request.Params["item_vendor_id"]); // } // else // { // query.item_vendor_id = 0; // } // query.return_status = 0; // if (!string.IsNullOrEmpty(Request.Params["user_note"])) // { // query.user_note = Request.Params["user_note"]; // } // else // { // query.user_note = ""; // } // query.return_createdate = Convert.ToUInt32(CommonFunction.GetPHPTime(DateTime.Now.ToString()).ToString()); // if (!string.IsNullOrEmpty(Request.Params["return_zip"])) // { // query.return_zip = uint.Parse(Request.Params["return_zip"]); // } // else // { // query.return_zip = 0; // } // if (!string.IsNullOrEmpty(Request.Params["return_address"])) // { // query.return_address = Request.Params["return_address"]; // } // else // { // query.return_address = ""; // } // query.return_updatedate = 0; // System.Net.IPAddress[] addlist = Dns.GetHostByName(Dns.GetHostName()).AddressList; // if (addlist.Length > 0) // { // query.return_ipfrom = addlist[0].ToString(); // } // serial.Serial_Value = serial.Serial_Value + 1;/*所在操作表的列增加*/ // _serial.Update(serial);/*修改所在的表的列對應的值*/ // _Iordertempretrunlistmgr.InsertOrderReturnMaster(query); // _Iordertempretrunlistmgr.InsertOrderReturnDetail(query); // #endregion // #region 新增付款單狀態 // OrderMasterStatus oms = new OrderMasterStatus(); // _serial = new SerialMgr(mySqlConnectionString); // serial = _serial.GetSerialById(29); // oms.serial_id = uint.Parse((serial.Serial_Value + 1).ToString()); // if (!string.IsNullOrEmpty(Request.Params["order_id"])) // { // oms.order_id = query.order_id; // } // else // { // oms.order_id = 0; // } // oms.order_status = 91; // int totalCount = 0; // List<LogInLogeQuery> logins = new List<LogInLogeQuery>(); // LogInLogeQuery login = new LogInLogeQuery(); // ILogInLogeImplMgr _loginloge = new LogInLogeMgr(mySqlConnectionString); // logins = _loginloge.QueryList(login, out totalCount); // string Description = string.Empty; // Description = "Write:(" + login.user_id + ")" + login.user_username; // oms.status_description = Description; // System.Net.IPAddress[] addlists = Dns.GetHostByName(Dns.GetHostName()).AddressList; // if (addlist.Length > 0) // { // oms.status_ipfrom = addlist[0].ToString(); // } // oms.status_createdate = uint.Parse(CommonFunction.GetPHPTime(DateTime.Now.ToString()).ToString()); // serial.Serial_Value = serial.Serial_Value + 1; // _serial.Update(serial); // _Iordertempretrunlistmgr.InsertOrderMasterStatus(oms); // #endregion // #region 修改付款單狀態 // if (!string.IsNullOrEmpty(Request.Params["order_id"])) // { // List<OrderReturnUserQuery> stores = new List<OrderReturnUserQuery>(); // query.order_id = uint.Parse(Request.Params["order_id"]); // stores = _Iordertempretrunlistmgr.OrderMasterQuery(query); // if (query.order_status == 90) // { // query.order_date_cancel = uint.Parse(CommonFunction.GetPHPTime(DateTime.Now.ToString()).ToString()); // } // else if (query.order_status == 99) // { // query.order_date_close = uint.Parse(CommonFunction.GetPHPTime(DateTime.Now.ToString()).ToString()); // } // else // { // query.order_status = 5; // query.order_updatedate = uint.Parse(CommonFunction.GetPHPTime(DateTime.Now.ToString()).ToString()); // System.Net.IPAddress[] addresslist = Dns.GetHostByName(Dns.GetHostName()).AddressList; // if (addlist.Length > 0) // { // query.order_ipfrom = addlist[0].ToString(); // } // } // _Iordertempretrunlistmgr.UpdateOrderMaster(query); // } // #endregion // #region 異動訂單明細商品狀態 // if (!string.IsNullOrEmpty(Request.Params["detail_id"])) // { // query.detail_id = Convert.ToUInt32(Request.Params["detail_id"].ToString()); // query.detail_status = 91; // _Iordertempretrunlistmgr.UpdateOrderDetailStatus(query); // } // #endregion // int invoice_id = 0; // string status = string.Empty; // OrderMaster odm = new OrderMaster(); // odm.Order_Id = query.order_id; // List<OrderMaster> Odmaster = new List<OrderMaster>(); // #region 是否開立過發票 // if (_Iordertempretrunlistmgr.SelOrderMaster(query).Rows[0]["invoice_status"].ToString() == "0") // { // _Iordertempretrunlistmgr.Seltime(query); // #region 判斷時間 異動 // if (_Iordertempretrunlistmgr.SelCon(query).Rows.Count > 0) // { // if (_Iordertempretrunlistmgr.SelCon(query).Rows[0]["order_freight_normal"].ToString() == "1") // {//抓取付款單 // Odmaster = _Iordertempretrunlistmgr.Selpay(odm); // double free_tax, tax_amout, order_freight_normal_notax, order_freight_low_notax, order_freight_normal_tax, order_freight_low_tax; // foreach (var item in Odmaster) // { // free_tax = Int32.Parse(item.Order_Amount.ToString()) / 1.5; // tax_amout = item.Order_Amount - free_tax; // order_freight_normal_notax = item.Order_Freight_Normal / 1.5; // order_freight_low_notax = item.Order_Freight_Low / 1.5; // order_freight_normal_tax = item.Order_Freight_Normal - order_freight_normal_notax; // order_freight_low_tax = item.Order_Freight_Low - order_freight_low_notax; // } // //抓出明細 // status = "0,4"; // _Iordertempretrunlistmgr.Seldetail(query, status); // } // if (Int32.Parse(_Iordertempretrunlistmgr.SelCon(query).Rows[0][0].ToString()) != 1) // { // #region 運費判斷 // if (_Iordertempretrunlistmgr.SelOrderMaster(query).Rows[0]["order_freight_normal"].ToString() == "0") // { // if (_Iordertempretrunlistmgr.SelOrderMaster(query).Rows[0]["order_freight_low"].ToString() == "0") // { // invoice_id = Int32.Parse(_Iordertempretrunlistmgr.SelOrderMaster(query).Rows[0]["order_freight_low"].ToString()); // invoice_id = Int32.Parse(_Iordertempretrunlistmgr.SelInvoiceid(invoice_id).Rows[0][0].ToString()); // } // } // #endregion // #region 寫入資料 // InvoiceMasterRecord m = new InvoiceMasterRecord(); // InvoiceSliveInfo n = new InvoiceSliveInfo(); // if (_Iordertempretrunlistmgr.Insertdb(m, n) > 0) // {//寫入資料成功執行成功 // _Iordertempretrunlistmgr.Updinvoice(query); // _Iordertempretrunlistmgr.Delinvoice(invoice_id); // } // #endregion // } // } // #endregion // #region 過期 開立折讓單 // invoice_id = Int32.Parse(_Iordertempretrunlistmgr.SelOrderMaster(query).Rows[0]["invoice_id"].ToString()); // _Iordertempretrunlistmgr.Selmaster(invoice_id); // _Iordertempretrunlistmgr.Selslive(invoice_id); // status = "89,90,91"; // _Iordertempretrunlistmgr.Seldetail(query, status); // //更新總數(開立折讓單) // InvoiceAllowanceRecord larm = new InvoiceAllowanceRecord(); // _Iordertempretrunlistmgr.Updcount(larm); // _Iordertempretrunlistmgr.UpdMaster(invoice_id); // #endregion // } // #endregion // } // } // } // else // { // query.temp_status = 0; // } // if (!string.IsNullOrEmpty(Request.Params["user_note"])) // { // query.user_note = Request.Params["user_note"]; // } // else // { // query.user_note = ""; // } // if (!string.IsNullOrEmpty(Request.Params["user_return_createdates"])) // { // long times = CommonFunction.GetPHPTime(Request.Params["user_return_createdates"]); // query.user_return_createdate = Convert.ToUInt32(times.ToString()); // } // if (!string.IsNullOrEmpty(Request.Params["slave_status"])) // { // uint status = Convert.ToUInt32(Request.Params["slave_status"]); // if (status == 99) // { // string jsons = string.Empty; // jsons = "{success:true,msg:\"已歸檔,無法產生退貨單" + "\"}"; // this.Response.Clear(); // this.Response.Write(jsons); // this.Response.End(); // return this.Response; // } // } // query.user_return_updatedate = Convert.ToUInt32(CommonFunction.GetPHPTime(DateTime.Now.ToString()).ToString()); // _Iordertempretrunlistmgr.UpdateTempStatus(query); // json = "{success:true}";//返回json數據 // } // catch (Exception ex) // { // Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); // logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); // logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; // log.Error(logMessage); // json = "{success:false,msg:0}"; // } // this.Response.Clear(); // this.Response.Write(json); // this.Response.End(); // return this.Response; //} #endregion #region 取消訂單通知 #region 獲取取消訂單通知列表 public HttpResponseBase GetOrderCancelMsgList() { List<OrderCancelMsgQuery> stores = new List<OrderCancelMsgQuery>(); string json = string.Empty; try { int totalCount = 0; OrderCancelMsgQuery query = new OrderCancelMsgQuery(); query.Start = Convert.ToInt32(Request.Params["start"] ?? "0");//用於分頁的變量 query.Limit = Convert.ToInt32(Request.Params["limit"] ?? "20");//用於分頁的變量 _orderCancelMsgMgr = new OrderCancelMsgMgr(mySqlConnectionString); stores = _orderCancelMsgMgr.Query(query, out totalCount); foreach (var item in stores) { item.sorder_payment = Payment(item.order_payment.ToString()); item.scancel_type = Order_Cancel_Reason(item.cancel_type.ToString()); item.sorder_status = Status(item.order_status.ToString()); } IsoDateTimeConverter timeConverter = new IsoDateTimeConverter(); //这里使用自定义日期格式,如果不使用的话,默认是ISO8601格式 //listUser是准备转换的对象 timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; json = "{success:true,totalCount:" + totalCount + ",data:" + JsonConvert.SerializeObject(stores, Formatting.Indented, timeConverter) + "}";//返回json數據 } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{success:true,totalCount:0,data:[]}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }
public HttpResponseBase GetCancelMsg() { List<OrderCancelMsgQuery> stores = new List<OrderCancelMsgQuery>(); string json = string.Empty; try { OrderCancelMsgQuery query = new OrderCancelMsgQuery(); query.Start = Convert.ToInt32(Request.Params["start"] ?? "0");//用於分頁的變量 query.Limit = Convert.ToInt32(Request.Params["limit"] ?? "20");//用於分頁的變量 query.order_id = Convert.ToUInt32(Request.Params["Order_Id"].ToString()); _tabshow = new TabShowMgr(mySqlConnectionString); int totalCount = 0; stores = _tabshow.GetCancelMsg(query, out totalCount); IsoDateTimeConverter timeConverter = new IsoDateTimeConverter(); timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; json = "{success:true,'msg':'user',totalCount:" + totalCount + ",data:" + JsonConvert.SerializeObject(stores, Formatting.Indented, timeConverter) + "}";//返回json數據 } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{success:true,totalCount:0,data:[]}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }
public List<OrderCancelMsgQuery> GetCancelMsg(OrderCancelMsgQuery store, out int totalCount) { StringBuilder sql = new StringBuilder(); StringBuilder sqlcount = new StringBuilder(); try { sql.AppendLine(@"SELECT ocm.cancel_id,ocm.order_id,tpc.parameterName as scancel_type,ocm.cancel_status,ocr.response_content,FROM_UNIXTIME(ocr.response_createdate) AS response_createdate,"); sql.AppendLine(@"ocm.cancel_content,FROM_UNIXTIME(ocm.cancel_createdate) AS cancel_createdate,ocm.cancel_ipfrom,ocr.response_id"); sql.AppendLine(@"FROM order_cancel_msg ocm LEFT JOIN order_cancel_response ocr ON ocm.cancel_id=ocr.cancel_id "); sql.AppendLine(" LEFT JOIN t_parametersrc tpc ON tpc.parameterCode=ocm.cancel_type and tpc.parameterType ='Order_Cancel_Reason' "); sql.AppendFormat(@"WHERE ocm.order_id={0} ", store.order_id); sqlcount.AppendFormat(@"SELECT count(*) AS search_total FROM order_cancel_msg ocm LEFT JOIN order_cancel_response ocr ON ocm.cancel_id=ocr.cancel_id WHERE ocm.order_id={0} ;", store.order_id); totalCount = 0; if (store.IsPage) { System.Data.DataTable _dt = _access.getDataTable(sqlcount.ToString()); if (_dt != null && _dt.Rows.Count > 0) { totalCount = Convert.ToInt32(_dt.Rows[0]["search_total"]); } sql.AppendFormat(" limit {0},{1}", store.Start, store.Limit); } return _access.getDataTableForObj<OrderCancelMsgQuery>(sql.ToString()); } catch (Exception ex) { throw new Exception("TabShowDao-->GetCancelMsg " + ex.Message + sql.ToString(), ex); } }
public List<OrderCancelMsgQuery> GetCancelMsg(OrderCancelMsgQuery store, out int totalCount) { try { return _tabshowdao.GetCancelMsg (store, out totalCount); } catch (Exception ex) { throw new Exception("TabShowMgr-->GetCancelMsg-->" + ex.Message, ex); } }