public void GetBindingQcReturn(string returnNo)
        {
            QCReturnHdr qcReturnHdr = null;

            try
            {
                using (QCReturnBLL qcReturnBll = new QCReturnBLL())
                {
                    qcReturnHdr = qcReturnBll.GetQCReturn(returnNo);
                }

                if (qcReturnHdr != null)
                {
                    this.txtRT_NO.Text           = qcReturnHdr.RT_NO;
                    this.txtRT_DATE.EditValue    = qcReturnHdr.RT_DATE;
                    this.txtPOST_REF.EditValue   = qcReturnHdr.POST_REF;
                    this.lueWarehouse.EditValue  = qcReturnHdr.WH_ID;
                    this.lueReturnType.EditValue = qcReturnHdr.RT_TYPE;
                    this.txtREMARK.Text          = qcReturnHdr.REMARK;
                    this.icbREC_STAT.EditValue   = qcReturnHdr.REC_STAT;

                    this.GetQCReturnDetail(qcReturnHdr.RT_NO);
                }
                else
                {
                    this.ClearDataOnScreen();
                    XtraMessageBox.Show(this, "No Data found.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
        public void GetQCReturnList(string whID, DateTime?fromDate, DateTime?toDate)
        {
            List <QCReturnHdr> lstQcReturn = null;

            try
            {
                base.ExecutionStart();
                base.BeginProcessing("Begin Load data...", "Please Waiting for Loading Data");

                using (QCReturnBLL qcReturnBll = new QCReturnBLL())
                {
                    lstQcReturn = qcReturnBll.GetQCReturnList(whID, fromDate, toDate);
                }

                this.chkSelect.ClearSelection();

                this.grdQCReturn.DataSource = lstQcReturn;
                this.dntQCReturn.DataSource = lstQcReturn;
                base.ExecutionStop();
            }
            catch (Exception ex)
            {
                base.FinishedProcessing();
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
            finally
            {
                base.FinishedProcessing();
                ((frmMainMenu)this.ParentForm).ExecuteTime.Caption = base.ExecuteTime;
            }
        }
        public void AdvanceSearchQCReturn(string returnNo, string whID, DateTime?fromDate, DateTime?toDate)
        {
            List <QCReturnHdr> lstQcReturn = null;

            try
            {
                base.ExecutionStart();
                base.BeginProcessing("Begin Load data...", "Please Waiting for Loading Data");

                using (QCReturnBLL qcReturnBll = new QCReturnBLL())
                {
                    lstQcReturn = qcReturnBll.AdvQCReturn(whID, returnNo, fromDate, toDate);
                }

                this.chkSelect.ClearSelection();

                this.grdQCReturn.DataSource = lstQcReturn;
                this.dntQCReturn.DataSource = lstQcReturn;

                base.ExecutionStop();
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
Beispiel #4
0
        private void Get_ProductCard_List()
        {
            List <ProductCard> lstPrdCard = null;

            try
            {
                base.BeginProcessing("Begin Load data...", "Please Waiting for Loading Data");

                using (QCReturnBLL qcReturnBll = new QCReturnBLL())
                {
                    lstPrdCard = qcReturnBll.GetSelectProductCard(this.SEQ_NO);
                }

                this.grdProductCard.DataSource = lstPrdCard;
                this.dntProductCard.DataSource = lstPrdCard;

                //default check all
                this.cardSelect.SelectAll();
            }
            catch (Exception ex)
            {
                base.FinishedProcessing();
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
            finally
            {
                base.FinishedProcessing();
            }
        }
        private void InitializaLOVData()
        {
            try
            {
                using (QCReturnBLL qcReturnBll = new QCReturnBLL())
                {
                    List <ReturnType> lstReturnType = qcReturnBll.GetReturnTypeList();

                    List <Warehouse> lstWH = qcReturnBll.GetWarehouse();

                    if (lstReturnType != null)
                    {
                        this.lueReturnType.Properties.DataSource      = lstReturnType;
                        this.grvQCReturn_rps_lueReturnType.DataSource = lstReturnType;
                    }

                    if (lstWH != null)
                    {
                        this.lueWarehouse.Properties.DataSource = lstWH;
                        this.lueSearchWH.Properties.DataSource  = lstWH;
                        this.grvQCReturn_rps_lueWH.DataSource   = lstWH;
                    }
                }

                string defaultWH = HTN.BITS.UIL.PLASESS.Properties.Settings.Default.Default_WH;
                if (!string.IsNullOrEmpty(defaultWH))
                {
                    this.lueSearchWH.EditValue = defaultWH;
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
        private void ReturnWHPostData(List <QCReturnHdr> lstQcReturn)
        {
            try
            {
                ICollection <string> files;
                string selectPath = string.Empty;
                string resultMsg  = string.Empty;

                DialogResult result = this.fdbSelectFilePath.ShowDialog(this);
                if (result == DialogResult.OK)
                {
                    selectPath = this.fdbSelectFilePath.SelectedPath;
                    try
                    {
                        using (QCReturnBLL qcReturnBll = new QCReturnBLL())
                        {
                            resultMsg = qcReturnBll.GetPostData(lstQcReturn, selectPath, ((frmMainMenu)this.ParentForm).UserID, out files);
                        }

                        if (files.Count > 0)
                        {
                            //copy to server
                            UiUtility.CopyFilesToServer(files);

                            this.OpenPath(files);

                            //refresh data
                            if (this.xtcQCReturnWH.SelectedTabPage == this.xtpQCReturnList)
                            {
                                this.btnApply.PerformClick();
                            }
                            else
                            {
                                this.GetBindingQcReturn(this.txtRT_NO.Text);
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                    }
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
 private void InitializaLOVData()
 {
     try
     {
         using (QCReturnBLL qcReturnBll = new QCReturnBLL())
         {
             List <Warehouse> lstWH = qcReturnBll.GetWarehouse();
             if (lstWH != null)
             {
                 this.lueWarehouse.Properties.DataSource = lstWH;
             }
         }
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
     }
 }
Beispiel #8
0
        private void PrintProductCard_LABEL(string qcReturnNo, string prodSEQNo, List <ProductCard> lstPrdCard)
        {
            int printSeq = 0;

            try
            {
                base.BeginProcessing("Begin Load Report...", "Please Waiting for Loading Report");

                DataSet ds;

                using (QCReturnBLL qcReturnBll = new QCReturnBLL())
                {
                    ds = qcReturnBll.PrintProductCardReport(qcReturnNo, prodSEQNo, lstPrdCard, this.USER_ID, out printSeq);
                }

                ReportViewer viewer = new ReportViewer();
                viewer.AutoCloseAfterPrint = true;


                RPT_PRODUCT_CARD_8545 rpt = new RPT_PRODUCT_CARD_8545();

                rpt.DataSource = ds;
                rpt.Parameters["paramUserPrint"].Value       = this.USER_ID;
                rpt.Parameters["paramPRODUCTION_TYPE"].Value = this.PRODUCTION_TYPE;
                rpt.CreateDocument();

                viewer.SetReport(rpt);
                viewer.LogPrintTime(printSeq);

                base.FinishedProcessing();

                viewer.ShowDialog();
            }
            catch (Exception ex)
            {
                base.FinishedProcessing();

                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
            finally
            {
                base.FinishedProcessing();
            }
        }
        public void GetQCReturnDetail(string returnNo)
        {
            try
            {
                using (QCReturnBLL qcReturnBll = new QCReturnBLL())
                {
                    this.dtbQCReturnDtl = qcReturnBll.GetQCReturnDetail(returnNo);
                }

                if (this.dtbQCReturnDtl != null)
                {
                    this.grdQCReturnDetail.DataSource = this.dtbQCReturnDtl;
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
Beispiel #10
0
    public string UpdateReturnProductCard(string qcReturnNo, string serialNo, string userid, out int totalBox)
    {
        totalBox = -1;
        string result = string.Empty;

        try
        {
            using (QCReturnBLL qcREturnBll = new QCReturnBLL())
            {
                result = qcREturnBll.UpdateReturnProductCard(qcReturnNo, serialNo, userid, out totalBox);
            }
        }
        catch (Exception ex)
        {
            result = ex.Message;
        }

        return(result);
    }
Beispiel #11
0
    public ProductCard GetReturnProductCardInfo(string qcReturnNo, string serialNo, string userid, out string resultMsg) //, out string resultMsg
    {
        resultMsg = string.Empty;
        ProductCard pdCard = null;

        try
        {
            using (QCReturnBLL qcREturnBll = new QCReturnBLL())
            {
                pdCard = qcREturnBll.GetProductCardInfo(qcReturnNo, serialNo, userid, out resultMsg);
            }
        }
        catch (Exception ex)
        {
            pdCard = null;
            throw ex;
        }
        return(pdCard);
    }
Beispiel #12
0
    public QCReturn GetQCReturnOrderInfo(string qcReturnNo, string userid, out string resultMsg) //,
    {
        resultMsg = string.Empty;
        QCReturn qcReturn = null;

        try
        {
            using (QCReturnBLL qcREturnBll = new QCReturnBLL())
            {
                qcReturn = qcREturnBll.GetQcReturnInfo(qcReturnNo, userid, out resultMsg);
            }
        }
        catch (Exception ex)
        {
            qcReturn = null;
            throw ex;
        }
        return(qcReturn);
    }
        private void PrintQCReturnOrderDetail(List <QCReturnHdr> lstQcReturn)
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                //UiUtility.BeginProcessing("Loading Report", this);

                DataSet ds;

                using (QCReturnBLL qcReturnBll = new QCReturnBLL())
                {
                    ds = qcReturnBll.PrintQCReturnOrderDtlReport(lstQcReturn);
                }

                ReportViewer viewer = new ReportViewer {
                    AutoCloseAfterPrint = true
                };

                RPT_FG_RETURN_WH rpt = new RPT_FG_RETURN_WH {
                    DataSource = ds
                };
                rpt.Parameters["paramUserPrint"].Value = ((frmMainMenu)this.ParentForm).UserID;
                rpt.CreateDocument();
                viewer.SetReport(rpt);
                viewer.ShowDialog();
            }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.Default;
                UiUtility.EndProcessing();

                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
        private void PrintQCReturnOrder(List <QCReturnHdr> lstQcReturn)
        {
            try
            {
                base.BeginProcessing("Begin Load Report...", "Please Waiting for Loading Report");

                DataSet ds;

                using (QCReturnBLL qcReturnBll = new QCReturnBLL())
                {
                    ds = qcReturnBll.PrintQCReturnReport(lstQcReturn);
                }

                ReportViewer viewer = new ReportViewer();
                viewer.AutoCloseAfterPrint = true;

                RPT_FG_QC_RETURN rpt = new RPT_FG_QC_RETURN();

                rpt.DataSource = ds;
                rpt.Parameters["paramUserPrint"].Value = ((frmMainMenu)this.ParentForm).UserID;
                rpt.CreateDocument();
                viewer.SetReport(rpt);
                base.FinishedProcessing();
                viewer.ShowDialog();
            }
            catch (Exception ex)
            {
                base.FinishedProcessing();

                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
            finally
            {
                base.FinishedProcessing();
            }
        }
        public void UpdateQCReturn()
        {
            string      result   = string.Empty;
            QCReturnHdr qcReturn = new QCReturnHdr();

            try
            {
                #region "QC Return Header"

                qcReturn.RT_NO    = this.txtRT_NO.Text;
                qcReturn.RT_DATE  = this.txtRT_DATE.DateTime;
                qcReturn.WH_ID    = this.lueWarehouse.EditValue.ToString();
                qcReturn.RT_TYPE  = this.lueReturnType.EditValue.ToString();
                qcReturn.REMARK   = this.txtREMARK.Text;
                qcReturn.REC_STAT = (bool)this.icbREC_STAT.EditValue;

                #endregion

                using (QCReturnBLL qcReturnBll = new QCReturnBLL())
                {
                    result = qcReturnBll.UpdateQCReturn(qcReturn, ((frmMainMenu)this.ParentForm).UserID);
                }

                if (result.Equals("OK"))
                {
                    NotifierResult.Show("Update Complete", "Result", 50, 1000, 50, NotifyType.Safe);
                }
                else
                {
                    NotifierResult.Show(result, "Error", 100, 1000, 0, NotifyType.Warning);
                }
            }
            catch (Exception ex)
            {
                this.Cursor = Cursors.Default;
                NotifierResult.Show(ex.Message, "Error", 100, 1000, 0, NotifyType.Warning);
            }
            finally
            {
                this.FormState = eFormState.ReadOnly;
                //Get all Invoice on Invoice List
                this.GetQCReturnList(this.lueWarehouse.EditValue.ToString(), null, null);

                if (result.Equals("OK"))
                {
                    GridView viewList = (GridView)this.grdQCReturn.Views[0];
                    viewList.ClearSorting();

                    int position = UiUtility.GetRowHandleByColumnValue(viewList, "RT_NO", qcReturn.RT_NO);
                    if (position != 0)
                    {
                        if (position != GridControl.InvalidRowHandle)
                        {
                            this.dntQCReturn.Position = position;
                        }
                    }
                    else
                    {
                        viewList.FocusedRowHandle = 0;
                    }
                }

                this.Cursor = Cursors.Default;
            }
        }