Beispiel #1
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        try
        {
            CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(this.OrderNo);
            if (cycleCount.Type == BusinessConstants.CODE_MASTER_PHYCNT_TYPE_WHOLECHECK)
            {
                TheCycleCountMgr.ReleaseCycleCount(this.OrderNo, this.CurrentUser);
            }
            else
            {
                if (cycleCount.IsScanHu)
                {
                    cycleCount.Bins = this.ucStorageBinList.GetBins();
                }
                cycleCount.Items = this.ucItemList.GetItems();
                TheCycleCountMgr.ReleaseCycleCount(cycleCount, this.CurrentUser);
            }
            if (TabEvent != null)
            {
                TabEvent(new object[] { true, this.OrderNo }, e);
            }

            ShowSuccessMessage("Common.Business.Result.Submit.Successfully");
            this.InitPageParameter(this.OrderNo);
        }
        catch (BusinessErrorException ex)
        {
            ShowErrorMessage(ex);
        }
    }
Beispiel #2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(this.OrderNo);

            if (cycleCount.IsScanHu)
            {
                cycleCount.Bins = this.ucStorageBinList.GetBins();
            }
            cycleCount.Items = this.ucItemList.GetItems();
            TheCycleCountMgr.UpdateCycleCount(cycleCount);
            this.Refresh();

            if (TabEvent != null)
            {
                TabEvent(new object[] { false, "" }, e);
            }

            ShowSuccessMessage("Common.Business.Result.Update.Successfully");
        }
        catch (BusinessErrorException ex)
        {
            ShowErrorMessage("Common.Business.Result.Update.Failed.Reason", ex.Message);
        }
    }
Beispiel #3
0
    protected void btnAdjust_Click(object sender, EventArgs e)
    {
        try
        {
            CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(Code);

            IList <int> cycleCountResultIdList = new List <int>();
            for (int i = 0; i < this.GV_List.Rows.Count; i++)
            {
                GridViewRow row           = this.GV_List.Rows[i];
                CheckBox    checkBoxGroup = row.FindControl("CheckBoxGroup") as CheckBox;
                if (checkBoxGroup.Checked)
                {
                    if (cycleCount.IsScanHu)
                    {
                        Label lblStorageBin = (Label)row.FindControl("lblStorageBin");
                        Label lblItemCode   = (Label)row.FindControl("lblItemCode");

                        IList <string> binList  = new List <string>();
                        IList <string> itemList = new List <string>();
                        if (lblStorageBin.Text.Trim() != string.Empty)
                        {
                            binList.Add(lblStorageBin.Text.Trim());
                        }

                        if (lblItemCode.Text.Trim() != string.Empty)
                        {
                            itemList.Add(lblItemCode.Text.Trim());
                        }

                        IList <CycleCountResult> cycleCountResultList = TheCycleCountMgr.ListCycleCountResultDetail(this.Code, true, true, false, binList, itemList, binList.Count == 0);

                        foreach (CycleCountResult cycleCountResult in cycleCountResultList)
                        {
                            cycleCountResultIdList.Add(cycleCountResult.Id);
                        }
                    }
                    else
                    {
                        HiddenField hfId = (HiddenField)row.FindControl("hfId");
                        cycleCountResultIdList.Add(Int32.Parse(hfId.Value));
                    }
                }
            }
            if (cycleCountResultIdList.Count == 0)
            {
                ShowErrorMessage("Common.Message.Record.Not.Select");
                return;
            }
            TheCycleCountMgr.ProcessCycleCountResult(cycleCountResultIdList, this.CurrentUser);
            UpdateView();
            DoSearch();
            ShowSuccessMessage("Common.Business.Result.Adjust.Successfully");
        }
        catch (BusinessErrorException ex)
        {
            this.ShowErrorMessage(ex);
        }
    }
Beispiel #4
0
 protected void btnImport_Click(object sender, EventArgs e)
 {
     try
     {
         CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(this.OrderNo);
         IList <CycleCountDetail> cycleCountDetailList = TheImportMgr.ReadCycleCountFromXls(fileUpload.PostedFile.InputStream, this.CurrentUser, cycleCount);
         this.TheCycleCountMgr.RecordCycleCountDetail(this.OrderNo, cycleCountDetailList, this.CurrentUser);
         ShowSuccessMessage("Import.Result.Successfully");
     }
     catch (BusinessErrorException ex)
     {
         this.ShowErrorMessage(ex);
     }
 }
Beispiel #5
0
    protected void btnPrint_Click(object sender, EventArgs e)
    {
        CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(this.OrderNo);

        IList <object>     cycleCountList  = new List <object>();
        IList <CycleCount> cycleCountListT = new List <CycleCount>();

        cycleCountListT.Add(cycleCount);
        cycleCountList.Add(cycleCountListT);
        cycleCountList.Add(CurrentUser.Code);
        string printUrl = TheReportMgr.WriteToFile("Stocktaking.xls", cycleCountList, "Stocktaking.xls");

        Page.ClientScript.RegisterStartupScript(GetType(), "method", " <script language='javascript' type='text/javascript'>PrintOrder('" + printUrl + "'); </script>");
    }
Beispiel #6
0
    public override void UpdateView()
    {
        CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(Code);

        this.Status = cycleCount.Status;
        if (cycleCount.IsScanHu)
        {
            tbBinCode.ServiceParameter = "string:" + cycleCount.Location.Code;
            tbBinCode.DataBind();
            tbBinCode.Visible                = true;
            lblBinCode.Visible               = true;
            btnExportDetail.Visible          = true;
            this.GV_List.Columns[6].Visible  = true;
            this.GV_List.Columns[7].Visible  = true;
            this.GV_List.Columns[8].Visible  = true;
            this.GV_List.Columns[9].Visible  = false;
            this.GV_List.Columns[10].Visible = false;
            this.GV_List.Columns[11].Visible = false;
        }
        else
        {
            this.GV_List.Columns[2].Visible  = false;
            this.GV_List.Columns[6].Visible  = false;
            this.GV_List.Columns[7].Visible  = false;
            this.GV_List.Columns[8].Visible  = false;
            this.GV_List.Columns[9].Visible  = true;
            this.GV_List.Columns[10].Visible = true;
            this.GV_List.Columns[11].Visible = true;
            tbBinCode.Visible       = false;
            lblBinCode.Visible      = false;
            btnExportDetail.Visible = false;
        }

        this.GV_List.Columns[0].Visible = cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_COMPLETE;

        if (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_COMPLETE)
        {
            this.btnAdjust.Visible = true;
            this.btnClose.Visible  = true;
            //this.GV_List.Columns[0].Visible = true;
        }
        else
        {
            this.btnAdjust.Visible = false;
            this.btnClose.Visible  = false;
            // this.GV_List.Columns[0].Visible = false;
        }

        this.isExport = false;
    }
 public void InitPageParameter(string code, bool isEditMode)
 {
     try
     {
         InitialResolver(this.CurrentUser.Code, BusinessConstants.TRANSFORMER_MODULE_TYPE_STOCKTAKING);
         CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(code);
         this.CacheResolver.Code   = code;
         this.CacheResolver.Status = cycleCount.Status;
         IList <CycleCountDetail> cycleCountDetailList = TheCycleCountDetailMgr.GetCycleCountDetail(code);
         CacheResolver.Transformers = this.ConvertCycleCountToTransformer(cycleCountDetailList);
         this.EditMode = isEditMode;
         this.Refresh();
     }
     catch (BusinessErrorException ex)
     {
         ShowErrorMessage(ex);
     }
 }
Beispiel #8
0
    public void ListEdit_Render(object sender, EventArgs e)
    {
        this.ucSearch.Visible   = false;
        this.ucList.Visible     = false;
        this.ucBusiness.Visible = true;
        string     code       = (string)sender;
        CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(code);

        if (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CANCEL ||
            cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE)
        {
            TabEvent(new object[] { false, "" }, e);
        }
        else
        {
            TabEvent(new object[] { true, code }, e);
        }
        this.ucBusiness.InitPageParameter((string)sender);
    }
Beispiel #9
0
    public void UpdateView()
    {
        CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(code);

        this.ucInfo.InitPageParameter(cycleCount);

        this.btnRecalc.Visible = (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_SUBMIT);
        this.btnAdjust.Visible = (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_SUBMIT);

        //if (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_SUBMIT)
        //{
        //    IList<CycleCountResult> cycleCountResultList = TheCycleCountMgr.ReCalcCycleCount(this.code, this.CurrentUser);
        //    this.BindData(cycleCountResultList);
        //}
        //else
        //{
        this.BindData();
        //}
    }
Beispiel #10
0
    public void InitPageParameter(string code)
    {
        this.OrderNo = code;
        CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(code);

        this.ucEdit.InitPageParameter(cycleCount);

        InitialUI();


        //全盘 不显示 库格明细和物料明细
        if (cycleCount.Type == BusinessConstants.CODE_MASTER_PHYCNT_TYPE_WHOLECHECK)
        {
            this.ucStorageBinList.Visible = false;
            this.ucItemList.Visible       = false;
            this.btnSave.Visible          = false;
        }
        else //抽盘
        {
            // 不选择 是否扫描条码 就没有库格明细
            if (!cycleCount.IsScanHu)
            {
                this.ucStorageBinList.Visible = false;
            }
            else
            {
                this.ucStorageBinList.InitPageParameter(cycleCount);
                this.ucStorageBinList.Visible = true;
            }

            this.ucItemList.InitPageParameter(cycleCount);
            ucItemList.Visible = true;
        }

        if (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS)
        {
            //this.ucCycleCountResultList.InitPageParameter(cycleCount);
        }
    }
Beispiel #11
0
    private void InitialUI()
    {
        CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(this.OrderNo);

        if (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE)
        {
            this.btnSave.Visible     = true;
            this.btnDelete.Visible   = true;
            this.btnSubmit.Visible   = true;
            this.btnCancel.Visible   = false;
            this.btnComplete.Visible = false;
            this.btnPrint.Visible    = false;
            this.btnImport.Visible   = false;
            this.fileUpload.Visible  = false;
            this.hlTemplate.Visible  = false;
        }
        else if (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_SUBMIT)
        {
            this.btnSave.Visible     = false;
            this.btnDelete.Visible   = false;
            this.btnSubmit.Visible   = false;
            this.btnCancel.Visible   = true;
            this.btnComplete.Visible = true;
            this.btnPrint.Visible    = true;
            this.btnImport.Visible   = false;
            this.fileUpload.Visible  = false;
            this.hlTemplate.Visible  = false;
        }
        else if (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS)
        {
            this.btnSave.Visible     = false;
            this.btnDelete.Visible   = false;
            this.btnSubmit.Visible   = false;
            this.btnCancel.Visible   = true;
            this.btnComplete.Visible = true;
            this.btnPrint.Visible    = true;
            this.btnImport.Visible   = true;
            this.fileUpload.Visible  = true;
            this.hlTemplate.Visible  = true;
        }
        else if (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_COMPLETE)
        {
            this.btnSave.Visible     = false;
            this.btnDelete.Visible   = false;
            this.btnSubmit.Visible   = false;
            this.btnCancel.Visible   = false;
            this.btnComplete.Visible = false;
            this.btnPrint.Visible    = false;
            this.btnImport.Visible   = false;
            this.fileUpload.Visible  = false;
            this.hlTemplate.Visible  = false;
        }
        else if (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CLOSE)
        {
            this.btnSave.Visible     = false;
            this.btnDelete.Visible   = false;
            this.btnSubmit.Visible   = false;
            this.btnCancel.Visible   = false;
            this.btnComplete.Visible = false;
            this.btnPrint.Visible    = false;
            this.btnImport.Visible   = false;
            this.fileUpload.Visible  = false;
            this.hlTemplate.Visible  = false;
        }
        else if (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CANCEL)
        {
            this.btnSave.Visible     = false;
            this.btnDelete.Visible   = false;
            this.btnSubmit.Visible   = false;
            this.btnCancel.Visible   = false;
            this.btnComplete.Visible = false;
            this.btnPrint.Visible    = false;
            this.btnImport.Visible   = false;
            this.fileUpload.Visible  = false;
            this.hlTemplate.Visible  = false;
        }
    }
Beispiel #12
0
    public void InitPageParameter(string code)
    {
        CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(code);

        InitPageParameter(cycleCount);
    }