Exemple #1
0
        public IList<PartTypeAttributeMaintainInfo> GetPartTypeAttributeList(string PartType)
        {
            IList<PartTypeAttributeMaintainInfo> partTypeAttrList = new List<PartTypeAttributeMaintainInfo>();
            try
            {
                IList<PartTypeAttribute> tmpPartTypeAttrList = partRepository.GetPartTypeAttributes(PartType);

                foreach (PartTypeAttribute temp in tmpPartTypeAttrList)
                {
                    PartTypeAttributeMaintainInfo partTypeAttr = new PartTypeAttributeMaintainInfo();

                    partTypeAttr = convertToMaintainInfoFromObj(temp);

                    partTypeAttrList.Add(partTypeAttr);
                }

            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw;
            }

            return partTypeAttrList;
        }
Exemple #2
0
        private PartTypeAttributeMaintainInfo convertToMaintainInfoFromObj(PartTypeAttribute temp)
        {
            PartTypeAttributeMaintainInfo part = new PartTypeAttributeMaintainInfo();

            part.PartType = temp.PartType;
            part.Code = temp.Code;
            part.Description = temp.Description;
            part.Editor = temp.Editor;
            part.Cdt = temp.Cdt;
            part.Udt = temp.Udt;

            return part;
        }
Exemple #3
0
        public void AddPartTypeAttribute(PartTypeAttributeMaintainInfo Object)
        {
            try
            {
                PartTypeAttribute partTypeAttributeObj = convertToObjFromMaintainInfo(Object);

                IUnitOfWork work = new UnitOfWork();

                partRepository.AddPartTypeAttributeDefered(work, partTypeAttributeObj);

                work.Commit();
            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw;//new SystemException(e.Message);
            }
        }
Exemple #4
0
        public void SavePartTypeAttribute(string strOldCode, PartTypeAttributeMaintainInfo Object)
        {
            try
            {
                PartTypeAttribute partTypeAttributeObj = convertToObjFromMaintainInfo(Object);

                IUnitOfWork work = new UnitOfWork();

                partRepository.SavePartTypeAttributeDefered(work, partTypeAttributeObj, Object.PartType, strOldCode);

                work.Commit();
            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw;
            }
        }
Exemple #5
0
    protected void btnSaveAttribute_Click(Object sender, EventArgs e)
    {
        string strCode = txtCode.Text;
        string strDesc = txtDesc.Text;
        string strOldPartType = hidOldPartType.Value;
        string strOldCode = hidCode.Value;


        try
        {
            PartTypeAttributeMaintainInfo attribute = new PartTypeAttributeMaintainInfo();

            attribute.Code = strCode;
            attribute.Description = strDesc;
            // attribute.Editor = editor;
            attribute.Editor = HiddenUserName.Value;


            attribute.PartType = strOldPartType;


            iPartTypeManager.SavePartTypeAttribute(strOldCode, attribute);

        }
        catch (FisException ex)
        {
            showErrorMessage_Attribute(ex.mErrmsg, strOldCode);
            return;
        }
        catch (Exception ex)
        {
            showErrorMessage_Attribute(ex.Message, strOldCode);
            return;
        }

        bindAttributeTable();
        ScriptManager.RegisterStartupScript(this.updatePanel3, typeof(System.Object), "AddSave3Complete", "AddSave3Complete(\"" + strCode + "\");", true);
    }