Ejemplo n.º 1
0
        protected override object GetEditObject()
        {
            if (_InventoryFacade == null)
            {
                _InventoryFacade = new InventoryFacade(base.DataProvider);
            }

            SpecInOut  specInOut  = this._InventoryFacade.CreateNewSpecinout();
            ItemFacade itemFacade = new ItemFacade(this.DataProvider);
            string     dQMCode    = FormatHelper.CleanString(this.txtMaterialNO.Text);

            Domain.MOModel.Material material = (Domain.MOModel.Material)itemFacade.GetMaterialByDQMCode(dQMCode);
            if (material == null)
            {
                specInOut.MCode = FormatHelper.CleanString(this.txtMaterialNO.Text, 40);
            }
            else
            {
                specInOut.MCode = material.MCode;
            }
            specInOut.InOutDesc = txtSpecialDescEdit.Text;

            specInOut.DQMCode      = FormatHelper.CleanString(this.txtMaterialNO.Text, 40);
            specInOut.Muom         = FormatHelper.CleanString(this.txtUnitEdit.Text, 40);
            specInOut.MoveType     = "O";
            specInOut.StorageCode  = FormatHelper.CleanString(this.drpStorageOutEdit.SelectedValue, 40);
            specInOut.LocationCode = FormatHelper.CleanString(this.drpLoationOutEdit.SelectedValue, 40);
            specInOut.Qty          = Convert.ToInt32(FormatHelper.CleanString(this.txtQTY.Text, 40));
            specInOut.MaintainUser = this.GetUserCode();
            specInOut.InOutDesc    = txtSpecialDescEdit.Text;
            return(specInOut);
        }
Ejemplo n.º 2
0
        //物料编码回车
        //protected void btnMaterialNOEnter_Click(object sender, EventArgs e)
        //{
        //    ItemFacade itemFacade = new ItemFacade(this.DataProvider);
        //    string dQMCode = FormatHelper.CleanString(this.txtMaterialNO.Text);
        //    this.txtSpecialDescEdit.Text = "";
        //    this.txtMaterialENDesc.Text = "";
        //    this.txtMaterialCHDesc.Text = "";
        //    this.txtUnitEdit.Text = "";
        //    if (string.IsNullOrEmpty(dQMCode))
        //    {
        //        WebInfoPublish.Publish(this, "物料编码为空", this.languageComponent1);
        //        this.txtMaterialNO.Focus();
        //        return;
        //    }
        //    Domain.MOModel.Material material = (Domain.MOModel.Material)itemFacade.GetMaterialByDQMCode(dQMCode);
        //    if (material == null)
        //    {
        //        WebInfoPublish.Publish(this, "物料主数据没有该物料编码: " + dQMCode, this.languageComponent1);
        //        this.txtMaterialNO.Focus();
        //        return;
        //    }
        //    this.txtSpecialDescEdit.Text = material.MspecialDesc;
        //    this.txtMaterialENDesc.Text = material.MenshortDesc;
        //    this.txtMaterialCHDesc.Text = material.MchshortDesc;
        //    this.txtUnitEdit.Text = material.Muom;

        //}

        protected void cmdOK_ServerClick(object sender, System.EventArgs e)
        {
            ItemFacade itemFacade = new ItemFacade(this.DataProvider);
            string     dQMCode    = FormatHelper.CleanString(this.txtMaterialNO.Text);

            this.txtSpecialDescEdit.Text = "";
            this.txtMaterialENDesc.Text  = "";
            this.txtMaterialCHDesc.Text  = "";
            this.txtUnitEdit.Text        = "";
            if (string.IsNullOrEmpty(dQMCode))
            {
                WebInfoPublish.Publish(this, "物料编码为空", this.languageComponent1);
                this.txtMaterialNO.Focus();
                return;
            }
            if (string.IsNullOrEmpty(drpStorageOutEdit.SelectedValue))
            {
                WebInfoPublish.Publish(this, "库位编码不能为空!", this.languageComponent1);
                return;
            }
            if (string.IsNullOrEmpty(drpLoationOutEdit.SelectedValue))
            {
                WebInfoPublish.Publish(this, "货位编码不能为空!", this.languageComponent1);
                return;
            }
            _InventoryFacade = new InventoryFacade(base.DataProvider);
            SpecInOut inOut = _InventoryFacade.QuerySpecInOuts(dQMCode, drpStorageOutEdit.SelectedValue, drpLoationOutEdit.SelectedValue);

            Domain.MOModel.Material material = (Domain.MOModel.Material)_InventoryFacade.GetMaterialByDQMCode(dQMCode);
            if (material == null)
            {
                WebInfoPublish.Publish(this, "物料主数据没有该物料编码! " + dQMCode, this.languageComponent1);
                this.txtMaterialNO.Focus();
                return;
            }
            if (inOut == null)
            {
                WebInfoPublish.Publish(this, "没有对应的入库记录!", this.languageComponent1);
                this.txtMaterialNO.Focus();
            }
            this.txtSpecialDescEdit.Text = inOut.InOutDesc;
            this.txtMaterialENDesc.Text  = material.MenshortDesc;
            this.txtMaterialCHDesc.Text  = material.MchshortDesc;
            this.txtUnitEdit.Text        = material.Muom;
        }