SVN r1104
SVN-Revision: r1104
This commit is contained in:
@@ -146,6 +146,10 @@ namespace Lskj.Control
|
||||
/// 分段审批
|
||||
/// </summary>
|
||||
public DataRow SectionAccradit;
|
||||
/// <summary>
|
||||
/// 辅助功能按钮菜单集合
|
||||
/// </summary>
|
||||
public List<SimpleButton> itemCommonList = new List<SimpleButton>();
|
||||
#region 私有变量
|
||||
/// <summary>
|
||||
/// 数量名称
|
||||
@@ -728,6 +732,11 @@ namespace Lskj.Control
|
||||
{
|
||||
this.pMenu.ClearLinks();
|
||||
this.pMprint.ClearLinks();
|
||||
foreach (SimpleButton item in itemCommonList)
|
||||
{
|
||||
if (this.pcTool.Contains(item)) this.pcTool.Controls.Remove(item);
|
||||
}
|
||||
this.itemCommonList.Clear();
|
||||
this.SysModel = SysModel;
|
||||
this._isInitFinish = false;
|
||||
this.splitMain.Visible = false;
|
||||
@@ -1020,13 +1029,31 @@ namespace Lskj.Control
|
||||
dpb_Tools.Enabled = false;
|
||||
return;
|
||||
}
|
||||
int i = 0, x = 4;
|
||||
foreach (DataRow item in tableCommon.Rows)
|
||||
{
|
||||
BarButtonItem itemCommon = new BarButtonItem();
|
||||
itemCommon.Caption = item["menuname"] + "";
|
||||
itemCommon.Tag = item;
|
||||
itemCommon.ItemClick += new ItemClickEventHandler(itemCommon_ItemClick);
|
||||
this.pMenu.AddItem(itemCommon);
|
||||
if (i > 1)
|
||||
{
|
||||
BarButtonItem itemCommon = new BarButtonItem();
|
||||
itemCommon.Caption = item["menuname"] + "";
|
||||
itemCommon.Tag = item;
|
||||
itemCommon.ItemClick += new ItemClickEventHandler(itemCommon_ItemClick);
|
||||
this.pMenu.AddItem(itemCommon);
|
||||
}
|
||||
else
|
||||
{
|
||||
SimpleButton itemCommon = new SimpleButton();
|
||||
//itemCommon.AutoSize = true;
|
||||
itemCommon.Text = item["menuname"] + "";
|
||||
itemCommon.Tag = item;
|
||||
itemCommon.Size = new System.Drawing.Size(90, 26);
|
||||
itemCommon.Click += new EventHandler(itemCommon_Click);
|
||||
itemCommon.Location = new Point(x + 6, 6);
|
||||
x += itemCommon.Width + 6;
|
||||
pcTool.Controls.Add(itemCommon);
|
||||
itemCommonList.Add(itemCommon);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -1048,6 +1075,30 @@ namespace Lskj.Control
|
||||
CommonMenu menu = new CommonMenu(this.SysModel, this.ControlObj);
|
||||
menu.Apply(rowItem);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 常用工具点击
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void itemCommon_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
SimpleButton btn = sender as SimpleButton;
|
||||
DataRow rowItem = btn.Tag as DataRow;
|
||||
CommonMenu menu = new CommonMenu(this.SysModel, this.ControlObj);
|
||||
menu.Apply(rowItem);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message, ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
#region 设置窗体大小
|
||||
/// <summary>
|
||||
@@ -2020,24 +2071,46 @@ namespace Lskj.Control
|
||||
/// <returns>System.String.</returns>
|
||||
private string GetDetailRecord(string guid)
|
||||
{
|
||||
|
||||
// 构造明细
|
||||
StringBuilder detailBuilder = new StringBuilder();
|
||||
DataTable DetailedProperties = BaseImpl.GetDataTableResult(string.Format("select COLUMN_NAME,DATA_TYPE,CHARACTER_MAXIMUM_LENGTH from information_schema.columns where table_name = '{0}'", BillModelObj.DetailTable + "_temp"));//单据明细性表
|
||||
DataTable detailTable = this.gcDetail.GridControl.DataSourceTable().TrimDeleteRows();
|
||||
//if (this.BillModelObj.DetailTreeTable)
|
||||
//{
|
||||
// detailTable = ((this.gcDetail as TreeGridControlEx).TreeListObj.DataSource as DataTable).TrimDeleteRows();
|
||||
//}
|
||||
if (detailTable.Rows.Count > 0)
|
||||
{
|
||||
DataTable BillColumns = BaseImpl.GetDataTableResult(string.Format("select * from {0} where 1<>1", BillModelObj.DetailTable));
|
||||
IEnumerable<DataColumn> detailColumns = BillColumns.Columns.Cast<DataColumn>();
|
||||
DataTable BillTempColumns = BaseImpl.GetDataTableResult(string.Format("select * from {0} where 1<>1", BillModelObj.DetailTable + "_temp"));
|
||||
foreach (DataRow dataRow in detailTable.Rows)
|
||||
{
|
||||
StringBuilder fields = new StringBuilder();
|
||||
StringBuilder values = new StringBuilder();
|
||||
string detailSql = @"insert into " + BillModelObj.DetailTable + "_temp" + "({0}) values({1})";
|
||||
|
||||
fields.Append("sysstr,");
|
||||
values.Append("'" + guid + "',");
|
||||
foreach (DataColumn item in detailTable.Columns)
|
||||
{
|
||||
if (item.ColumnName.Equals(guidField) || item.ColumnName.Equals(mRecordPrimaryField) || item.ColumnName.Equals(ERPInfo.Instance.isAddRows)) continue;
|
||||
var selectColumn = detailColumns.Where(n => n.ColumnName.Equals(item.ColumnName, StringComparison.OrdinalIgnoreCase));
|
||||
if (selectColumn.Count() == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
fields.Append(item.ColumnName + ",");
|
||||
string fieldValue = (dataRow[item] + "").Replace("'", "''");
|
||||
|
||||
if (!BillTempColumns.Columns.Contains(item.ColumnName))
|
||||
{
|
||||
string type = "varchar(50)";
|
||||
if (item.DataType == typeof(DateTime))
|
||||
{
|
||||
type = "datetime";
|
||||
}
|
||||
BaseImpl.ExecSqlValue(string.Format("alter table {0} add {1} {2}", BillModelObj.DetailTable + "_temp", item.ColumnName, type));
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(fieldValue))
|
||||
{
|
||||
values.Append(item.DataType == typeof(DateTime) ? "N'" + Convert.ToDateTime(fieldValue).ToString("yyyy-MM-dd HH:mm:ss") + "'," : "N'" + fieldValue + "',");
|
||||
@@ -2056,11 +2129,54 @@ namespace Lskj.Control
|
||||
values.Append("'',");
|
||||
}
|
||||
}
|
||||
|
||||
detailBuilder.AppendFormat(detailSql, fields.ToString().Trim(','), values.ToString().Trim(','));
|
||||
}
|
||||
}
|
||||
|
||||
return detailBuilder.ToString();
|
||||
|
||||
|
||||
// 构造明细
|
||||
//StringBuilder detailBuilder = new StringBuilder();
|
||||
//DataTable detailTable = this.gcDetail.GridControl.DataSourceTable().TrimDeleteRows();
|
||||
//if (detailTable.Rows.Count > 0)
|
||||
//{
|
||||
// foreach (DataRow dataRow in detailTable.Rows)
|
||||
// {
|
||||
// StringBuilder fields = new StringBuilder();
|
||||
// StringBuilder values = new StringBuilder();
|
||||
// string detailSql = @"insert into " + BillModelObj.DetailTable + "_temp" + "({0}) values({1})";
|
||||
// fields.Append("sysstr,");
|
||||
// values.Append("'" + guid + "',");
|
||||
// foreach (DataColumn item in detailTable.Columns)
|
||||
// {
|
||||
// if (item.ColumnName.Equals(guidField) || item.ColumnName.Equals(mRecordPrimaryField) || item.ColumnName.Equals(ERPInfo.Instance.isAddRows)) continue;
|
||||
// fields.Append(item.ColumnName + ",");
|
||||
// string fieldValue = (dataRow[item] + "").Replace("'", "''");
|
||||
|
||||
// if (!string.IsNullOrWhiteSpace(fieldValue))
|
||||
// {
|
||||
// values.Append(item.DataType == typeof(DateTime) ? "N'" + Convert.ToDateTime(fieldValue).ToString("yyyy-MM-dd HH:mm:ss") + "'," : "N'" + fieldValue + "',");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (item.DataType == typeof(Decimal) ||
|
||||
// item.DataType == typeof(Double) ||
|
||||
// item.DataType == typeof(Int16) ||
|
||||
// item.DataType == typeof(Int32) ||
|
||||
// item.DataType == typeof(Int64))
|
||||
// values.Append("0,");
|
||||
// else if (item.DataType == typeof(DateTime))
|
||||
// values.Append("NULL,");
|
||||
// else
|
||||
// values.Append("'',");
|
||||
// }
|
||||
// }
|
||||
|
||||
// detailBuilder.AppendFormat(detailSql, fields.ToString().Trim(','), values.ToString().Trim(','));
|
||||
// }
|
||||
//}
|
||||
//return detailBuilder.ToString();
|
||||
}
|
||||
#endregion
|
||||
#region 审核保存时候
|
||||
@@ -2198,6 +2314,22 @@ namespace Lskj.Control
|
||||
{
|
||||
try
|
||||
{
|
||||
//获取当前页签的GridControlEx和选中行行号
|
||||
int oldRowHandle = 0;
|
||||
GridControlEx SelectGridControlEx = null;
|
||||
foreach (TabPageObj tab in this._tabPageObjs)
|
||||
{
|
||||
if (tab.TabPage == this.tabMain.SelectedTabPage)
|
||||
{
|
||||
foreach (TabPageItemObj item in tab.TabPageItemObjs)
|
||||
{
|
||||
SelectGridControlEx = item.GridControlObj;
|
||||
oldRowHandle = item.GridControlObj.GridView.FocusedRowHandle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
List<DataRow> rowItems = new List<DataRow>();
|
||||
if (BaseAccraditModelObj.MuitlAuditBackFlag)
|
||||
{
|
||||
@@ -2237,11 +2369,12 @@ namespace Lskj.Control
|
||||
foreach (DataRow item in rowItems)
|
||||
{
|
||||
if (firstLoad) ret = ExecuteBackSelect(item);
|
||||
if (ret == -9) return;
|
||||
string nextSelectStepCode = string.Empty;
|
||||
string nextSelectStepOper = string.Empty;
|
||||
WaitForm.ShowForm("正在返退[" + item[this.BaseAccraditModelObj.TmpParmaryField] + "]单据!");
|
||||
//string result = BaseAuditImpl.Audit(out nextSelectStepCode, out nextSelectStepOper, this.SysModel, this.SysModel.StepCode, this.SysModel.BillDocumentId, "", this.BillAuditComObj.ProcedureName, "R", "0", this._auditAdvice, "", "", true, ret);
|
||||
string result = BaseAuditImpl.Audit(out nextSelectStepCode, out nextSelectStepOper, out string msgText, this.SysModel, this.SysModel.StepCode, this.SysModel.BillDocumentId, "", this.BillAuditComObj.ProcedureName, "R", "0", this._auditAdvice, "", "", true, ret);
|
||||
string result = BaseAuditImpl.Audit(out nextSelectStepCode, out nextSelectStepOper, out string msgText, this.SysModel, item[this.BaseAccraditModelObj.TmpStepField] + "", item[this.BaseAccraditModelObj.TmpParmaryField] + "", "", this.BillAuditComObj.ProcedureName, "R", "0", this._auditAdvice, "", "", true, ret);
|
||||
|
||||
if ("1".Equals(result))
|
||||
{
|
||||
@@ -2255,6 +2388,7 @@ namespace Lskj.Control
|
||||
firstLoad = false;
|
||||
}
|
||||
MessageUtil.Show("返退成功:" + success + "\r\n" + "返退失败:" + fault + (string.IsNullOrEmpty(tipMsg) ? "" : "\r\n失败原因如下:" + tipMsg));
|
||||
RefreshTabPage();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2282,6 +2416,7 @@ namespace Lskj.Control
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user