锐腾搅拌上料功能
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

151 lines
5.2 KiB

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using ICSSoft.Frame.User.BLL;
using ICSSoft.Base.Language.Tool;
using ICSSoft.Base.UserControl.MessageControl;
using System.Data.SqlClient;
using ICSSoft.Base.Config.AppConfig;
using ICSSoft.Base.Report.Filter;
using ICSSoft.Base.Config.DBHelper;
using ICSSoft.Base.UserControl.FormControl;
using ICSSoft.Base.ReferForm.AppReferForm;
using ICSSoft.Base.Lable.PrintTool;
using ICSSoft.Frame.Data.DAL;
using ICSSoft.Frame.Data.BLL;
using ICSSoft.Frame.Data.Entity;
using System.Collections;
using System.Linq;
using System.Text.RegularExpressions;
using System.IO;
using ICSSoft.Frame.DataConnect;
namespace ICSSoft.Frame.APP
{
public partial class FormICSJJCollect : DevExpress.XtraEditors.XtraForm
{
//private FramDataContext _domainDataProvider = null;
////private ICSRES Resource;
////private ProductInfo product;
//private ICSBaseModel _ICSBaseModel = null;
//private DataCollectFacade _DataCollectFacade = null;
public string res = "";
private DataTable dtone;
private DataTable dttwo;
private bool isGOOD = true;
private List<string> fileNames = new List<string>();
private string secDocNo = ""; //查看当前
private string Suffix = "pdf";
public FormICSJJCollect()
{
InitializeComponent();
this.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
this.WindowState = FormWindowState.Maximized;
//_domainDataProvider = new FramDataContext(AppConfig.AppConnectString);
//_DataCollectFacade = new DataCollectFacade(this._domainDataProvider);
//_ICSBaseModel = new ICSBaseModel(this._domainDataProvider);
userControlCollectBeginTop1.LotCodeChange += LotCodeChanged;
}
#region SystemOptition
/// <summary>
/// 操作权限
/// </summary>
/// <returns></returns>
public DataTable RightOfExute()
{
DataTable rData = new DataTable();
rData.Columns.Add("BtnName");
rData.Columns.Add("ActionName");
//查看权限(必须有)
DataRow seeRow = rData.NewRow();
seeRow["BtnName"] = "see";
seeRow["ActionName"] = "查看";
rData.Rows.Add(seeRow);
rData.AcceptChanges();
return rData;
}
/// <summary>
/// 数据权限
/// </summary>
/// <returns></returns>
public DataTable RightOfData()
{
DataTable rData = new DataTable();
rData.Columns.Add("BodyName");
rData.Columns.Add("ControlName");
rData.Columns.Add("ControlCaption");
rData.AcceptChanges();
return rData;
}
#endregion
#region 关闭
private void btnClose_Click(object sender, EventArgs e)
{
AppConfig.CloseFormShow(this.Text);
this.Close();
}
private void btnCancle_Click(object sender, EventArgs e)
{
AppConfig.CloseFormShow(this.Text);
this.Close();
}
#endregion
private void btnEnlargeTZ_Click(object sender, EventArgs e)
{
FileDrawing.Enlarge(axAcroPDFTZ);
}
#region 根据存货编码查询列表信息
private void BandData(string itemCode,string RouteCode,string OpCode)
{
try
{
string sql = @"SELECT EnumName FROM Sys_EnumKey WHERE EnumKey='00006'";
//sql = string.Format(sql, itemCode);
string connectionString = AppConfig.FrameConnectString; // AppConfig.GetDataBaseConnectStringByKey("[DB.PLM]");
if (string.IsNullOrWhiteSpace(connectionString))
return;
object name = DBHelper.ExecuteScalar(connectionString, CommandType.Text, sql);
if (name == null || string.IsNullOrWhiteSpace(name.ToString()))
return;
string fileName = name.ToString() + itemCode + "\\" + RouteCode + "\\" + itemCode+OpCode + ".pdf";
if (!string.IsNullOrEmpty(fileName))
{
axAcroPDFTZ.LoadFile(fileName);
axAcroPDFTZ.setShowToolbar(false);
axAcroPDFTZ.setShowScrollbars(false);
axAcroPDFTZ.setPageMode("thumbs");
axAcroPDFTZ.setLayoutMode("SinglePage");
axAcroPDFTZ.setView("Fit");
axAcroPDFTZ.Show();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
#endregion
private void LotCodeChanged(string ItemCode, string RouteCode, string OpCode)
{
if (string.IsNullOrWhiteSpace(ItemCode) || string.IsNullOrWhiteSpace(RouteCode) || string.IsNullOrWhiteSpace(OpCode))
return;
BandData(ItemCode, RouteCode, OpCode);
}
}
}