128 lines
3.0 KiB
C#
128 lines
3.0 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Text;
|
|||
|
|
using System.Threading;
|
|||
|
|
using Kingdee.BOS.App.Data;
|
|||
|
|
using Kingdee.BOS.BusinessEntity.BusinessFlow;
|
|||
|
|
using Kingdee.BOS.Core;
|
|||
|
|
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
|||
|
|
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
|||
|
|
using Kingdee.BOS.Core.Metadata.Util;
|
|||
|
|
using Kingdee.BOS.KDThread;
|
|||
|
|
using Kingdee.BOS.Orm.DataEntity;
|
|||
|
|
using Kingdee.BOS.ServiceHelper;
|
|||
|
|
|
|||
|
|
namespace Enpower.POSH_CB_PROCOSTRESULTREC
|
|||
|
|
{
|
|||
|
|
public class PCBP_PRT : AbstractDynamicFormPlugIn
|
|||
|
|
{
|
|||
|
|
public override void ButtonClick(ButtonClickEventArgs e)
|
|||
|
|
{
|
|||
|
|
base.ButtonClick(e);
|
|||
|
|
|
|||
|
|
List<string> list = new List<string>();
|
|||
|
|
var a = list.Contains("1");
|
|||
|
|
|
|||
|
|
var proEntity = this.View.Model.BusinessInfo.GetEntryEntity("FAnalyzeProEntity");
|
|||
|
|
|
|||
|
|
var materialEntity = this.View.Model.BillBusinessInfo.GetEntryEntity("FAnalyzeMaterialEntity");
|
|||
|
|
var materialRows = this.View.Model.GetEntityDataObject(materialEntity);
|
|||
|
|
materialRows.Clear();
|
|||
|
|
var tempRow =new List<DynamicObject>();
|
|||
|
|
|
|||
|
|
var row = new DynamicObject(materialEntity.DynamicObjectType);
|
|||
|
|
|
|||
|
|
DBServiceHelper.Execute(this.Context, "");
|
|||
|
|
//DBUtils.ExecuteScalar(this.Context, "");
|
|||
|
|
|
|||
|
|
var b = "aaaaa";
|
|||
|
|
//var c = b.Contains(",");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void Test()
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
DBServiceHelper.ExecuteDynamicObject(null, "");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
|
|||
|
|
/// 显示进度条
|
|||
|
|
|
|||
|
|
/// </summary>
|
|||
|
|
|
|||
|
|
/// <param name="userTruePro">是否使用真的进度值</param>
|
|||
|
|
|
|||
|
|
private void ShowProgressBar(bool userTruePro)
|
|||
|
|
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
this.View.ShowProcessForm(formResult => { }, userTruePro, "正在执行xxx");
|
|||
|
|
|
|||
|
|
// 启动线程执行耗时操作,同时更新执行进度
|
|||
|
|
|
|||
|
|
MainWorker.QuequeTask(this.View.Context, () =>
|
|||
|
|
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
var counter = 30;
|
|||
|
|
|
|||
|
|
for (var x = 1; x < counter; ++x)
|
|||
|
|
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
// TODO
|
|||
|
|
|
|||
|
|
Thread.Sleep(1000);
|
|||
|
|
|
|||
|
|
// 报告下执行进度
|
|||
|
|
|
|||
|
|
var rate = Convert.ToInt32(x * 100 / counter);
|
|||
|
|
|
|||
|
|
this.View.Session["ProcessRateValue"] = rate;
|
|||
|
|
|
|||
|
|
// 进度条界面增加文字提示信息
|
|||
|
|
|
|||
|
|
//this.View.Session["ProcessTips"] = string.Format("任务{0}已处理", x);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
this.View.ShowMessage("操作已完成。");
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
catch (Exception ex)
|
|||
|
|
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
this.View.ShowErrMessage(ex.Message);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
finally
|
|||
|
|
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
// 此句必不可少,进度值100时进度条自动关闭
|
|||
|
|
|
|||
|
|
this.View.Session["ProcessRateValue"] = 100;
|
|||
|
|
|
|||
|
|
this.View.SendDynamicFormAction(this.View);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}, null);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|