263 lines
11 KiB
C#
263 lines
11 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Web.UI.WebControls;
|
|
using SuperMap.RealEstate.CoreFrameWork;
|
|
using SuperMap.RealEstate.Web.UI.WebControls;
|
|
using Business = SuperMap.RealEstate.SendRec.Storage.Business;
|
|
|
|
namespace SuperMap.RealEstate.SendRec.Modules.RecProinst
|
|
{
|
|
public partial class Default : UI.BasePage
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (IsPostBack) return;
|
|
//初始化并加载列表
|
|
GridViewEx1.SelectingWithInit<Business.APPLYPROINST>(ObjectDataSource1, GridPageEx1,
|
|
DictionaryHelper.GetDictionary(Transaction, "APPLYPROINST_TYPE"));
|
|
|
|
GridViewEx1.SetOpenControl(CallBackRecProinst, "APPLYPROINSTList.aspx");
|
|
|
|
InitWebControls();
|
|
//设置回车焦点按钮
|
|
SetControlClientAction(ButtonSearch);
|
|
}
|
|
|
|
private void InitWebControls()
|
|
{
|
|
DropDownListEx2.Clear();
|
|
Dictionary<string, string> _Dict = DictionaryHelper.GetDictionaryKeyValue(this.Transaction, "APPLYPROINST_STATE");
|
|
foreach (var item in _Dict)
|
|
{
|
|
if (int.Parse(item.Key) < 3000)
|
|
{
|
|
ListItemEx _ListItemEx = new ListItemEx();
|
|
_ListItemEx.Text = item.Value;
|
|
_ListItemEx.Value = item.Key;
|
|
DropDownListEx2.Items.Add(_ListItemEx);
|
|
}
|
|
}
|
|
|
|
//剔除环节
|
|
}
|
|
|
|
|
|
//查询
|
|
protected void ButtonSearch_CallBackClick(object sender, ClientSetEventArgs e)
|
|
{
|
|
GridViewEx1.Selecting<Business.APPLYPROINST>(ObjectDataSource1, GridPageEx1);
|
|
//设置UI变化
|
|
e.SetValue(GridViewEx1);
|
|
e.SetValue(GridPageEx1);
|
|
}
|
|
|
|
//翻页事件
|
|
protected void GridPageEx1_CallBackPageChanged(object src, ClientSetEventArgs e)
|
|
{
|
|
GridViewEx1.Pagging<Business.APPLYPROINST>(ObjectDataSource1, GridPageEx1);
|
|
//设置UI变化
|
|
e.SetValue(GridViewEx1);
|
|
}
|
|
|
|
//查询SQL设置
|
|
protected void GridViewEx1_SelectMethodParameters(object sender, SelectMethodParametersArgs e)
|
|
{
|
|
//搜索选项的搜索条件过滤
|
|
if (!string.IsNullOrEmpty(TextBox_Search.Text))
|
|
e.AddOrParams(GridViewSearch1, TextBox_Search.Text);
|
|
//且搜索条件
|
|
//添加填写人过滤
|
|
e.AddAndParams("APPLYPROINST_STATE", 3000);
|
|
e.AddAndParams("APPLYPROISNT_FLAG", PassportInfo.ID);
|
|
//或搜索条件
|
|
|
|
//排序
|
|
e.AddOrderByParams(GridViewOrderBy1);
|
|
}
|
|
|
|
protected void GridViewEx1_RowDataBound(object sender, GridViewRowEventArgs e)
|
|
{
|
|
if (e.Row.RowType == DataControlRowType.DataRow)
|
|
{
|
|
|
|
string _APPLYPROINST_ID = GridViewEx1.DataKeys[e.Row.RowIndex].Values["APPLYPROINST_ID"].ToString().ToEncrypt();
|
|
e.Row.Attributes["data-code"] = _APPLYPROINST_ID;
|
|
LinkButton MoreInfo = (LinkButton)e.Row.FindControl("MoreInfo");
|
|
LinkButton APPLYCOMMODITYInfo = (LinkButton)e.Row.FindControl("APPLYCOMMODITYInfo");
|
|
MoreInfo.OnClientClick = GridViewEx1.GetOpenPopDialogClientScript("APPLYPROINSTPage.aspx?ID=" +
|
|
_APPLYPROINST_ID + "&readyonly=true", 660, 417) + " return false;";
|
|
APPLYCOMMODITYInfo.OnClientClick = GridViewEx1.GetOpenPopDialogClientScript(
|
|
"MainPage.aspx?APPLYPROINST_ID=" + _APPLYPROINST_ID, 1000, 600) + " return false;";
|
|
|
|
e.Row.Attributes["ondblclick"] = "showDetail(this)";
|
|
e.Row.Attributes["itemtype"] = "datatype";
|
|
e.Row.ToolTip = "双击查看详情";
|
|
|
|
}
|
|
}
|
|
|
|
#region 方法 -> 审批通过
|
|
protected void ButtonPass_CallBackClick(object sender, ClientSetEventArgs e)
|
|
{
|
|
int flagCount = 0;
|
|
foreach (GridViewRow _GVR in GridViewEx1.Rows)
|
|
{
|
|
if (_GVR.RowType == DataControlRowType.DataRow)
|
|
{
|
|
if (((CheckBoxEx)_GVR.FindControl("SingleSelect")).Checked)
|
|
{
|
|
flagCount++;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (flagCount == 1)
|
|
{
|
|
e.ClientScript = "$('.WorkFlowDialogMark,.WorkFlowDialogTable').css('display','table');" +
|
|
"$('#" + PanelPass.ClientID + "').css('display','block');";
|
|
}
|
|
else if (flagCount == 0)
|
|
{
|
|
e.ExcuteClientScript(GetAlertStr("请先选择要办结的业务"));
|
|
}
|
|
else
|
|
{
|
|
e.ExcuteClientScript(GetAlertStr("请先选择单条办结的业务"));
|
|
}
|
|
}
|
|
|
|
|
|
protected void ButtonPassSure_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
foreach (GridViewRow _GVR in GridViewEx1.Rows)
|
|
{
|
|
if (_GVR.RowType == DataControlRowType.DataRow)
|
|
{
|
|
if (((CheckBoxEx)_GVR.FindControl("SingleSelect")).Checked)
|
|
{
|
|
string _APPLYPROINST_ID = GridViewEx1.DataKeys[_GVR.RowIndex].Values["APPLYPROINST_ID"].ToString().ToEncrypt();
|
|
Business.APPLYPROINST _APPLYPROINST = new Business.APPLYPROINST(this.Transaction);
|
|
_APPLYPROINST.APPLYPROINST_ID_Encrypt = _APPLYPROINST_ID;
|
|
if (_APPLYPROINST.Select())
|
|
{
|
|
//办结业务 1.插入意见
|
|
Business.APPROVED _APPROVED = new Business.APPROVED(this.Transaction);
|
|
_APPROVED.APPLYPROINST_TYPE = DictionaryHelper.GetFieldEnumName(
|
|
"APPLYPROINST_STATE", _APPLYPROINST.APPLYPROINST_STATE.ToString(), this.Transaction);
|
|
_APPROVED.APPLYPROINST_ID = _APPLYPROINST.APPLYPROINST_ID;
|
|
_APPROVED.APPROVED_DATE = System.DateTime.Now;
|
|
_APPROVED.APPROVED_INFO = TextBoxEx1.Text;
|
|
_APPROVED.PASSPORT_ID = PassportInfo.ID;
|
|
_APPROVED.PASSPORT_NAME = PassportInfo.Name;
|
|
_APPROVED.Insert();
|
|
//2.更新流程信息
|
|
_APPLYPROINST.APPLYPROINST_STATE = 9000;
|
|
_APPLYPROINST.APPLYPROISNT_FLAG = 1;
|
|
_APPLYPROINST.FINISHDATE = System.DateTime.Now;
|
|
_APPLYPROINST.Update();
|
|
//3.更新库存
|
|
Business.ProinstHelper.PutInStock(_APPLYPROINST, GoodsProvinceCode, Request["SENDREC_TYPE"]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
GridViewEx1.SelectingWithInit<Business.APPLYPROINST>(ObjectDataSource1, GridPageEx1,
|
|
DictionaryHelper.GetDictionary(Transaction, "APPLYPROINST_TYPE"));
|
|
|
|
Alert("该业务已经办结!");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Transaction.Rollback();
|
|
Alert("业务办结失败!\r\n" + ex.Message);
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 方法 -> 业务审批驳回
|
|
protected void ButtonBack_CallBackClick(object sender, ClientSetEventArgs e)
|
|
{
|
|
bool flagCount = false;
|
|
foreach (GridViewRow _GVR in GridViewEx1.Rows)
|
|
{
|
|
if (_GVR.RowType == DataControlRowType.DataRow)
|
|
{
|
|
if (((CheckBoxEx)_GVR.FindControl("SingleSelect")).Checked)
|
|
{
|
|
flagCount = true;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (flagCount)
|
|
{
|
|
e.ClientScript = "$('.WorkFlowDialogMark,.WorkFlowDialogTable').css('display','table');" +
|
|
"$('#" + PanelBack.ClientID + "').css('display','block');";
|
|
}
|
|
else
|
|
{
|
|
e.ExcuteClientScript(GetAlertStr("请先选择要驳回的业务"));
|
|
}
|
|
}
|
|
|
|
protected void ButtonBackWorkFlow_Click(object sender, EventArgs e)
|
|
{
|
|
foreach (GridViewRow _GVR in GridViewEx1.Rows)
|
|
{
|
|
if (_GVR.RowType == DataControlRowType.DataRow)
|
|
{
|
|
if (((CheckBoxEx)_GVR.FindControl("SingleSelect")).Checked)
|
|
{
|
|
string _APPLYPROINST_ID = GridViewEx1.DataKeys[_GVR.RowIndex].Values["APPLYPROINST_ID"].ToString().ToEncrypt();
|
|
Business.APPLYPROINST _APPLYPROINST = new Business.APPLYPROINST(this.Transaction);
|
|
_APPLYPROINST.APPLYPROINST_ID_Encrypt = _APPLYPROINST_ID;
|
|
if (_APPLYPROINST.Select())
|
|
{
|
|
if (_APPLYPROINST.APPLYPROINST_STATE.Value < short.Parse(DropDownListEx2.SelectedValue))
|
|
{
|
|
continue;
|
|
}
|
|
//添加对应的审批
|
|
Business.APPROVED _APPROVED = new Business.APPROVED(this.Transaction);
|
|
_APPROVED.APPLYPROINST_TYPE = DictionaryHelper.GetFieldEnumName("APPLYPROINST_STATE",
|
|
_APPLYPROINST.APPLYPROINST_STATE.ToString(), this.Transaction).Replace("审批", "回退");
|
|
_APPROVED.APPLYPROINST_ID = _APPLYPROINST.APPLYPROINST_ID;
|
|
_APPROVED.APPROVED_DATE = System.DateTime.Now;
|
|
_APPROVED.APPROVED_INFO = TextBoxEx1.Text;
|
|
_APPROVED.PASSPORT_ID = PassportInfo.ID;
|
|
_APPROVED.PASSPORT_NAME = PassportInfo.Name;
|
|
_APPROVED.APPROVED_TYPE = 0;
|
|
_APPROVED.Insert();
|
|
|
|
_APPLYPROINST.APPLYPROINST_STATE = short.Parse(DropDownListEx2.SelectedValue);
|
|
_APPLYPROINST.APPLYPROISNT_FLAG = 0;
|
|
_APPLYPROINST.Update();
|
|
|
|
//删除状态码
|
|
|
|
//删除接收数据
|
|
foreach (Business.RECCOMMODITY _RECCOMMODITY in (new Business.RECCOMMODITY(this.Transaction)).FillCollection("where APPLYPROINST_ID=" + _APPLYPROINST.APPLYPROINST_ID))
|
|
{
|
|
_RECCOMMODITY.Delete();
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
GridViewEx1.SelectingWithInit<Business.APPLYPROINST>(ObjectDataSource1, GridPageEx1,
|
|
DictionaryHelper.GetDictionary(Transaction, "APPLYPROINST_TYPE"));
|
|
|
|
Alert("驳回成功!");
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
}
|
|
}
|