예제 #1
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;
        }
예제 #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;
        }
예제 #3
0
        public new void SavePartType(PartType item, string strOldPartType)
        {
            try
            {


                _Schema.SQLContext sqlCtx = null;
                lock (MethodBase.GetCurrentMethod())
                {
                    if (!_Schema.Func.PeerTheSQL(MethodBase.GetCurrentMethod().MetadataToken, out sqlCtx))
                    {
                        sqlCtx = new _Schema.SQLContext();
                        sqlCtx.Sentence = @"update PartTypeEx
                                                            set PartType =@PartType,
                                                                PartTypeGroup = @PartTypeGroup,
                                                                Editor = @Editor,
                                                                Udt =@Now
                                                            where PartType=@NameKey";

                        sqlCtx.Params.Add("PartType", new SqlParameter("@PartType", SqlDbType.VarChar));
                        sqlCtx.Params.Add("PartTypeGroup", new SqlParameter("@PartTypeGroup", SqlDbType.VarChar));
                        sqlCtx.Params.Add("Editor", new SqlParameter("@Editor", SqlDbType.VarChar));
                        sqlCtx.Params.Add("Now", new SqlParameter("@Now", SqlDbType.DateTime));
                        sqlCtx.Params.Add("NameKey", new SqlParameter("@NameKey", SqlDbType.VarChar));

                        _Schema.Func.InsertIntoCache(MethodBase.GetCurrentMethod().MetadataToken, sqlCtx);
                    }
                }

                sqlCtx.Params["PartType"].Value = item.PartTypeName;
                sqlCtx.Params["PartTypeGroup"].Value = item.PartTypeGroup;
                sqlCtx.Params["Editor"].Value = item.Editor;
                sqlCtx.Params["Now"].Value = _Schema.SqlHelper.GetDateTime();
                sqlCtx.Params["NameKey"].Value = strOldPartType;

                _Schema.SqlHelper.ExecuteNonQuery(_Schema.SqlHelper.ConnectionString_GetData,
                                                                                CommandType.Text,
                                                                                 sqlCtx.Sentence,
                                                                                sqlCtx.Params.Values.ToArray<SqlParameter>());
              
            }
            catch (Exception)
            {
               
                throw;
            }
            
        }
예제 #4
0
 public new void SavePartTypeDefered(IUnitOfWork uow,PartType item, string strOldPartType)
 {
     AddOneInvokeBody(uow, MethodBase.GetCurrentMethod(), item, strOldPartType);
 }
예제 #5
0
 public void  AddPartTypeDefered(IUnitOfWork uow, PartType item)
 {
     AddOneInvokeBody(uow, MethodBase.GetCurrentMethod(), item);
 }
예제 #6
0
 public new  IList<PartType> GetPartTypeObjList()
 {
     try
     {
         IList<PartType> ret = new List<PartType>();
         
         string SQLStatement = "select PartType, PartTypeGroup, Editor, Cdt, Udt, ID from PartTypeEx ";
         using (SqlDataReader sqlR = _Schema.SqlHelper.ExecuteReader(_Schema.SqlHelper.ConnectionString_GetData,
                                                                                                                      CommandType.Text, SQLStatement))
         {
             while (sqlR != null && sqlR.Read())
             {
                 PartType item = new PartType(GetValue_Int32(sqlR,5),
                                                                 GetValue_Str(sqlR, 0),
                                                                  GetValue_Str(sqlR, 1),
                                                                  GetValue_Str(sqlR, 2),
                                                                  GetValue_DateTime(sqlR, 3),
                                                                  GetValue_DateTime(sqlR, 4));
                 ret.Add(item);
             }
         }
         return ret;
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #7
0
        public void AddPartType(string partTypeName, string partTypeGroup, string editor)
        {
            try
            {
                IList<PartType> tmpPartTypeList = partRepositoryEx.GetPartTypeObjList();
                IList<PartType> checkList = tmpPartTypeList.Where(x => x.PartTypeName == partTypeName && x.PartTypeGroup == partTypeGroup).ToList();
                if (checkList.Count != 0)
                {
                    throw new FisException("PartType:" + partTypeName + " BomNodType:" + partTypeGroup + " is exist");
                }

                PartType partTypeObj = new PartType
                {
                    PartTypeName = partTypeName,
                    PartTypeGroup = partTypeGroup,
                    Editor = editor,
                    Cdt = DateTime.Now,
                    Udt = DateTime.Now
                };
                ////   PartType partTypeObj = convertToObjFromMaintainInfo(Object);
                //   PartType p=new PartType(Object.
                partRepositoryEx.AddPartType(partTypeObj);
            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw;//new SystemException(e.Message);
            }
        }