Пример #1
0
 private void logGlacialList_ItemChangedEvent(object source, GlacialComponents.Controls.ChangedEventArgs e)
 {
     if (e.ChangedType == ChangedTypes.SubItemChanged)
     {
         if (e.Column.Name == "standardClaimColumn")
         {
             ((ActivityPresentation)e.Item.Tag).Claim.StandardClaim = true;
             e.Item.SubItems[8].ForeColor = Color.Gray;
             e.Item.SubItems[9].ForeColor = Color.Gray;
             e.Item.SubItems[10].ForeColor = Color.Gray;
             ((ActivityPresentation)e.Item.Tag).Modified = ModificationStatus.Modified;
         }
         else if (e.Column.Name == "claimAccountColumn")
         {
             if (!((ActivityPresentation)e.Item.Tag).OldValues.Contains("ClaimAccount"))
                 ((ActivityPresentation)e.Item.Tag).OldValues.Add("ClaimAccount", null);
             ((ActivityPresentation)e.Item.Tag).OldValues["ClaimAccount"] = ((ActivityPresentation)e.Item.Tag).Claim.ClaimCode.Account;
             ((ActivityPresentation)e.Item.Tag).Claim.ClaimCode.Account = e.SubItem.Text;
             ((ActivityPresentation)e.Item.Tag).Claim.StandardClaim = false;
             e.Item.SubItems[6].Value = false;
             e.Item.SubItems[8].ForeColor = Color.Black;
             e.Item.SubItems[9].ForeColor = Color.Black;
             e.Item.SubItems[10].ForeColor = Color.Black;
             ((ActivityPresentation)e.Item.Tag).Modified = ModificationStatus.Modified;
         }
         else if (e.Column.Name == "claimWorkItemColumn")
         {
             if (!((ActivityPresentation)e.Item.Tag).OldValues.Contains("ClaimWorkItem"))
                 ((ActivityPresentation)e.Item.Tag).OldValues.Add("ClaimWorkItem", null);
             ((ActivityPresentation)e.Item.Tag).OldValues["ClaimWorkItem"] = ((ActivityPresentation)e.Item.Tag).Claim.ClaimCode.WorkItem;
             ((ActivityPresentation)e.Item.Tag).Claim.ClaimCode.WorkItem = e.SubItem.Text;
             ((ActivityPresentation)e.Item.Tag).Claim.StandardClaim = false;
             e.Item.SubItems[6].Value = false;
             e.Item.SubItems[8].ForeColor = Color.Black;
             e.Item.SubItems[9].ForeColor = Color.Black;
             e.Item.SubItems[10].ForeColor = Color.Black;
             ((ActivityPresentation)e.Item.Tag).Modified = ModificationStatus.Modified;
         }
         else if (e.Column.Name == "plannedOvertimeColumn")
         {
             ((ActivityPresentation)e.Item.Tag).Claim.PlannedOvertime = (bool)e.SubItem.Value;
             //e.Item.SubItems[7].Value = true;
             ((ActivityPresentation)e.Item.Tag).Modified = ModificationStatus.Modified;
         }
         applyChangesButton.Enabled = true;
     }
 }
Пример #2
0
        private void logGlacialList_ItemChangedEvent(object source, GlacialComponents.Controls.ChangedEventArgs e)
        {
            if (e.ChangedType == ChangedTypes.SubItemChanged)
            {
                GLColumn changedColumn = null;
                ActivityPresentation activityItem = (ActivityPresentation)e.Item.Tag;

                changedColumn = e.SubItem.Column;
            //				for(int i = 0; i < e.Item.SubItems.Count; i++)
            //					if (e.Item.SubItems[i] == e.SubItem)
            //					{
            //						changedColumn = e.Item.ParentList.Columns[i];
            //						break;
            //					}
                if (changedColumn.Name == "dateColumn")
                {
                    activityItem.Entry.StartTime = (((DateTime)e.SubItem.Value).Date).Add(activityItem.Entry.StartTime.TimeOfDay);
                }
                else if (changedColumn.Name == "customerColumn")
                {
                    activityItem.Entry.Customer = e.SubItem.Text;
                }
                else if (changedColumn.Name == "activityColumn")
                {
                    activityItem.Entry.Activity = e.SubItem.Text;
                }
                else if (changedColumn.Name == "startTimeColumn")
                {
                    activityItem.Entry.StartTime = activityItem.Entry.StartTime.Date.Add(((DateTime)e.SubItem.Value).TimeOfDay);
                }
                else if (changedColumn.Name == "durationColumn")
                {
                    activityItem.Entry.WorkDuration = Convert.ToInt32(e.SubItem.Text);
                }
                else if (changedColumn.Name == "ticketColumn")
                {
                    activityItem.Entry.TicketNumber = e.SubItem.Text;
                }
                else if (changedColumn.Name == "commentColumn")
                {
                    activityItem.Entry.Comment = e.SubItem.Text;
                }

                activityItem.Modified = ModificationStatus.Modified;
                applyChangesButton.Enabled = true;
                RefreshActivitiesList();
            }
        }
Пример #3
0
 private void logGlacialList_EmbeddedActivating(object source, GlacialComponents.Controls.EmbeddedActivatingEventArgs e)
 {
     if (e.SubItem.Column.Name == "standardClaimColumn")
     {
         if (e.SubItem.Value != null)
             e.Cancel = ((ActivityPresentation)e.SubItem.ParentItem.Tag).Claim.StandardClaim;
     }
     else if (e.SubItem.Column.Name == "plannedOvertimeColumn")
     {
         if (e.SubItem.Value != null)
             e.Cancel = !((ActivityPresentation)e.SubItem.ParentItem.Tag).Claim.ClaimCode.Overtime;
     }
 }