Example #1
0
        public IList<PartTypeMaintainInfo> GetPartTypeList()
        {
            IList<PartTypeMaintainInfo> partTypeList = new List<PartTypeMaintainInfo>();
            try
            {
                IList<PartType> tmpPartTypeList = partRepository.GetPartTypeObjList();

                foreach (PartType temp in tmpPartTypeList)
                {
                    PartTypeMaintainInfo partType = new PartTypeMaintainInfo();

                    partType = convertToMaintainInfoFromObj(temp);

                    partTypeList.Add(partType);
                }

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

            return partTypeList;
        }
Example #2
0
        private PartTypeMaintainInfo convertToMaintainInfoFromObj(PartType temp)
        {
            PartTypeMaintainInfo part = new PartTypeMaintainInfo();

            part.PartType = temp.PartTypeName;
            part.PartTypeGroup = temp.PartTypeGroup;
            part.Editor = temp.Editor;
            part.Cdt = temp.Cdt;
            part.Udt = temp.Udt;

            return part;
        }
Example #3
0
        private PartType convertToObjFromMaintainInfo(PartTypeMaintainInfo temp)
        {
            PartType part = new PartType
            {
                PartTypeName = temp.PartType,
                PartTypeGroup = temp.PartTypeGroup,
                Editor = temp.Editor,
                Cdt = temp.Cdt,
                Udt = temp.Udt
            };

            return part;
        }
Example #4
0
        public void SavePartType(PartTypeMaintainInfo Object, string strOldPartType)
        {
            try
            {
                PartType partTypeObj = convertToObjFromMaintainInfo(Object);

                IUnitOfWork work = new UnitOfWork();

                partRepository.SavePartTypeDefered(work, partTypeObj, strOldPartType);

                work.Commit();
            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw;
            }
        }
Example #5
0
 public void SavePartType(PartTypeMaintainInfo Object)
 {
     try
     {
         IList<PartType> tmpPartTypeList = partRepositoryEx.GetPartTypeObjList();
         IList<PartType> checkList = tmpPartTypeList.Where(x => x.PartTypeName == Object.PartType && x.PartTypeGroup == Object.PartTypeGroup).ToList();
         if (checkList.Count != 0)
         {
             throw new FisException("PartType:" + Object.PartType + " BomNodType:" + Object.PartTypeGroup + " is exist");
         }
         PartType partTypeObj = convertToObjFromMaintainInfo(Object);
         partRepositoryEx.SavePartType(partTypeObj);
     }
     catch (FisException e)
     {
         logger.Error(e.mErrmsg);
         throw e;
     }
     catch (Exception e)
     {
         logger.Error(e.Message);
         throw;
     }
 }
Example #6
0
        public void SavePartType(PartTypeMaintainInfo Object, string strOldPartType)
        {
            try
            {
                PartType partTypeObj = convertToObjFromMaintainInfo(Object);
                partRepositoryEx.SavePartType(partTypeObj, strOldPartType);

            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw;
            }
        }
Example #7
0
    protected void btnSavePartType_Click(Object sender, EventArgs e)
    {
        string strPartType = txtPartType.Text;
        string strPartTypeGroup = txtGroup.Text;
        string strOldPartType = hidOldPartType.Value;
        string ID = hidPartTypeID.Value;
        try
        {
            PartTypeMaintainInfo partType = new PartTypeMaintainInfo();
            partType.ID = int.Parse(ID);
            partType.PartType = strPartType;
            partType.PartTypeGroup = strPartTypeGroup;
            partType.Editor = HiddenUserName.Value;

            iPartTypeManagerEx.SavePartType(partType);

        }
        catch (FisException ex)
        {
            showErrorMessage_PartType(ex.mErrmsg, strOldPartType);
            return;
        }
        catch (Exception ex)
        {
            showErrorMessage_PartType(ex.Message, strOldPartType);
            return;
        }

        bindPartTypeTable();
        ScriptManager.RegisterStartupScript(this.updatePanel1, typeof(System.Object), "AddSave1Complete", "AddSave1Complete(\"" + strPartType + "\");", true);
    }