예제 #1
0
        //取得Part
        //SELECT PartType, Descr FROM IMES_GetData..Part
        //    WHERE PartNo = ? 
        //        AND Flag <> '0'
        public PartMaintainInfo GetPartByPartNo(string partNo)
        {
            IPart part = partRepository.GetPartByPartNo(partNo);
            if (part == null)
            {
                return null;
            }
            else
            {
                PartMaintainInfo partMaintainInfo = new PartMaintainInfo();
                partMaintainInfo.PartNo = part.PN;
                partMaintainInfo.Descr = part.Descr;
                partMaintainInfo.PartType = part.Type;
                partMaintainInfo.CustPartNo = part.CustPn;
                partMaintainInfo.AutoDL = part.AutoDL;
                partMaintainInfo.Remark = part.Remark;
                partMaintainInfo.Editor = part.Editor;
                partMaintainInfo.Cdt = part.Cdt;
                partMaintainInfo.Udt = part.Udt;
                return partMaintainInfo;
            }

        }
예제 #2
0
파일: Part.aspx.cs 프로젝트: wra222/testgit
    protected void btnDelete_ServerClick(object sender, EventArgs e)
    {
        PartMaintainInfo item = new PartMaintainInfo();
        string oldPartType = this.drpMaintainPartType.InnerDropDownList.SelectedValue;
        string oldPartNo = this.hidPartNo.Value.ToString();
        try
        {
            iPart.deletePart(oldPartNo);
        }
        catch (FisException ex)
        {
            showErrorMessage(ex.mErrmsg);
            return;
        }
        catch (Exception ex)
        {
            showErrorMessage(ex.Message);
            return;
        }
        showListPartByPartType(oldPartType);
        this.updatePanel2.Update();
        this.updatePanel3.Update();
        ScriptManager.RegisterStartupScript(this.updatePanelAll, typeof(System.Object), "saveUpdate", "DeleteComplete();", true);

    }
예제 #3
0
    protected void btnDelete_ServerClick(object sender, EventArgs e)
    {
        PartMaintainInfo item = new PartMaintainInfo();
    //    string oldPartType = this.drpMaintainPartType.InnerDropDownList.SelectedValue;
        string oldPartType = "";
        string oldPartNo = this.hidPartNo.Value.ToString();
        try
        {
            //iPart.deletePart(oldPartNo);

            IBOMNodeData iModelBOM = (IBOMNodeData)ServiceAgent.getInstance().GetMaintainObjectByName<IBOMNodeData>(WebConstant.IBOMNodeData);
            IList<string> lstModel = iModelBOM.GetPartsFromModelBOM(oldPartNo, 100);
            if (lstModel != null && lstModel.Count > 0)
            {
                showErrorMessage(this.GetLocalResourceObject(Pre + "_ErrExistModelBOM").ToString());
                return;
            }

            IList<string> lst = iPartEx.GetProductsFromProduct_Part(oldPartNo, 100);
            if (lst != null && lst.Count > 0)
            {
                showErrorMessage(this.GetLocalResourceObject(Pre + "_ErrExistProduct_Part").ToString());
                return;
            }

            iPartEx.DeletePart(oldPartNo, this.HiddenUserName.Value);

        }
        catch (FisException ex)
        {
            showErrorMessage(ex.mErrmsg);
            return;
        }
        catch (Exception ex)
        {
            showErrorMessage(ex.Message);
            return;
        }
        showListPartByPartType(oldPartType);
    //    CallCluentFunc("RemoveGvRow", "RemoveGvRow()");
        FindPart(hidOldPN.Value.Trim());
        this.updatePanel2.Update();
        this.updatePanel3.Update();
        ScriptManager.RegisterStartupScript(this.updatePanelAll, typeof(System.Object), "saveUpdate", "DeleteComplete();", true);
        
    }