Exemplo n.º 1
0
        private void OnDeleteGroup()
        {
            try
            {
                if (shtView.Rows.Count == 0)
                {
                    return;
                }
                if (shtView.ActiveRowIndex < 0)
                {
                    return;
                }

                // show confirm message
                MessageDialogResult dr = MessageDialog.ShowConfirmation(this, new EVOFramework.Message(Messages.eConfirm.CFM9002.ToString()), MessageDialogButtons.YesNo);
                if (dr != MessageDialogResult.Yes)
                {
                    return;
                }

                //NZString TransID = new NZString(null, shtView.Cells[shtView.ActiveRowIndex, (int)eColView.ISSUE_NO].Value);
                //NZString RefNo = new NZString(null, shtView.Cells[shtView.ActiveRowIndex, (int)eColView.REF_NO].Value);
                NZString TransferNo = new NZString(null, shtView.Cells[shtView.ActiveRowIndex, (int)eColView.SLIP_NO].Value);


                IssueByOrderController ctl = new IssueByOrderController();
                ctl.DeleteGroupTransaction(TransferNo);



                //ไล่ลบจากล่างขึ้นบน เพราะว่าไม่งั้นindex จะเลื่อนแล้วจะลบไม่ครบ
                for (int iRowIndex = shtView.RowCount - 1; iRowIndex >= 0; iRowIndex--)
                {
                    if (TransferNo.NVL("").Equals(shtView.GetValue(iRowIndex, (int)eColView.SLIP_NO)))
                    {
                        shtView.Rows.Remove(iRowIndex, 1);
                    }
                }



                //LoadData();
            }
            catch (BusinessException err)
            {
                MessageDialog.ShowBusiness(this, err.Error.Message);
                err.Error.FocusOnControl();
            }
            catch (ValidateException err)
            {
                MessageDialog.ShowBusiness(this, err.ErrorResults[0].Message);
                err.ErrorResults[0].FocusOnControl();
            }
            catch (Exception err)
            {
                MessageDialog.ShowBusiness(this, err.Message);
            }
        }
Exemplo n.º 2
0
        private void OnDeleteGroup()
        {
            try
            {
                NZString groupTransId = new NZString(null, shtView.GetValue(shtView.ActiveRowIndex, (int)eColView.GROUP_TRANS_ID));

                MessageDialogResult dr = MessageDialog.ShowConfirmation(this, new Message(Messages.eConfirm.CFM9002.ToString()), MessageDialogButtons.YesNo);
                if (dr == MessageDialogResult.No)
                {
                    return;
                }

                m_controller.DeleteGroupTransaction(groupTransId);

                //ไล่ลบจากล่างขึ้นบน เพราะว่าไม่งั้นindex จะเลื่อนแล้วจะลบไม่ครบ
                for (int iRowIndex = shtView.RowCount - 1; iRowIndex >= 0; iRowIndex--)
                {
                    if (groupTransId.NVL("").Equals(shtView.GetValue(iRowIndex, (int)eColView.GROUP_TRANS_ID)))
                    {
                        shtView.Rows.Remove(iRowIndex, 1);
                    }
                }


                //LoadData(dtPeriodBegin.NZValue, dtPeriodEnd.NZValue);

                MessageDialog.ShowInformation(this, null, new Message(Messages.eInformation.INF9003.ToString()).MessageDescription);
            }

            catch (BusinessException err)
            {
                MessageDialog.ShowBusiness(this, err.Error.Message);
                err.Error.FocusOnControl();
            }
            catch (ValidateException err)
            {
                MessageDialog.ShowBusiness(this, err.ErrorResults[0].Message);
                err.ErrorResults[0].FocusOnControl();
            }
            catch (Exception err)
            {
                MessageDialog.ShowBusiness(this, err.Message);
            }
        }
Exemplo n.º 3
0
        private void OnDeleteGroup()
        {
            try
            {
                NZString            SlipNo  = new NZString(null, shtReturnProductList.GetValue(shtReturnProductList.ActiveRowIndex, (int)eColView.SLIP_NO));
                NZString            TransID = new NZString(null, shtReturnProductList.GetValue(shtReturnProductList.ActiveRowIndex, (int)eColView.RETURN_TRANS_ID));
                MessageDialogResult dr      = MessageDialog.ShowConfirmation(this, new Message(TKPMessages.eConfirm.CFM0010.ToString()), MessageDialogButtons.YesNo);
                if (dr == MessageDialogResult.No)
                {
                    return;
                }

                ctrl_Shipment.DeleteGroupTransaction(TransID);

                //ไล่ลบจากล่างขึ้นบน เพราะว่าไม่งั้นindex จะเลื่อนแล้วจะลบไม่ครบ
                for (int iRowIndex = shtReturnProductList.RowCount - 1; iRowIndex >= 0; iRowIndex--)
                {
                    if (SlipNo.NVL("").Equals(shtReturnProductList.GetValue(iRowIndex, (int)eColView.SLIP_NO)))
                    {
                        shtReturnProductList.Rows.Remove(iRowIndex, 1);
                    }
                }

                LoadData(dtPeriodBegin.NZValue, dtPeriodEnd.NZValue);

                MessageDialog.ShowInformation(this, null, new Message(Messages.eInformation.INF9003.ToString()).MessageDescription);
            }
            catch (BusinessException err)
            {
                MessageDialog.ShowBusiness(this, err.Error.Message);
                err.Error.FocusOnControl();
            }
            catch (ValidateException err)
            {
                MessageDialog.ShowBusiness(this, err.ErrorResults[0].Message);
                err.ErrorResults[0].FocusOnControl();
            }
            catch (Exception err)
            {
                MessageDialog.ShowBusiness(this, err.Message);
            }
        }
Exemplo n.º 4
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));
        }
Exemplo n.º 5
0
        public void AddScreenFavorite(NZString username, NZString screenCD)
        {
            MenuBIZ biz = new MenuBIZ();

            biz.AddScreenFavorite(username.NVL(String.Empty), screenCD.NVL(String.Empty));
        }
Exemplo n.º 6
0
        public List <string> LoadScreenFavorite(NZString username)
        {
            MenuBIZ biz = new MenuBIZ();

            return(biz.LoadScreenFavorite(username.NVL(String.Empty)));
        }