using NFine.Data.Extensions; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using NFine.Code; using NFine.Repository; using System.Data.Common; using NFine.Domain._03_Entity.SRM; using ICS.Application.Entity; using Newtonsoft.Json; using System.Configuration; using System.Data.SqlClient; using ICS.Data; using Newtonsoft.Json.Linq; namespace NFine.Application.WMS { public class PrintApp : RepositoryFactory { public DataTable GetLableType() { string WorkPoint = NFine.Code.OperatorProvider.Provider.GetCurrent().Location.TrimEnd(','); string sql = @" select '' as F_ItemCode,'' as F_ItemName union all SELECT DISTINCT a.F_ItemCode,isnull(a.F_ItemName,'') as F_ItemName FROM dbo.Sys_SRM_ItemsDetail a left join Sys_SRM_Items b on a.F_ItemId=b.F_Id where b.F_EnCode='BQ001'"; string role = NFine.Code.OperatorProvider.Provider.GetCurrent().RoleEnCode; DataTable dt = SqlHelper.GetDataTableBySql(sql); return dt; } public DataTable GetLableSourceID() { string WorkPoint = NFine.Code.OperatorProvider.Provider.GetCurrent().Location.TrimEnd(','); string sql = @" select '' as ID,'' as SourceName union all select distinct ID,SourceName from Sys_LableDataSource"; string role = NFine.Code.OperatorProvider.Provider.GetCurrent().RoleEnCode; DataTable dt = SqlHelper.GetDataTableBySql(sql); return dt; } public DataTable GetSys_LablesID(string LableType) { string WorkPoint = NFine.Code.OperatorProvider.Provider.GetCurrent().Location.TrimEnd(','); string sql = @" select '' as ID,'' as LableName union all select distinct ID,LableName from Sys_Lables where LableType='{0}'"; sql = string.Format(sql, LableType); string role = NFine.Code.OperatorProvider.Provider.GetCurrent().RoleEnCode; DataTable dt = SqlHelper.GetDataTableBySql(sql); return dt; } public DataTable SelectColumnName(string BeginTime, string EndTime) { string sql = @"select ColCode, ColName from ICSExtensionEnable where Enable=1 order by cast(EATTRIBUTE1 as int)"; DataTable dt = SqlHelper.GetDataTableBySql(sql); return dt; } public string GetCnValue(string Code) { try { object MultipleLanguageSetting = GetMultipleLanguageSetting(); string content = ""; string sql = string.Format(@"select {1} from Sys_Language where Code='{0}'", Code, MultipleLanguageSetting); DataTable dt = SqlHelper.GetDataTableBySql(sql); if (dt != null && dt.Rows.Count > 0) { content = dt.Rows[0]["" + MultipleLanguageSetting + ""].ToString().ToUpper(); } else { content = ""; } return content; } catch (Exception ex) { throw new Exception(ex.Message.ToString()); } } public object GetMultipleLanguageSetting() { try { string sql = string.Format(@"select top 1 b.F_Define1 from Sys_SRM_Items a left join Sys_SRM_ItemsDetail b on a.F_Id=b.F_ItemId where a.F_EnCode='LGG0001' and b.F_EnabledMark='1' order by b.F_ItemCode"); object MultipleLanguageSetting = SqlHelper.ExecuteScalar(sql); return MultipleLanguageSetting; } catch (Exception ex) { throw new Exception(ex.Message.ToString()); } } } }