コード例 #1
0
 public static ResponseModel AddAssignMaterialToRoutingFile(AssignMaterialToRoutingFileModel m, ref int _newID)
 {
     ACTION = "AddAssignMaterialToRoutingFile(AssignMaterialToRoutingFileModel)";
     try
     {
         _newID = 0;
         ResponseModel res = AssignMaterialToRoutingFileDAL.AddAssignMaterialToRoutingFile(m, ref _newID);
         return(new ResponseModel()
         {
             Action = ACTION,
             Source = SOURCE,
             Message = res.Message,
             Status = res.Status
         });
     }
     catch (Exception ex)
     {
         return(new ResponseModel()
         {
             Action = ACTION,
             Source = SOURCE,
             Message = ex.Message,
             Status = false
         });
     }
 }
コード例 #2
0
        internal static USR_TMMA_ASSIGN_MATERIAL_TO_ROUTING_FILE Mapping(AssignMaterialToRoutingFileModel o)
        {
            try
            {
                if (o != null)
                {
                    return(new USR_TMMA_ASSIGN_MATERIAL_TO_ROUTING_FILE()
                    {
                        AssignMaterialToRoutingFileID = o.AssignMaterialToRoutingFileID,
                        RecObjectName = o.RecObjectName,
                        UserSAP = o.UserSAP,
                        AssignMaterialToRoutingFilePath = o.AssignMaterialToRoutingFilePath,
                        AssignMaterialToRoutingFileVersion = o.AssignMaterialToRoutingFileVersion,
                        AssignMaterialToRoutingFileStatus = o.AssignMaterialToRoutingFileStatus,
                        ProductsTypeID = o.ProductsTypeID,
                        IsActive = o.IsActive ? 1 : 0,
                        CreatedBy = o.CreatedBy,
                        CreatedDate = o.CreatedDate,
                        UpdatedBy = o.UpdatedBy,
                        UpdatedDate = o.UpdatedDate
                    });
                }

                return(null);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #3
0
        public static AssignMaterialToRoutingFileModel GetAssignMaterialToRoutingFile(int assignMaterialToRoutingFileID)
        {
            ACTION = "GetAssignMaterialToRoutingFile(assignMaterialToRoutingFileID)";

            try
            {
                using (UTMMABCDBEntities context = new UTMMABCDBEntities())
                {
                    USR_TMMA_ASSIGN_MATERIAL_TO_ROUTING_FILE obj = context.USR_TMMA_ASSIGN_MATERIAL_TO_ROUTING_FILE.Where(o => o.AssignMaterialToRoutingFileID == assignMaterialToRoutingFileID).FirstOrDefault();
                    AssignMaterialToRoutingFileModel         m   = Mapping(obj);
                    return(m);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #4
0
        public static AssignMaterialToRoutingFileModel GetAssignMaterialToRoutingFileLastVersion(int ProductsTypeID)
        {
            ACTION = "GetAssignMaterialToRoutingFileLastVersion()";
            try
            {
                using (UTMMABCDBEntities context = new UTMMABCDBEntities())
                {
                    var list = context.USR_TMMA_ASSIGN_MATERIAL_TO_ROUTING_FILE.Where(a => a.ProductsTypeID == ProductsTypeID).ToList();
                    var o    = list.Last();
                    AssignMaterialToRoutingFileModel m = Mapping(o);

                    return(m);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #5
0
        public static ResponseModel AddAssignMaterialToRoutingFile(AssignMaterialToRoutingFileModel m, ref int _newID)
        {
            string action = "AddAssignMaterialToRoutingFile(AssignMaterialToRoutingFileModel, out _newID)";

            _newID = 0;
            try
            {
                if (m != null)
                {
                    using (UTMMABCDBEntities context = new UTMMABCDBEntities())
                    {
                        USR_TMMA_ASSIGN_MATERIAL_TO_ROUTING_FILE _obj = Mapping(m);

                        context.USR_TMMA_ASSIGN_MATERIAL_TO_ROUTING_FILE.Add(_obj);

                        if (context.SaveChanges() > 0)
                        {
                            _newID = _obj.AssignMaterialToRoutingFileID;

                            return(new ResponseModel()
                            {
                                Source = SOURCE,
                                Action = action,
                                Status = true,
                                Message = "Success"
                            });
                        }

                        return(new ResponseModel()
                        {
                            Source = SOURCE,
                            Action = action,
                            Status = false,
                            Message = "Fail"
                        });
                    }
                }

                return(new ResponseModel()
                {
                    Source = SOURCE,
                    Action = action,
                    Status = false,
                    Message = "Null"
                });
            }
            catch (DbEntityValidationException ex)
            {
                return(new ResponseModel()
                {
                    Source = SOURCE,
                    Action = action,
                    Status = false,
                    Message = ex.Message,
                    StackTrace = ex.StackTrace
                });
            }
            catch (Exception ex)
            {
                return(new ResponseModel()
                {
                    Source = SOURCE,
                    Action = action,
                    Status = false,
                    Message = ex.Message,
                    StackTrace = ex.StackTrace
                });
            }
        }
コード例 #6
0
ファイル: Core.cs プロジェクト: champ6803/TMMAConversion
 public ResponseModel AddAssignMaterialToRoutingFile(AssignMaterialToRoutingFileModel m, ref int _newID)
 {
     return(AssignMaterialToRoutingFileBLL.AddAssignMaterialToRoutingFile(m, ref _newID));
 }