123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- using LYFZ.Helper;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Data.SqlClient;
- using System.Linq;
- using System.Text;
- namespace LYFZ.Software.MainBusiness.MultipleFileImport
- {
- public class SqlCommandInfo
- {
- public string sqlInfo { get; set; }
- public Hashtable paramList = new Hashtable();
- public string nextType { get; set; }
- }
- public class frmFileImportBaseModel
- {
- public string strDirectoryType { get; set; }
- /// <summary>
- /// 景点名称
- /// </summary>
- public string takenName { get; set; }
- /// <summary>
- /// 数码编号
- /// </summary>
- public string OrdViceNumber { get; set; }
- /// <summary>
- /// 订单编号
- /// </summary>
- public string OrdNumber { get; set; }
- /// <summary>
- /// 服务器路径
- /// </summary>
- public string service_Path { get; set; }
- /// <summary>
- /// 文件本地路基
- /// </summary>
- public List<frmFileImportItemModel> local_Path =null;
- public string CurrentCompanyInfoID { get; set; }
- public string comeDirectoryPath { get; set; }
- public bool importGenerateThumbnails { get; set; }
- public string okActive = "";
- /// <summary>
- /// 是否导入成功
- /// </summary>
- public bool Success { get; set; }
- /// <summary>
- /// 错误信息
- /// </summary>
- public string errorMsg { get; set; }
- /// <summary>
- /// 状态
- /// </summary>
- public string StrStatus { get; set; }
- public string JID { get; set; }
- public Hashtable htdata { get; set; }
- public List<SqlCommandInfo> CusFrmClist { get; set; }
-
- }
- public class frmFileImportModel :frmFileImportBaseModel
- {
- //public string
- public LYFZ.Model.Model_ErpOrder erpOrder { get; set; }
- public LYFZ.Model.Model_ErpOrderDigital erpDigOrder { get; set; }
- public LYFZ.BLL.SelectPhotoHandling sPh { get; set; }
- public List<CommandInfo> FrmClist { get; set; }
- public Hashtable htdata { get; set; }
- string _cusName { get; set; }
- /// <summary>
- /// 客户名称
- /// </summary>
- public string cusName
- {
- get
- {
- if (string.IsNullOrEmpty(_cusName))
- {
- _cusName = new BLL.BLL_ErpCustomer().GetCustomerNameList(erpOrder.Ord_Number);
- }
- return _cusName;
- }
- }
- /// <summary>
- /// 文件类型
- /// </summary>
- public LYFZ.Model.Model_ErpOrder.DirectoryType directoryType { get; set; }
- public string directoryTypeDis()
- {
- switch(directoryType)
- {
- case LYFZ.Model.Model_ErpOrder.DirectoryType.DesignPiece:
- return "设计";
- //break;
- case Model.Model_ErpOrder.DirectoryType.EarlyRetouch:
- return "初修";
- //break;
- case Model.Model_ErpOrder.DirectoryType.FineRetouch:
- return "精修";
- // break;
- case Model.Model_ErpOrder.DirectoryType.PrimitivePicture:
- return "原片";
- // break;
- }
- return "";
- }
- public EffentNextType EffentNextTypeInfo(string txt)
- {
- switch (txt)
- {
-
- case "None":
- return EffentNextType.None;
- case "WhenHaveContine":
- return EffentNextType.WhenHaveContine;
- case "WhenNoHaveContine":
- return EffentNextType.WhenNoHaveContine;
- case "ExcuteEffectRows":
- return EffentNextType.ExcuteEffectRows;
- case "SolicitationEvent":
- return EffentNextType.SolicitationEvent;
- }
- return EffentNextType.None;
- }
-
- public frmFileImportModel()
- {
- local_Path = new List<frmFileImportItemModel>();
- FrmClist = new List<CommandInfo>();
- CusFrmClist = new List<SqlCommandInfo>();
- errorMsg = "";
- }
- public frmFileImportBaseModel CloneBaseData()
- {
- frmFileImportBaseModel baseMod = new frmFileImportBaseModel()
- {
- local_Path = this.local_Path.FindAll(p => p.code == 0 || p.code == -1),
- OrdNumber = this.OrdNumber,
- OrdViceNumber = this.OrdViceNumber,
- service_Path = this.service_Path,
- takenName = this.takenName,
- strDirectoryType=this.directoryType.ToString(),
- comeDirectoryPath = this.comeDirectoryPath,
- CurrentCompanyInfoID = this.CurrentCompanyInfoID,
- importGenerateThumbnails = this.importGenerateThumbnails,
- okActive = this.okActive,
- Success =this.Success,
- errorMsg=this.errorMsg,
- StrStatus = this.StrStatus,
- htdata = this.htdata,
- JID = this.JID,
-
- };
- ///村粗sql信息
- baseMod.CusFrmClist = new List<SqlCommandInfo>();
- foreach(var mod in this.FrmClist)
- {
- SqlCommandInfo comInfo = new SqlCommandInfo()
- {
- sqlInfo = mod.CommandText,
- nextType = mod.EffentNextType.ToString(),
- };
- comInfo.paramList = new Hashtable();
- foreach(var paramMod in mod.Parameters)
- {
- if (paramMod.Value==null)
- {
- comInfo.paramList[paramMod.ParameterName] = paramMod.Value;
- }
- else
- {
- comInfo.paramList[paramMod.ParameterName] = paramMod.Value.ToString();
- }
-
- }
- baseMod.CusFrmClist.Add(comInfo);
- }
- if (baseMod.htdata != null)
- {
- baseMod.htdata.Remove("clist");
- }
- return baseMod;
- }
- public void BindBaseDataToModel(frmFileImportBaseModel baseData)
- {
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- LYFZ.BLL.BLL_ErpOrderDigital dbll = new BLL.BLL_ErpOrderDigital();
- this.local_Path = baseData.local_Path;
- this.OrdNumber = baseData.OrdNumber;
- this.OrdViceNumber = baseData.OrdViceNumber;
- this.service_Path = baseData.service_Path;
- this.takenName = baseData.takenName;
- this.comeDirectoryPath = baseData.comeDirectoryPath;
- this.CurrentCompanyInfoID = baseData.CurrentCompanyInfoID;
- this.importGenerateThumbnails = baseData.importGenerateThumbnails;
- this.okActive = baseData.okActive;
- this.Success = baseData.Success;
- this.errorMsg = baseData.errorMsg;
- this.StrStatus = baseData.StrStatus;
- this.htdata = baseData.htdata;
- this.JID = baseData.JID;
- this.CusFrmClist = baseData.CusFrmClist;
- this.erpOrder = orbll.GetModel("Ord_Number", OrdNumber);
- this.erpDigOrder = dbll.GetModel("Ordv_ViceNumber", OrdViceNumber);
- this.sPh = new BLL.SelectPhotoHandling(erpOrder, erpDigOrder);
- this.FrmClist = new List<CommandInfo>();
- foreach (var frmMod in this.CusFrmClist)
- {
- List<SqlParameter> sqlParamList=new List<SqlParameter>();
- foreach(string key in frmMod.paramList.Keys)
- {
- sqlParamList.Add(new SqlParameter(key,frmMod.paramList[key]));
- }
- CommandInfo comInfo = new CommandInfo(frmMod.sqlInfo, sqlParamList.ToArray(), EffentNextTypeInfo(frmMod.nextType));
- this.FrmClist.Add(comInfo);
- }
- switch (baseData.strDirectoryType)
- {
- case "PrimitivePicture":
- this.directoryType = Model.Model_ErpOrder.DirectoryType.PrimitivePicture;
- break;
- case "EarlyRetouch":
- this.directoryType = Model.Model_ErpOrder.DirectoryType.EarlyRetouch;
- break;
- case "FineRetouch":
- this.directoryType = Model.Model_ErpOrder.DirectoryType.FineRetouch;
- break;
- case "DesignPiece":
- this.directoryType = Model.Model_ErpOrder.DirectoryType.DesignPiece;
- break;
- }
- }
- }
- }
|