Exemplo n.º 1
0
        protected override void AfterEditBeforeCommit(EditEventArgs e)
        {
            base.AfterEditBeforeCommit(e);

            PlmChangesUtil plmUtil = new PlmChangesUtil();

            if (plmUtil.IsInChangeRequest(e) && plmUtil.IsParametersChanged(e.View, e.OldNewValues))
            {
                plmUtil.UpdateBEResponseStatus(e, "11");

                e.Values.Add("ParameterChanged", "1");
            }
        }
Exemplo n.º 2
0
        private void Duplicate(EditEventArgs e, out int?newPLMId)
        {
            newPLMId = null;
            if (HasPLMBEStatusChangedToCR(e))
            {
                int?plmIdDuplicatedOutput          = null;
                int?beTechnicalIdToDuplicateOutput = null;
                int?beTechnicalIdDuplicatedOutput  = null;

                using (SqlConnection connection = new SqlConnection(e.View.Database.ConnectionString))
                {
                    connection.Open();

                    SqlTransaction transaction = connection.BeginTransaction();

                    try
                    {
                        using (SqlCommand command = new SqlCommand())
                        {
                            command.Connection  = connection;
                            command.Transaction = transaction;

                            DuplicateShellow(e, command, out plmIdDuplicatedOutput, out beTechnicalIdToDuplicateOutput, out beTechnicalIdDuplicatedOutput);
                            newPLMId = plmIdDuplicatedOutput;
                        }
                        transaction.Commit();
                    }
                    catch (Exception exception)
                    {
                        transaction.Rollback();
                        throw exception;
                    }
                }

                //if (plmIdDuplicatedOutput.HasValue)
                //{
                //    DuplicatePLM(e, plmIdDuplicatedOutput.Value);
                //    DuplicateBETechnical(beTechnicalIdToDuplicateOutput, beTechnicalIdDuplicatedOutput);

                //}
            }
            // do only  if status is change request or por change request!!!!
            PlmChangesUtil plmUtil = new PlmChangesUtil();

            if (plmUtil.IsInChangeRequest(e) && plmUtil.HasParametersChanged(e.View, e.PrevRow, e.Values))
            {
                plmUtil.UpdateBEResponseStatus(e);
            }
        }