protected void iv_btn請購明細_Click(object sender, EventArgs e)
        {
            iv_lbx請購單號.Items.Clear();
            iv_lbx要訂購的請購單號.Items.Clear();
            iv_lblTitle請購單號.Text = "";
            string l_str請購所別 = get請購所別(sender);
            string l_str對象廠商 = get對象廠商(sender);

            CKGPartOrderFactory l_factory = _context.CFactoryManager.CKGPartOrderFactory;

            CKGPartOrder[] l_codes = l_factory.get所別未定購的請購明細(l_str對象廠商, l_str請購所別);

            add請購單號到ListBox(l_codes);
        }
Esempio n. 2
0
        private void 自動發信()
        {
            get請購清單();

            if (_CKGPartOrder == null)
            {
                return;
            }
            if (_CKGPartOrder.Length <= 0)
            {
                return;
            }
            for (int i = 0; i < _CKGPartOrder.Length; i++)
            {
                string l_str請購所別 = dataGridView1.Rows[i].Cells["請購所別"].Value.ToString();
                string l_str對象廠商 = dataGridView1.Rows[i].Cells["對象廠商"].Value.ToString();

                CKGPartOrderFactory l_factory = _context.CFactoryManager.CKGPartOrderFactory;
                CKGPartOrder[]      l_codes   = l_factory.get所別未定購的請購明細(l_str對象廠商, l_str請購所別);

                ArrayList l_al = new ArrayList();
                for (int j = 0; j < l_codes.Length; j++)
                {
                    //CUser l_user = _context.CFactoryManager.CUserFactory.get高都員工檔(l_codes[j].f_SalesSmid業代員編);
                    //l_codes[j].f_SalesName業代姓名 = l_user.f_username姓名;
                    //string l_str顯示字串 = l_codes[i].f_ExchangeID請購單號 + " " + l_codes[i].f_Branchid請購單位 + " " + l_codes[i].f_SalesName業代姓名;
                    //iv_lbx請購單號.Items.Add(new ListItem(l_str顯示字串, l_codes[i].f_ExchangeID請購單號));

                    l_al.Add(l_codes[j].f_ExchangeID請購單號);
                }

                CKGPartOrder[] l_code選擇 = new CKGPartOrder[l_al.Count];

                for (int k = 0; k < l_code選擇.Length; k++)
                {
                    //try
                    //{
                    l_code選擇[k] = l_factory.getKGPartOrderBy請購單號((string)l_al[k]);

                    確認訂購並發送Email(l_code選擇[k]);

                    _txtLog.Text += l_code選擇[k].f_ExchangeID請購單號 + "發送完成!" + DateTime.Now + "\r\n";
                    //}
                    //catch { _txtLog.Text += l_code選擇[k].f_ExchangeID請購單號 + "發送失敗!" + DateTime.Now + "\r\n"; }
                }
            }
        }