예제 #1
0
    private void SetData(StockinQCData data)
    {
        this.txtLOID.Text = data.LOID.ToString();
        this.txtQCCode.Text = data.QCCODE;
        this.txtCreateby.Text = data.CREATEBY;
        this.txtInvNo.Text = data.INVNO;
        this.ctlQCDate.DateValue = data.QCDATE;
        this.txtAnaCode.Text = data.ANACODE;
        if (data.ANADATE.Year == 1) data.ANADATE = DateTime.Now.Date;
        this.ctlAnaDate.DateValue = data.ANADATE;
        SetSender(data.SENDER);
        this.txtDivision.Text = FlowObj.GetDivision(data.CREATEBY);
        this.grvItem.DataSource = FlowObj.GetStockInItem(data.LOID);
        this.grvItem.DataBind();
        data.WAREHOUSE = Authz.CurrentUserInfo.Warehouse;

        if (data.STATUS == Constz.Requisition.Status.Approved.Code)
        {
            this.ctlToolbar.BtnSaveShow = false;
            this.ctlToolbar.BtnSubmitShow = false;
        }
        if (data.WAREHOUSE == 2)
        {
            this.ctlToolbar.ClientClickPrint = ABB.Global.Appz.ReportScript(Constz.Report.ProductQC, Convert.ToDouble(this.txtLOID.Text == "" ? "0" : this.txtLOID.Text)) + " return false;";
        }
        else
        {
            this.ctlToolbar.ClientClickPrint = ABB.Global.Appz.ReportScript(Constz.Report.F_FG_16_R00, Convert.ToDouble(this.txtLOID.Text == "" ? "0" : this.txtLOID.Text)) + " return false;";
        }
    }
예제 #2
0
        //public DataTable GetStockInList(StockInFGData data)
        //{
        //    DataTable dt = SearchDAL.GetReceiveList(data);
        //    for (int i = 0; i < dt.Rows.Count; ++i)
        //    {
        //        dt.Rows[i]["NO"] = i + 1;
        //    }
        //    return dt;
        //}

        public StockinQCData GetData(double loid)
        {
            StockinQCData data = new StockinQCData();
            if (DALObj.GetDataByLOID(loid, null))
            {
                data.LOID = DALObj.LOID;
                data.STATUS = DALObj.STATUS;
                data.CODE = DALObj.CODE;
                data.CREATEBY = DALObj.CREATEBY;
                data.SENDER = DALObj.SENDER;
                data.QCCODE = DALObj.QCCODE;
                data.QCDATE = DALObj.QCDATE;
                data.INVNO = DALObj.INVNO;
                data.REMARK = DALObj.REMARK;
                data.RECEIVEDATE = DALObj.RECEIVEDATE;
                data.STATUS = DALObj.STATUS;
                data.INVNO = DALObj.INVNO;
                data.RECEIVER = DALObj.RECEIVER;
                data.ANACODE = DALObj.ANACODE;
                data.ANADATE = DALObj.ANADATE;
            }
            return data;
        }
예제 #3
0
 private StockinQCData GetPDOrederData()
 {
     StockinQCData data = new StockinQCData();
     data.LOID = Convert.ToDouble(this.txtLOID.Text == "" ? "0" : this.txtLOID.Text);
     data.ANACODE = this.txtNo.Text.Trim();
     data.ANADATE = this.ctlAnaDate.DateValue;
     return data;
 }
예제 #4
0
        public bool UpdateData(string userID, StockinQCData data)
        {
            bool ret = true;
            if (ValidateData(data))
            {
                OracleDBObj obj = new OracleDBObj();
                obj.CreateConnection();
                obj.CreateTransaction();
                try
                {
                    DALObj.OnDB = false;
                    DALObj.GetDataByLOID(data.LOID, obj.zTrans);
                    data.PDORDERLOID= DALObj.PDORDER ;

                    PDOrderDAL PDDAL = new PDOrderDAL();
                    PDDAL.GetDataByLOID(data.PDORDERLOID, null);

                    PDDAL.ANACODE = data.ANACODE;
                    PDDAL.ANADATE = data.ANADATE;

                    if (PDDAL.OnDB)
                        ret = PDDAL.UpdateCurrentData(userID, obj.zTrans);
                    else
                        ret = PDDAL.InsertCurrentData(userID, obj.zTrans);

                    _LOID = PDOrderDALObj.LOID;
                    if (!ret)
                    {
                        throw new ApplicationException(PDOrderDALObj.ErrorMessage);
                    }

                    obj.zTrans.Commit();
                    obj.CloseConnection();
                }
                catch (Exception ex)
                {
                    obj.zTrans.Rollback();
                    obj.CloseConnection();
                    ret = false;
                    _error = ex.Message;
                }
            }
            else
                ret = false;
            return ret;
        }
예제 #5
0
        public bool ValidateData(StockinQCData data)
        {
            bool ret = true;
            if (data.ANACODE == "")
            {
                ret = false;
                _error = "¡ÃسÒÃкØàÅ¢·ÕèÇÔà¤ÃÒÐËì ";
            }
            else if (data.ANADATE.Year == 1)
            {
                ret = false;
                _error = "¡ÃسÒÃкØÇѹ·ÕèÇÔà¤ÃÒÐËì ";
            }

            return ret;
        }
예제 #6
0
        public StockinQCData DoGetPDOrderData(double pdorder)
        {
            string sql = "SELECT PO.CREATEBY,PO.CODE FROM PDORDER PO WHERE PO.LOID = '" + pdorder + "' ";

            DataTable dt = OracleDB.ExecListCmd(sql);
            StockinQCData data = new StockinQCData();
            if (dt.Rows.Count > 0)
            {
                data.INVNO = dt.Rows[0]["CODE"].ToString();
                data.CREATEBY = dt.Rows[0]["CREATEBY"].ToString();
            }

            return data;
        }