Пример #1
0
        public IList<PartTypeDescMaintainInfo> GetPartTypeDescList(string PartType)
        {
            IList<PartTypeDescMaintainInfo> partTypeDescList = new List<PartTypeDescMaintainInfo>();
            try
            {
                IList<PartTypeDescription> tmpPartTypeDescList = partRepository.GetPartTypeDescriptionList(PartType);

                foreach (PartTypeDescription temp in tmpPartTypeDescList)
                {
                    PartTypeDescMaintainInfo partTypeDesc = new PartTypeDescMaintainInfo();

                    partTypeDesc = convertToMaintainInfoFromObj(temp);

                    partTypeDescList.Add(partTypeDesc);
                }

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

            return partTypeDescList;
        }
Пример #2
0
        private PartTypeDescMaintainInfo convertToMaintainInfoFromObj(PartTypeDescription temp)
        {
            PartTypeDescMaintainInfo part = new PartTypeDescMaintainInfo();

            part.ID = temp.ID;
            part.PartType = temp.PartType;
            part.Description = temp.Description;

            return part;
        }
Пример #3
0
        private PartTypeDescription convertToObjFromMaintainInfo(PartTypeDescMaintainInfo temp)
        {
            PartTypeDescription part = new PartTypeDescription(temp.ID, temp.PartType, temp.Description);

            return part;
        }
Пример #4
0
        public void DeletePartTypeDescription(string strId)
        {
            try
            {
                PartTypeDescMaintainInfo tmpMaintainInfo = new PartTypeDescMaintainInfo();
                tmpMaintainInfo.ID = Int32.Parse(strId);

                PartTypeDescription objPartTypeDescription = convertToObjFromMaintainInfo(tmpMaintainInfo);

                IUnitOfWork work = new UnitOfWork();

                partRepository.DeletePartTypeDescDefered(work, objPartTypeDescription);

                work.Commit();
            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw;
            }
        }
Пример #5
0
        public void SavePartTypeDescription(PartTypeDescMaintainInfo Object)
        {
            FisException ex;
            List<string> paraError = new List<string>();
            try
            {
                IList<int> lstId = new List<int>();
                int count;
                count = partRepository.CheckExistedDesc(Object.PartType, Object.Description, Object.ID.ToString());
                //检查PartTypeDescription的内容是否已和该PartType的其他某个Description相同。若是,则提示异常。
                if (count > 0)
                {
                    ex = new FisException("DMT022", paraError);
                    throw ex;
                }
                else//==1,保存
                {
                    PartTypeDescription objPartTypeDescription = convertToObjFromMaintainInfo(Object);

                    IUnitOfWork work = new UnitOfWork();

                    partRepository.SavePartTypeDescDefered(work, objPartTypeDescription);

                    work.Commit();
                }

            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw;
            }
        }
Пример #6
0
    protected void btnSaveDesc_Click(Object sender, EventArgs e)
    {
        string strDesc = txtDescDesc.Text;
        string strOldPartType = hidOldPartType.Value;
        string strID = hidDescDescID.Value;

        try
        {
            PartTypeDescMaintainInfo desc = new PartTypeDescMaintainInfo();

            desc.Description = strDesc;
            desc.PartType = strOldPartType;
            desc.ID = Int32.Parse(strID);

            iPartTypeManager.SavePartTypeDescription(desc);

        }
        catch (FisException ex)
        {
            showErrorMessage_Desc(ex.mErrmsg, strID);
            return;
        }
        catch (Exception ex)
        {
            showErrorMessage_Desc(ex.Message, strID);
            return;
        }

        bindDescTable();
        ScriptManager.RegisterStartupScript(this.updatePanel4, typeof(System.Object), "AddSave4Complete", "AddSave4Complete(\"" + strID + "\");", true);
    }