Ejemplo n.º 1
0
 public HttpResponseBase CancelReturnPurchaes()
 {
     string json = string.Empty;
     try
     {
         OrderReturnMasterQuery query = new OrderReturnMasterQuery();
         if (!string.IsNullOrEmpty(Request.Params["order_id"]))
         {
             query.order_id = Convert.ToUInt32(Request.Params["order_id"]);
         }
         if (!string.IsNullOrEmpty(Request.Params["return_id"]))
         {
             query.return_id = Convert.ToUInt32(Request.Params["return_id"]);
         }
         if (!string.IsNullOrEmpty(Request.Params["return_status"]))
         {
             query.return_status = Convert.ToUInt32(Request.Params["return_status"]);
         }
         
         query.return_ipfrom = CommonFunction.GetIP4Address(Request.UserHostAddress.ToString());
      _orderReturnMaster=new OrderReturnMasterMgr (mySqlConnectionString);
       json=   _orderReturnMaster.CancelReturnPurchaes(query);
     }
     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'}";
     }
     this.Response.Clear();
     this.Response.Write(json);
     this.Response.End();
     return this.Response;
 }
Ejemplo n.º 2
0
        public HttpResponseBase SaveOrderReturnMaster()
        {
            string json = string.Empty;
            try
            {
                _orderReturnMaster = new OrderReturnMasterMgr(mySqlConnectionString);
                OrderReturnMasterQuery query = new OrderReturnMasterQuery();
                string return_status = string.Empty;
                query.return_id = uint.Parse(Request.Params["return_id"]);
                query.order_id = uint.Parse(Request.Params["order_id"]);

                if (!string.IsNullOrEmpty(Request.Params["return_note"]))
                {
                    query.return_note = Request.Params["return_note"];
                    if (!string.IsNullOrEmpty(Request.Params["invoice_deal"]))
                    {
                        query.invoice_deal = uint.Parse(Request.Params["invoice_deal"]);
                    }
                    if (!string.IsNullOrEmpty(Request.Params["return_deal"]))
                    {
                        query.package = uint.Parse(Request.Params["return_deal"]);
                    }
                    if (!string.IsNullOrEmpty(Request.Params["return_zip"]))
                    {
                        query.return_zip = uint.Parse(Request.Params["return_zip"]);
                    }
                    if (!string.IsNullOrEmpty(Request.Params["return_address"]))
                    {
                        query.return_address = Request.Params["return_address"];
                    }
                    if (!string.IsNullOrEmpty(Request.Params["deliver_code"]))
                    {
                        query.deliver_code = Request.Params["deliver_code"];
                    }
                    if (!string.IsNullOrEmpty(Request.Params["return_status"]))
                    {
                        query.return_status = uint.Parse(Request.Params["return_status"]);
                    }
                    if (!string.IsNullOrEmpty(Request.Params["bank_note"]))
                    {
                        query.bank_note = Request.Params["bank_note"];
                    }
                    query.return_updatedate = Convert.ToUInt32(CommonFunction.GetPHPTime(DateTime.Now.ToString()));
                    query.return_ipfrom = Dns.GetHostByName(Dns.GetHostName()).AddressList.FirstOrDefault().ToString();

                    if (!string.IsNullOrEmpty(Request.Params["bank_name"]))
                    {
                        query.bank_name = Request.Params["bank_name"];
                    }
                    if (!string.IsNullOrEmpty(Request.Params["bank_branch"]))
                    {
                        query.bank_branch = Request.Params["bank_branch"];
                    }
                    if (!string.IsNullOrEmpty(Request.Params["bank_account"]))
                    {
                        query.bank_account = Request.Params["bank_account"];

                    }
                    if (!string.IsNullOrEmpty(Request.Params["account_name"]))
                    {
                        query.account_name = Request.Params["account_name"];
                    }
                    query.user_id = (Session["caller"] as Caller).user_id.ToString();
                    query.user_username = (Session["caller"] as Caller).user_username.ToString();
                    query.HgReturnUrl = HgReturnUrl;
                    query.HgMerchandID = HgMerchandID;
                    query.HgTeminalID = HgTeminalID;
                    query.HgCategoty = HgCategoty;
                    query.HgWallet = HgWallet;
                    if (_orderReturnMaster.Save(query) > 0)
                    {
                        json = "{success:'true'}";
                    }
                    else
                    {
                        json = "{success:'false'}";
                    }
                }
            }
            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'}";
            }
            this.Response.Clear();
            this.Response.Write(json);
            this.Response.End();
            return this.Response;
        }
Ejemplo n.º 3
0
        public HttpResponseBase GetOrderReturnMasterList()
        {
            string json = string.Empty;
            try
            {
                int totalCount = 0;
                OrderReturnMasterQuery query = new OrderReturnMasterQuery();
                query.Start = Convert.ToInt32(Request.Params["start"] ?? "0");//用於分頁的變量
                query.Limit = Convert.ToInt32(Request.Params["limit"] ?? "25");//

                if (!string.IsNullOrEmpty(Request.Params["ven_type"]))
                {
                    query.ven_type = Convert.ToInt32(Request.Params["ven_type"]);
                }
                if (!string.IsNullOrEmpty(Request.Params["search_content"]))
                {
                    query.content = Request.Params["search_content"];
                }
                if (!string.IsNullOrEmpty(Request.Params["date_type"]))
                {
                    query.date_type = Convert.ToInt32(Request.Params["date_type"]);
                }
                if (!string.IsNullOrEmpty(Request.Params["time_start"]))
                {
                    query.time_start = Convert.ToDateTime(Request.Params["time_start"]).ToString("yyyy-MM-dd HH:mm:ss");                }
                if (!string.IsNullOrEmpty(Request.Params["time_end"]))
                {
                    query.time_end = Convert.ToDateTime(Request.Params["time_end"]).ToString("yyyy-MM-dd HH:mm:ss");                }
                if (!string.IsNullOrEmpty(Request.Params["return_status"]))
                {
                    query.return_status = Convert.ToUInt32(Request.Params["return_status"]);
                }

                _orderReturnMaster = new OrderReturnMasterMgr(mySqlConnectionString);
                List<OrderReturnMasterQuery> stores = _orderReturnMaster.GetReturnMaster(query, out totalCount);
                IsoDateTimeConverter timeConverter = new IsoDateTimeConverter();
                timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
                json = "{success:true,totalCount:" + totalCount + ",data:" + JsonConvert.SerializeObject(stores, Formatting.Indented, timeConverter) + "}";
            }
            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;
        }
Ejemplo n.º 4
0
        public string GetPayment()
        {
            _orderMasterMgr = new OrderMasterMgr(mySqlConnectionString);
            _orderReturnMaster = new OrderReturnMasterMgr(mySqlConnectionString);
            string json = string.Empty;
            try
            {
                if (!string.IsNullOrEmpty(Request.Params["order_id"]))
                {
                    OrderMaster om = _orderMasterMgr.GetPaymentById(uint.Parse(Request.Params["order_id"]));
                    //獲取暫存單中atm機 銀行信息 地址信息

                    if (om.Order_Payment == 2)
                    {
                        OrderReturnUserQuery oruQuery = _orderReturnMaster.GetReturnDetailById(om.Order_Id);
                        json = "{success:true,bank_name:" + oruQuery.bank_name + ",bank_branch:" + oruQuery.bank_branch
                            + ",bank_account:" + oruQuery.bank_account + ",account_name:" + oruQuery.account_name + "}";
                    }
                    else
                    {
                        json = "{success:true,order_id:" + om.Order_Id + ",Order_Payment:" + om.Order_Payment + "}";
                    }
                }
            }
            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 = "[]";
            }
            return json;
        }
Ejemplo n.º 5
0
 public HttpResponseBase OrderReturn()
 {
     List<OrderReturnMasterQuery> stores = new List<OrderReturnMasterQuery>();
     OrderReturnMasterQuery query = new OrderReturnMasterQuery();
     _orderReturnMaster=new OrderReturnMasterMgr(mySqlConnectionString);
     string json = string.Empty;
     try
     {
         if (!string.IsNullOrEmpty(Request.Params["detail_id"]))
         {
             query.detailId = Request.Params["detail_id"].ToString();
         }
         if (query.detailId.Length > 0)
         {
             query.detailId = query.detailId.Substring(0, query.detailId.Length - 1);
         }
         System.Net.IPAddress[] addlist = Dns.GetHostByName(Dns.GetHostName()).AddressList; 
         query.return_ipfrom = addlist[0].ToString();
         json = _orderReturnMaster.OrderReturn(query);// "{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:flase}";
     }
     this.Response.Clear();
     this.Response.Write(json);
     this.Response.End();
     return this.Response;
 }