Ejemplo n.º 1
0
        public int Insert(AdditionalProcessing additionalprocess_)
        {
            try
            {
                var processtoinsert = new AdditionalProcessing
                {
                    PartSetUpID   = additionalprocess_.PartSetUpID,
                    Notes         = additionalprocess_.Notes,
                    SequenceID    = additionalprocess_.SequenceID,
                    IsActive      = additionalprocess_.IsActive,
                    Description   = additionalprocess_.Description,
                    DescriptionES = additionalprocess_.DescriptionES,
                    DescriptionCN = additionalprocess_.DescriptionCN,
                    LastEditDate  = additionalprocess_.LastEditDate,
                    LastEditedBy  = additionalprocess_.LastEditedBy
                };

                _qualityEntities.AddToAdditionalProcessings(processtoinsert);


                _qualityEntities.SaveChanges(SaveOptions.None);
                //  _qualityEntities.Detach(additionalprocess_);
                return(processtoinsert.ProcessingID);
            }
            catch (Exception ex)
            {
                string errormessage = ex.ToString();
                return(0);
                //TODO:Log the error
            }
        }
Ejemplo n.º 2
0
        public void InsertClonedAdditionalProcess(Int16 partsetupid_, string descEnglish_, string descSpanish_, string notes_, string sequenceid_, string lastupdatedby_, DateTime lastupdateddate_)


        {
            try
            {
                AdditionalProcessing processtoinsert = new AdditionalProcessing
                {
                    PartSetUpID = partsetupid_,
                    Notes       = notes_,
                    SequenceID  = sequenceid_,
                    IsActive    = true,

                    Description   = descEnglish_,
                    DescriptionES = descSpanish_,
                    LastEditDate  = lastupdateddate_,
                    LastEditedBy  = lastupdatedby_
                };

                _qualityEntities.AddToAdditionalProcessings(processtoinsert);


                _qualityEntities.SaveChanges(SaveOptions.None);
                _qualityEntities.Detach(processtoinsert);
            }
            catch (Exception ex)
            {
                string errormessage = ex.ToString();

                //TODO:Log the error
            }
        }
Ejemplo n.º 3
0
        public void UpdateAdditionalProcessingSequenceOrder(AdditionalProcessing additionalprocess_)
        {
            var additionalprocesstoupdate = _qualityEntities.AdditionalProcessings
                                            .FirstOrDefault(x => x.ProcessingID == additionalprocess_.ProcessingID);

            additionalprocesstoupdate.SequenceID   = additionalprocess_.SequenceID;
            additionalprocesstoupdate.LastEditedBy = additionalprocess_.LastEditedBy;
            additionalprocesstoupdate.LastEditDate = DateTime.Now;
            _qualityEntities.SaveChanges(SaveOptions.None);
        }
Ejemplo n.º 4
0
        public void Update(AdditionalProcessing additionalprocess_)
        {
            var processtoupdate = _qualityEntities.AdditionalProcessings
                                  .FirstOrDefault(x => x.ProcessingID == additionalprocess_.ProcessingID);

            //  processtoupdate.PartSetUpID = additionalprocess_.PartSetUpID;
            processtoupdate.Notes         = additionalprocess_.Notes;
            processtoupdate.SequenceID    = additionalprocess_.SequenceID;
            processtoupdate.IsActive      = additionalprocess_.IsActive;
            processtoupdate.Description   = additionalprocess_.Description;
            processtoupdate.DescriptionES = additionalprocess_.DescriptionES;
            processtoupdate.DescriptionCN = additionalprocess_.DescriptionCN;
            processtoupdate.LastEditedBy  = additionalprocess_.LastEditedBy;
            processtoupdate.LastEditDate  = additionalprocess_.LastEditDate;
            _qualityEntities.SaveChanges(SaveOptions.None);
        }