Example #1
0
    protected void CV_ServerValidate(object source, ServerValidateEventArgs args)
    {
        CustomValidator cv = (CustomValidator)source;

        switch (cv.ID)
        {
        case "cvBinCode":
            string binCode = args.Value.Trim();
            if (TheStorageBinMgr.LoadStorageBin(binCode) != null)
            {
                ShowErrorMessage("MasterData.Location.Bin.IsExist", binCode);
                args.IsValid = false;
            }
            break;

        case "cvAreaCode":
            string areaCode = args.Value.Trim();
            if (TheStorageAreaMgr.LoadStorageArea(areaCode) == null)
            {
                ShowErrorMessage("MasterData.Location.Area.IsNotExist", areaCode);
                args.IsValid = false;
            }
            break;

        default:
            break;
        }
    }
Example #2
0
    protected void btnPickup_Click(object sender, EventArgs e)
    {
        try
        {
            //  ExecuteSubmit();
            DetachedCriteria criter = DetachedCriteria.For(typeof(LocationLotDetail));
            criter.Add(Expression.Eq("Location", TheLocationMgr.LoadLocation(tbMiscOrderLocation.Text)));
            criter.Add(Expression.In("StorageBin", TheStorageBinMgr.GetStorageBin(tbStorageBin.Text).ToList()));
            criter.Add(Expression.IsNotNull("StorageBin"));
            IList <LocationLotDetail> result = TheCriteriaMgr.FindAll <LocationLotDetail>(criter);
            foreach (LocationLotDetail lot in result)
            {
                lot.StorageBin    = null;
                lot.Hu.StorageBin = null;
                TheLocationLotDetailMgr.UpdateLocationLotDetail(lot);
            }

            ShowSuccessMessage("Warehouse.PickUp.Successfully");
            GridView1.DataSource = null;
            GridView1.DataBind();
            this.InitialAll();
        }
        catch (BusinessErrorException ex)
        {
            this.ShowErrorMessage(ex);
        }
    }
Example #3
0
    protected void LoadItem(object sender, EventArgs e)
    {
        DetachedCriteria criter = DetachedCriteria.For(typeof(LocationLotDetail));

        criter.Add(Expression.Eq("Location", TheLocationMgr.LoadLocation(tbMiscOrderLocation.Text)));
        criter.Add(Expression.In("StorageBin", TheStorageBinMgr.GetStorageBin(tbStorageBin.Text).ToList()));
        criter.Add(Expression.IsNotNull("StorageBin"));
        IList <LocationLotDetail> result = TheCriteriaMgr.FindAll <LocationLotDetail>(criter);



        GridView1.DataSource = result;
        GridView1.DataBind();
    }
Example #4
0
    protected void GV_Bin_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        string binCode = ((Literal)this.GV_Bin.Rows[e.RowIndex].FindControl("ltlCode")).Text.Trim();

        try
        {
            TheStorageBinMgr.DeleteStorageBin(binCode);
            this.DoSearch();
            ShowSuccessMessage("MasterData.Location.DeleteBin.Successfully", binCode);
        }
        catch (Castle.Facilities.NHibernateIntegration.DataException ex)
        {
            ShowErrorMessage("MasterData.Location.DeleteBin.Fail", binCode);
        }
    }
Example #5
0
    protected void GV_Bin_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        StorageBin storageBin = new StorageBin();

        if (this.AreaCode != null && this.AreaCode != string.Empty)
        {
            storageBin.Area = TheStorageAreaMgr.LoadStorageArea(this.AreaCode);
        }
        storageBin.Code        = ((Literal)this.GV_Bin.Rows[e.RowIndex].FindControl("ltlCode")).Text.Trim();
        storageBin.Description = ((TextBox)this.GV_Bin.Rows[e.RowIndex].FindControl("tbDescription")).Text.Trim();
        storageBin.IsActive    = ((CheckBox)this.GV_Bin.Rows[e.RowIndex].FindControl("cbActive")).Checked;
        storageBin.IsIsolation = ((CheckBox)this.GV_Bin.Rows[e.RowIndex].FindControl("cbIsIsolation")).Checked;
        TheStorageBinMgr.UpdateStorageBin(storageBin);
        this.GV_Bin.EditIndex = -1;

        this.DoSearch();
        ShowSuccessMessage("MasterData.Location.UpdataBin.Successfully", storageBin.Code);
    }
Example #6
0
    public void InitPageParameter(CycleCount cycleCount)
    {
        this.Location = cycleCount.Location.Code;

        this.StorageBinList = new List <StorageBin>();

        if (cycleCount.Bins != null && cycleCount.Bins != string.Empty)
        {
            string[] binArr = cycleCount.Bins.Split('|');
            foreach (string bin in binArr)
            {
                StorageBin storageBin = TheStorageBinMgr.LoadStorageBin(bin);
                storageBin.IsBlank = false;
                this.StorageBinList.Add(storageBin);
            }
        }
        this.GV_List.Columns[3].Visible = cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE;
        BindData(cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE);
    }
Example #7
0
    private void DoSearch()
    {
        IList <StorageBin> storageBinList = new List <StorageBin>();

        if (this.AreaCode == null || this.AreaCode == string.Empty)
        {
            storageBinList = TheStorageBinMgr.GetStorageBin(TheLocationMgr.LoadLocation(this.tbLocationCode.Text));
        }
        else
        {
            storageBinList = TheStorageBinMgr.GetStorageBin(this.tbAreaCode.Text);
        }

        this.GV_Bin.DataSource = storageBinList;
        this.GV_Bin.DataBind();
        if (storageBinList.Count == 0)
        {
            this.ltlMessage.Visible = true;
        }
        else
        {
            this.ltlMessage.Visible = false;
        }
    }