Example #1
0
 private void Submit(bool isUnload = false)
 {
     try
     {
         if (SelectedRow.IsNotNullOrEmpty())
         {
             ActiveEntity.MACHINE_TYPE = SelectedRow.DESCRIPTION;
         }
         //Progress.ProcessingText = PDMsg.ProgressUpdateText;
         //Progress.Start();
         isSaved = bll.Update <DDFORGING_MAC>(new List <DDFORGING_MAC>()
         {
             ActiveEntity
         });
         //Progress.End();
         ShowInformationMessage(PDMsg.SavedSuccessfully);
         //MessageBox.Show("Records saved successfully", "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
         if (!isUnload)
         {
             CloseAction();
         }
     }
     catch (Exception ex)
     {
         throw ex.LogException();
     }
 }
Example #2
0
        private void SelectDataRow()
        {
            if (SelectedRow.IsNotNullOrEmpty())
            {
                DataTable dt = bll.GetEntitiesByCode(ActiveEntity).ToDataTable <PartNumberConfig>().Clone();
                dt.ImportRow(SelectedRow.Row);

                List <PartNumberConfig> lstEntity = (from row in dt.AsEnumerable()
                                                     select new PartNumberConfig()
                {
                    ID = row.Field <string>("ID").ToIntValue(),
                    Code = row.Field <string>("Code"),
                    Description = row.Field <string>("Description"),
                    Location_code = row.Field <string>("location_code"),
                    Prefix = row.Field <string>("Prefix"),
                    BeginningNo = row.Field <string>("BeginningNo"),
                    EndingNo = row.Field <string>("EndingNo"),
                    IsObsolete = row.Field <string>("IsObsolete").ToBooleanAsString(),
                    DELETE_FLAG = row.Field <string>("DELETE_FLAG").ToBooleanAsString(),
                    ENTERED_BY = row.Field <string>("ENTERED_BY"),
                    ENTERED_DATE = row.Field <string>("ENTERED_DATE").ToDateTimeValue(),
                    UPDATED_BY = row.Field <string>("UPDATED_BY"),
                    UPDATED_DATE = row.Field <string>("UPDATED_DATE").ToDateTimeValue()
                }).ToList <PartNumberConfig>();
                if (lstEntity.IsNotNullOrEmpty() && lstEntity.Count > 0)
                {
                    ActiveEntity = lstEntity[0].DeepCopy <PartNumberConfig>();

                    MandatoryFields.Code          = ActiveEntity.Code;
                    MandatoryFields.Description   = ActiveEntity.Description;
                    MandatoryFields.Location_code = ActiveEntity.Location_code;
                    MandatoryFields.Prefix        = ActiveEntity.Prefix;
                    MandatoryFields.BeginningNo   = ActiveEntity.BeginningNo.ToValueAsString();
                    MandatoryFields.EndingNo      = ActiveEntity.EndingNo.ToValueAsString();

                    OldMandatoryFields.Code          = ActiveEntity.Code;
                    OldMandatoryFields.Description   = ActiveEntity.Description;
                    OldMandatoryFields.Location_code = ActiveEntity.Location_code;
                    OldMandatoryFields.Prefix        = ActiveEntity.Prefix;
                    OldMandatoryFields.BeginningNo   = ActiveEntity.BeginningNo.ToValueAsString();
                    OldMandatoryFields.EndingNo      = ActiveEntity.EndingNo.ToValueAsString();
                }
            }
        }