/**
|
* OrderMoneyReceive.aspx.cs
|
*
|
* 功 能: 订单收款
|
* 类 名: OrderMoneyReceive
|
*
|
* Ver 变更日期 负责人 变更内容
|
* ───────────────────────────────────
|
* V0.01 2013-5-28 13:44 吴崎均 初版
|
*
|
*/
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Web;
|
using System.Web.UI;
|
using System.Web.UI.WebControls;
|
using CY.BLL.EC;
|
using CY.Infrastructure.Common;
|
using CY.Model;
|
using CY.BLL.OA;
|
using CY.BLL.Sys;
|
using System.Text;
|
using CY.BLL;
|
using System.Transactions;
|
namespace CY.WebForm.Pages.business
|
{
|
public partial class BaozhengjinCuishou : BasePage
|
{
|
private EC_OrderBLL _eC_OrderBLL = null;
|
|
private OA_CorporateClientsBLL bll_OA_CorporateClientsBLL = null;
|
private EC_OrderBasicBLL _eC_OrderBasicBLL = null;
|
|
|
private OA_StaffBLL _StaffBLL = null;
|
OA_BaozhengjinBLL oA_BaozhengjinBLL = null;
|
OA_BaozhengjincuishouBLL oA_BaozhengjincuishouBLL = null;
|
|
/// <summary>
|
/// 初始化构造
|
/// </summary>
|
public BaozhengjinCuishou()
|
{
|
bll_OA_CorporateClientsBLL = new OA_CorporateClientsBLL();
|
_StaffBLL = new OA_StaffBLL();
|
_eC_OrderBasicBLL = new EC_OrderBasicBLL();
|
oA_BaozhengjinBLL = new OA_BaozhengjinBLL();
|
oA_BaozhengjincuishouBLL = new OA_BaozhengjincuishouBLL();
|
}
|
/// <summary>
|
/// 界面加载事件
|
/// </summary>
|
/// <param name="sender"></param>
|
/// <param name="e"></param>
|
protected void Page_Load(object sender, EventArgs e)
|
{
|
_eC_OrderBLL = new EC_OrderBLL();
|
btnSubmit.ServerClick += new EventHandler(btnSubmit_ServerClick);
|
|
|
if (IsPostBack || IsCallback)
|
return;
|
|
if (!IsPostBack && !IsCallback)
|
{
|
LoadOrder();
|
}
|
}
|
|
/// <summary>
|
/// 提交按钮点击事件
|
/// </summary>
|
/// <param name="sender"></param>
|
/// <param name="e"></param>
|
void btnSubmit_ServerClick(object sender, EventArgs e)
|
{
|
string orderIds = Request["ids"];
|
if (string.IsNullOrEmpty(this.txtStartTime.Value.Trim()))
|
{
|
JavaScript.MessageBox("请选择催款时间!", this);
|
return;
|
}
|
|
bool isWin = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
var oA_Kaipiaonewcuishou = new OA_Baozhengjincuishou();
|
oA_Kaipiaonewcuishou.BaozhengjinId = orderIds.ToInt32().Value;
|
oA_Kaipiaonewcuishou.Creater = CurrentUser.ShortName;
|
oA_Kaipiaonewcuishou.CreateTime = DateTime.Now;
|
oA_Kaipiaonewcuishou.CuishouTime = this.txtStartTime.Value.ToDateTime2();
|
oA_Kaipiaonewcuishou.Cuikuanqingkuang = this.txtCuikuanqingkuang.Value;
|
isWin = oA_BaozhengjincuishouBLL.InsertModel(oA_Kaipiaonewcuishou);
|
|
if (isWin)
|
{
|
JavaScript.MessageBox("操作成功", this, true, true);
|
}
|
else
|
{
|
JavaScript.MessageBox("操作失败", this);
|
}
|
//JavaScript.MessageBox(isWin ? "收款成功!" : "收款失败!", this, "top.frmright.ReLoad();top.Dialog.close();");
|
// Request.RequestContext.RouteData.DataTokens.Add("IsWin", isWin ? "1" : "");
|
|
|
|
}
|
|
|
/// <summary>
|
/// 加载订单
|
/// </summary>
|
private void LoadOrder()
|
{
|
try
|
{
|
string orderIds = Request["id"];
|
if (string.IsNullOrEmpty(orderIds))
|
{
|
JavaScript.MessageBox("订单不存在!", this);
|
return;
|
}
|
|
this.ids.Value = orderIds;
|
OA_Baozhengjin oA_Kaipiaoshenqing = oA_BaozhengjinBLL.GetModelByKeyid(orderIds.ToInt32().Value);
|
|
|
this.txtBuyerName.InnerText = oA_Kaipiaoshenqing.Shoukuandanwei;
|
|
|
|
this.txtStartTime.Value = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
|
|
|
|
|
|
|
this.txtjine.InnerText = String.Format("{0:F}", oA_Kaipiaoshenqing.Fukuanmoney);
|
var result = oA_BaozhengjincuishouBLL.GetModelByKaipiaoId(orderIds.ToInt32().Value);
|
rptData.DataSource = result;
|
rptData.DataBind();
|
|
|
}
|
catch (Exception ex)
|
{
|
PAGEHandleException(ex);
|
JavaScript.MessageBox("订单不存在!", this);
|
}
|
|
|
}
|
|
|
|
}
|
}
|