Beispiel #1
0
 void InspectorDataEditor_Ok(object sender, EventArgs e)
 {
     try
     {
         if (((PhysicalCountInspectorInfo)InspectorDataEditor.DataSource).UserId == Guid.Empty)
         {
             errorDisplayer.ShowErrorMessage("Inspector is required");
         }
         else if (InspectorDataEditor.IsNew)
         {
             inventoryService.AddInspector(physicalCountInformation, (PhysicalCountInspectorInfo)InspectorDataEditor.DataSource);
             InspectorGridViewer.DataBind();
             InspectorDataEditor.IsNew = false;
         }
         else
         {
             var editedInspector = from inspector in PhysicalCountInformation.Inspectors
                                   where inspector.Id == ((PhysicalCountInspectorInfo)InspectorDataEditor.DataSource).Id
                                   select inspector;
             if (editedInspector.Count() > 0)
             {
                 editedInspector.ElementAt(0).Copy((PhysicalCountInspectorInfo)InspectorDataEditor.DataSource);
                 InspectorGridViewer.DataBind();
             }
         }
         btnCancel.Text = "  Cancel  ";
         mpeInspectorDataEditorExtender.Hide();
     }
     catch (Exception ex)
     {
         errorDisplayer.ShowErrorMessage(ex.Message);
     }
 }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            errorDisplayer.ClearErrorMessage();
            InspectorGridViewer.DataSource = physicalCountInformation.Inspectors;
            InspectorGridViewer.DataBind();
            var gridCommands = from command in InspectorGridViewer.Driver.Columns
                               where command.IsCommand
                               select command.AttachedRenderer;

            foreach (LinkGINColumnRenderer linkCommand in gridCommands)
            {
                linkCommand.Command += new CommandEventHandler(linkCommand_Command);
            }

            if (!IsPostBack)
            {
                PhysicalCountEditor.DataSource = PhysicalCountInformation;
                PhysicalCountEditor.DataBind();
            }
        }