Beispiel #1
0
        internal DataTable LoadAllItem(eSqlOperator sqlOperator, string[] ItemTypes, NZString strDealing
                                       , DataDefine.eDealingType argDealingType)
        {
            ItemBIZ biz = new ItemBIZ();

            return(biz.LoadAllItemWithItemType(sqlOperator, ItemTypes, strDealing, argDealingType));
        }
Beispiel #2
0
        public ItemFindDialog(eSqlOperator sqlOperator, eItemType[] eItemTypes)
        {
            InitializeComponent();

            SelectedItem = new ItemUIDM();

            m_sqlOperator = sqlOperator;

            if (eItemTypes != null && eItemTypes.Length > 0)
            {
                if (eItemTypes.Length == 1 && eItemTypes[0] == eItemType.All)
                {
                    ItemTypes = new string[] { "SHAFT", "SCREW", "WASHER" };
                }
                else
                {
                    ItemTypes = new string[eItemTypes.Length];
                    for (int i = 0; i < eItemTypes.Length; i++)
                    {
                        //ItemTypes[i] = string.Format("{0:00}", (int)eItemTypes[i]);
                        ItemTypes[i] = eItemTypes[i].ToString();
                    }
                }
            }
        }
Beispiel #3
0
        public static ItemFindDialog ShowDialogWithOperator(IWin32Window window, eSqlOperator sqlOperator, eItemType[] eItemTypes, NZString argDealingCode, DataDefine.eDealingType argDealingType)
        {
            ItemFindDialog dialog = new ItemFindDialog(sqlOperator, eItemTypes, argDealingCode, argDealingType);

            dialog.m_loadType = eLoadType.WithOperator;

            dialog.ShowDialog(window);
            return(dialog);
        }
Beispiel #4
0
        public static ItemFindDialog ShowDialogWithOperator(IWin32Window window, eSqlOperator sqlOperator, eItemType[] eItemTypes)
        {
            ItemFindDialog dialog = new ItemFindDialog(sqlOperator, eItemTypes);

            dialog.m_loadType = eLoadType.WithOperator;

            dialog.ShowDialog(window);
            return(dialog);
        }
Beispiel #5
0
        public ErrorItem CheckNotExistWithItemType(NZString ItemCD, eSqlOperator sqlOperator, string[] itemTypes)
        {
            ItemDAO dao = new ItemDAO(CommonLib.Common.CurrentDatabase);

            if (!dao.ExistWithItemTypes(null, ItemCD, sqlOperator, itemTypes))
            {
                ErrorItem errorItem = new ErrorItem(ItemCD.Owner, TKPMessages.eValidate.VLM0009.ToString());
                return(errorItem);
            }
            return(null);
        }
Beispiel #6
0
        public ItemFindDialog(eSqlOperator sqlOperator, eItemType[] eItemTypes, NZString argDealingCode, DataDefine.eDealingType argDealingType)
            : this(sqlOperator, eItemTypes)
        {
            m_DealingType = argDealingType;

            if (argDealingCode != null && !argDealingCode.IsNull)
            {
                this.m_DealingCode = argDealingCode;
            }
            else
            {
                this.m_DealingCode = new NZString(null, "");
            }
        }
Beispiel #7
0
        public DataTable LoadAllItemWithItemType(Database database, eSqlOperator sqlOperator, string[] ItemTypes, NZString strSupplier)
        {
            Database db = UseDatabase(database);

            string sql =
                @"SELECT T.*,
                   TT.ORDER_LOC_CD,
                   TT.STORE_LOC_CD,
                   TT.ORDER_PROCESS_CLS,
                   TT.ORDER_LOC_CD,
                   TT.STORE_LOC_CD,
                   TT.PACK_SIZE,
                   TT.CONSUMTION_CLS,
                   TT.LOT_SIZE
                   
            FROM TB_ITEM_MS T
                 INNER JOIN TB_ITEM_PROCESS_MS TT ON T.ITEM_CD = TT.ITEM_CD";

            if (ItemTypes != null && ItemTypes.Length > 0)
            {
                string strOperator = "IN";
                if (sqlOperator == eSqlOperator.NotIn)
                {
                    strOperator = "NOT IN";
                }

                sql += string.Format(" WHERE t.ITEM_CLS {0} (", strOperator);

                for (int i = 0; i < ItemTypes.Length; i++)
                {
                    sql += "'" + ItemTypes[i] + "'";

                    if (i < ItemTypes.Length - 1)
                    {
                        sql += ", ";
                    }
                }

                sql += " )";
            }

            sql += " AND TT.ORDER_LOC_CD = :SUPPLIER_CD";

            DataRequest req = new DataRequest(sql);

            req.Parameters.Add("SUPPLIER_CD", strSupplier.Value);

            return(db.ExecuteQuery(req));
        }
Beispiel #8
0
        /// <summary>
        /// Check exists the specified key.
        /// </summary>
        public bool ExistWithItemTypes(Database database, NZString ITEM_CD, eSqlOperator sqlOperator, string[] itemTypes)
        {
            Database db = UseDatabase(database);

            StringBuilder sb = new StringBuilder();

            sb.AppendLine(" SELECT 1 ");
            sb.AppendLine(" FROM TB_ITEM_MS ");
            sb.AppendLine(" WHERE ITEM_CD = :ITEM_CD ");

            if (itemTypes != null && itemTypes.Length > 0)
            {
                string strOperator = "IN";
                if (sqlOperator == eSqlOperator.NotIn)
                {
                    strOperator = "NOT IN";
                }

                sb.AppendLine(string.Format(" AND ITEM_CLS {0} (", strOperator));

                for (int i = 0; i < itemTypes.Length; i++)
                {
                    sb.AppendLine("'" + itemTypes[i] + "'");

                    if (i < itemTypes.Length - 1)
                    {
                        sb.AppendLine(", ");
                    }
                }

                sb.AppendLine(" )");
            }
            DataRequest req = new DataRequest(sb.ToString());

            req.Parameters.Add("ITEM_CD", DataType.NVarChar, ITEM_CD.Value);

            return(db.ExecuteQuery(req).Rows.Count > 0);
        }
Beispiel #9
0
        public DataTable LoadAllItemWithItemType(Database database, eSqlOperator sqlOperator, string[] ItemTypes, NZString strDealing, DataDefine.eDealingType argDealingType)
        {
            Database db = UseDatabase(database);

            string sql =
                @"SELECT T.*, DL.LOC_DESC
                FROM TB_ITEM_MS T 
                LEFT JOIN TB_DEALING_MS DL ON T.CUSTOMER_CD = DL.LOC_CD";

            DataRequest req = new DataRequest();

            if (strDealing != null && !"".Equals(strDealing.NVL("")))
            {
                sql += " WHERE T.CUSTOMER_CD = @CUSTOMER_CD";

                req.Parameters.Add("@CUSTOMER_CD", strDealing.Value);
            }

            sql += " ORDER BY T.ITEM_CD";

            req.CommandText = sql;

            return(db.ExecuteQuery(req));
        }
Beispiel #10
0
 public static ItemFindDialog ShowDialogWithOperator(eSqlOperator sqlOperator, eItemType[] eItemTypes, NZString argDealingCode, DataDefine.eDealingType argDealingType)
 {
     return(ShowDialogWithOperator(null, sqlOperator, eItemTypes, argDealingCode, argDealingType));
 }
Beispiel #11
0
 public static ItemFindDialog ShowDialogWithOperator(eSqlOperator sqlOperator, eItemType[] eItemTypes)
 {
     return(ShowDialogWithOperator(null, sqlOperator, eItemTypes));
 }
Beispiel #12
0
        internal DataTable LoadAllItem(eSqlOperator sqlOperator, string[] ItemTypes)
        {
            ItemBIZ biz = new ItemBIZ();

            return(biz.LoadAllItemWithItemType(sqlOperator, ItemTypes));
        }
Beispiel #13
0
        public DataTable LoadAllItemWithItemType(eSqlOperator sqlOperator, string[] ItemTypes, NZString strDealing, DataDefine.eDealingType argDealingType)
        {
            ItemDAO dao = new ItemDAO(CommonLib.Common.CurrentDatabase);

            return(dao.LoadAllItemWithItemType(null, sqlOperator, ItemTypes, strDealing, argDealingType));
        }
Beispiel #14
0
        public DataTable LoadAllItemWithItemType(eSqlOperator sqlOperator, string[] ItemTypes)
        {
            ItemDAO dao = new ItemDAO(CommonLib.Common.CurrentDatabase);

            return(dao.LoadAllItemWithItemType(null, sqlOperator, ItemTypes));
        }
Beispiel #15
0
        public DataTable LoadAllItemWithItemType(Database database, eSqlOperator sqlOperator, string[] ItemTypes)
        {
            Database db = UseDatabase(database);

            string sql =
                @"SELECT TIM.* , DL.LOC_DESC "
                //TIM.ITEM_CD,
                //TIM.SHORT_NAME,
                //TIM.ITEM_DESC,
                //TIM.KIND_OF_PRODUCT,
                //TIM.CUSTOMER_CD,
                //TIM.CUSTOMER_USE_POINT,
                //TIM.WEIGHT,
                //TIM.BOI,
                //TIM.PRODUCTION_DI,
                //TIM.ITEM_LEVEL,
                //TIM.MAT_NAME,
                //TIM.MAT_SIZE,
                //TIM.MAT_SUPPLIER_CD,
                //TIM.KIND_OF_MAT,
                //TIM.MAT_DI,
                //TIM.REMARK,
                //TIM.CRT_DATE,
                //TIM.CRT_BY,
                //TIM.UPD_DATE,
                //TIM.UPD_BY,
                //TIM.SCREW_KIND,
                //TIM.SCREW_HEAD,
                //TIM.SCREW_M,
                //TIM.SCREW_L,
                //TIM.SCREW_TYPE,
                //TIM.SCREW_REMARK1,
                //TIM.SCREW_REMARK2,
                //TIM.HEXABULAR,
                //--TIMM.MACHINE_PROCESS AS PROCESS1,
                //--TIMM.MACHINE_TYPE AS MACHINE_TYPE1,
                //--TIMM.MACHINE_PROCESS AS PROCESS2,
                //--TIMM.MACHINE_TYPE AS MACHINE_TYPE2,
                //--TIMM.MACHINE_PROCESS AS PROCESS3,
                //--TIMM.MACHINE_TYPE AS MACHINE_TYPE3,
                //--TIMM.MACHINE_PROCESS AS PROCESS4,
                //--TIMM.MACHINE_TYPE AS MACHINE_TYPE4,
                //--TIMM.MACHINE_PROCESS AS PROCESS5,
                //--TIMM.MACHINE_TYPE AS MACHINE_TYPE5,
                //--TIMM.MACHINE_PROCESS AS PROCESS6,
                //--TIMM.MACHINE_TYPE AS MACHINE_TYPE6,
                //TIM.HEAT_FLAG,
                //TIM.HEAT_TYPE,
                //TIM.HEAT_HARDNESS,
                //TIM.HEAT_CORE_HARDNESS,
                //TIM.HEAT_CASE_DEPTH,
                //TIM.PLATING_FLAG,
                //TIM.PLATING_KIND,
                //TIM.PLATING_SUPPLIER_CD,
                //TIM.PLATING_THICKNESS1_1,
                //TIM.PLATING_THICKNESS1_2,
                //TIM.PLATING_THICKNESS2_1,
                //TIM.PLATING_THICKNESS2_2,
                //TIM.PLATING_KTC,
                //TIM.BAKING_FLAG,
                //TIM.BAKING_TIME,
                //TIM.BAKING_TEMP,
                //TIM.OTHER_TREATMENT1_FLAG,
                //TIM.OTHER_TREATMENT1_KIND,
                //TIM.OTHER_TREATMENT1_CONDITION,
                //TIM.OTHER_TREATMENT2_FLAG,
                //TIM.OTHER_TREATMENT2_KIND,
                //TIM.OTHER_TREATMENT2_CONDITION,
                //TIM.ROUTING_TEXT

                + " FROM TB_ITEM_MS TIM "
                + " LEFT JOIN TB_DEALING_MS DL ON TIM.CUSTOMER_CD = DL.LOC_CD";

            //LEFT JOIN TB_ITEM_PROCESS_MS TIPM ON TIM.ITEM_CD = TIPM.ITEM_CD
            //LEFT JOIN TB_ITEM_MACHINE_MS TIMM ON TIPM.ITEM_CD = TIMM.ITEM_CD";


            if (ItemTypes != null && ItemTypes.Length > 0)
            {
                string strOperator = "IN";
                if (sqlOperator == eSqlOperator.NotIn)
                {
                    strOperator = "NOT IN";
                }

                sql += string.Format(" WHERE TIM.KIND_OF_PRODUCT {0} (", strOperator);

                for (int i = 0; i < ItemTypes.Length; i++)
                {
                    sql += "'" + ItemTypes[i] + "'";

                    if (i < ItemTypes.Length - 1)
                    {
                        sql += ", ";
                    }
                }

                sql += " )";
            }

            sql += " ORDER BY TIM.ITEM_CD";

            DataRequest req = new DataRequest(sql);

            return(db.ExecuteQuery(req));
        }