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 lbtnEdit_Click(object sender, EventArgs e)
    {
        string      code        = ((LinkButton)sender).CommandArgument;
        StorageArea storageArea = TheStorageAreaMgr.LoadStorageArea(code);

        this.ucEdit.InitPageParameter(storageArea);
        this.ucEdit.Visible      = true;
        this.divAreaList.Visible = false;
        this.EditEvent((object)code, e);
    }
Example #3
0
    protected void lbtnDelete_Click(object sender, EventArgs e)
    {
        string code = ((LinkButton)sender).CommandArgument;

        try
        {
            TheStorageAreaMgr.DeleteStorageArea(code);
            ShowSuccessMessage("MasterData.Location.DeleteArea.Successfully", code);
            DoSearch();
        }
        catch (Castle.Facilities.NHibernateIntegration.DataException ex)
        {
            ShowErrorMessage("MasterData.Location.DeleteArea.Fail", code);
        }
    }
Example #4
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 #5
0
    //新增库格
    protected void ODS_StorageBin_Inserting(object source, ObjectDataSourceMethodEventArgs e)
    {
        StorageBin storageBin     = (StorageBin)e.InputParameters[0];
        string     binCode        = ((TextBox)(this.FV_StorageBin.FindControl("tbBinCode"))).Text.Trim();
        string     binDescription = ((TextBox)(this.FV_StorageBin.FindControl("tbBinDescription"))).Text.Trim();
        string     areaCode       = ((Controls_TextBox)(this.FV_StorageBin.FindControl("tbAreaCode"))).Text;

        if (binCode == null || binCode == string.Empty)
        {
            ShowErrorMessage("MasterData.Location.Bin.Required.Code");
            e.Cancel = true;
            return;
        }
        storageBin.Code        = binCode;
        storageBin.Description = binDescription;
        storageBin.Area        = TheStorageAreaMgr.LoadStorageArea(areaCode);
        ShowSuccessMessage("MasterData.Location.Bin.AddBin.Successfully", binCode);
    }
Example #6
0
    private void DoSearch()
    {
        IList <StorageArea> storageAreaList = TheStorageAreaMgr.GetStorageArea(this.LocationCode, this.tbAreaCode.Text.Trim());

        this.GV_List.DataSource = storageAreaList;
        this.GV_List.DataBind();
        //if (storageAreaList.Count > 0)
        //{
        //    this.fldsgv.Visible = true;
        //}
        //else
        //{
        //    this.fldsgv.Visible = false;
        //}
        this.fldsgv.Visible = true;
        if (storageAreaList == null || storageAreaList.Count == 0)
        {
            this.ltlMessage.Visible = true;
        }
        else
        {
            this.ltlMessage.Visible = false;
        }
    }