This commit is contained in:
Kathy Ruffing 2010-11-08 14:33:27 +00:00
parent 9a87d41091
commit 120949de80

View File

@ -257,7 +257,7 @@ namespace VEPROMS.CSLA.Library
} }
public ItemInfo InsertSiblingBefore(string text, string number) public ItemInfo InsertSiblingBefore(string text, string number)
{ {
ItemInfo tmp = NewItemInfoFetch(ItemID, EAddpingPart.Before, number, text, null, null, null, null, DateTime.Now, Environment.UserName); ItemInfo tmp = NewItemInfoFetch(ItemID, EAddpingPart.Before, number, text, null, null, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID);
// this item is updated in SQL so we have to manually force the iteminfo updates // this item is updated in SQL so we have to manually force the iteminfo updates
// Refresh ItemInfo to update Previous // Refresh ItemInfo to update Previous
using (Item item = Get()) ItemInfo.Refresh(item); using (Item item = Get()) ItemInfo.Refresh(item);
@ -309,24 +309,24 @@ namespace VEPROMS.CSLA.Library
switch ((E_FromType)fromType) switch ((E_FromType)fromType)
{ {
case E_FromType.Procedure: case E_FromType.Procedure:
tmp = DataPortal.Fetch<ProcedureInfo>(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Environment.UserName)); tmp = DataPortal.Fetch<ProcedureInfo>(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
break; break;
case E_FromType.Section: case E_FromType.Section:
tmp = DataPortal.Fetch<SectionInfo>(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Environment.UserName)); tmp = DataPortal.Fetch<SectionInfo>(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
break; break;
default: default:
tmp = DataPortal.Fetch<StepInfo>(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Environment.UserName)); tmp = DataPortal.Fetch<StepInfo>(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
break; break;
} }
} }
else else
{ {
if (GetType() == typeof(ProcedureInfo)) if (GetType() == typeof(ProcedureInfo))
tmp = DataPortal.Fetch<ProcedureInfo>(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Environment.UserName)); tmp = DataPortal.Fetch<ProcedureInfo>(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
else if (GetType() == typeof(SectionInfo)) else if (GetType() == typeof(SectionInfo))
tmp = DataPortal.Fetch<SectionInfo>(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Environment.UserName)); tmp = DataPortal.Fetch<SectionInfo>(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
else else
tmp = DataPortal.Fetch<StepInfo>(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Environment.UserName)); tmp = DataPortal.Fetch<StepInfo>(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
} }
return tmp; return tmp;
@ -343,8 +343,8 @@ namespace VEPROMS.CSLA.Library
} }
public ItemInfo InsertSiblingAfter(string text, string number, int? type) public ItemInfo InsertSiblingAfter(string text, string number, int? type)
{ {
ItemInfo tmp = NewItemInfoFetch(ItemID, EAddpingPart.After, number, text, type, null, null, null, DateTime.Now, Environment.UserName); ItemInfo tmp = NewItemInfoFetch(ItemID, EAddpingPart.After, number, text, type, null, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID);
//tmp = DataPortal.Fetch<StepInfo>(new AddingPartCriteria(ItemID, EAddpingPart.After, number, text, type, null, null, null, DateTime.Now, Environment.UserName)); //tmp = DataPortal.Fetch<StepInfo>(new AddingPartCriteria(ItemID, EAddpingPart.After, number, text, type, null, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
// if next exists, it is updated in SQL so we have to manually force the iteminfo updates // if next exists, it is updated in SQL so we have to manually force the iteminfo updates
// Refresh ItemInfo to update PreviousID field // Refresh ItemInfo to update PreviousID field
if (tmp.NextItem != null) using (Item item = tmp.NextItem.Get()) ItemInfo.Refresh(item); if (tmp.NextItem != null) using (Item item = tmp.NextItem.Get()) ItemInfo.Refresh(item);
@ -436,7 +436,7 @@ namespace VEPROMS.CSLA.Library
} }
public ItemInfo InsertChild(E_FromType fromType, int type, string text, string number) public ItemInfo InsertChild(E_FromType fromType, int type, string text, string number)
{ {
ItemInfo tmp = NewItemInfoFetch(ItemID, EAddpingPart.Child, number, text, type, (int?) fromType, null, null, DateTime.Now, Environment.UserName); ItemInfo tmp = NewItemInfoFetch(ItemID, EAddpingPart.Child, number, text, type, (int?)fromType, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID);
// if next exists, it is updated in SQL so we have to manually force the iteminfo updates // if next exists, it is updated in SQL so we have to manually force the iteminfo updates
// Refresh ItemInfo to update PreviousID field // Refresh ItemInfo to update PreviousID field
if (tmp.NextItem != null) using (Item item = tmp.NextItem.Get()) ItemInfo.Refresh(item); if (tmp.NextItem != null) using (Item item = tmp.NextItem.Get()) ItemInfo.Refresh(item);
@ -859,7 +859,7 @@ namespace VEPROMS.CSLA.Library
ItemInfo nextItem = item.NextItem; ItemInfo nextItem = item.NextItem;
ItemInfo prevItem = item.MyPrevious; ItemInfo prevItem = item.MyPrevious;
item.OnBeforeDelete(); item.OnBeforeDelete();
DataPortal.Delete(new DeleteCriteria(item.ItemID,Environment.UserName)); DataPortal.Delete(new DeleteCriteria(item.ItemID, Volian.Base.Library.VlnSettings.UserID));
if (nextItem != null) // Adjust PreviousID for NextItem if (nextItem != null) // Adjust PreviousID for NextItem
{ {
ItemInfo.RefreshPrevious(nextItem.ItemID, item.PreviousID); ItemInfo.RefreshPrevious(nextItem.ItemID, item.PreviousID);
@ -984,11 +984,11 @@ namespace VEPROMS.CSLA.Library
{ {
ItemInfo tmp = null; ItemInfo tmp = null;
if (itemInfo.GetType() == typeof(ProcedureInfo)) if (itemInfo.GetType() == typeof(ProcedureInfo))
tmp = DataPortal.Fetch<ProcedureInfo>(new ItemInfo.PastingPartCriteria(copyStartID, itemInfo.ItemID, ItemInfo.EAddpingPart.Replace, itemInfo.MyContent.Type, itemInfo.MyContent.Type, DateTime.Now, Environment.UserName)); tmp = DataPortal.Fetch<ProcedureInfo>(new ItemInfo.PastingPartCriteria(copyStartID, itemInfo.ItemID, ItemInfo.EAddpingPart.Replace, itemInfo.MyContent.Type, itemInfo.MyContent.Type, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
else if (itemInfo.GetType() == typeof(SectionInfo)) else if (itemInfo.GetType() == typeof(SectionInfo))
tmp = DataPortal.Fetch<SectionInfo>(new ItemInfo.PastingPartCriteria(copyStartID, itemInfo.ItemID, ItemInfo.EAddpingPart.Replace, itemInfo.MyContent.Type, itemInfo.MyContent.Type, DateTime.Now, Environment.UserName)); tmp = DataPortal.Fetch<SectionInfo>(new ItemInfo.PastingPartCriteria(copyStartID, itemInfo.ItemID, ItemInfo.EAddpingPart.Replace, itemInfo.MyContent.Type, itemInfo.MyContent.Type, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
else else
tmp = DataPortal.Fetch<StepInfo>(new ItemInfo.PastingPartCriteria(copyStartID, itemInfo.ItemID, ItemInfo.EAddpingPart.Replace, itemInfo.MyContent.Type, itemInfo.MyContent.Type, DateTime.Now, Environment.UserName)); tmp = DataPortal.Fetch<StepInfo>(new ItemInfo.PastingPartCriteria(copyStartID, itemInfo.ItemID, ItemInfo.EAddpingPart.Replace, itemInfo.MyContent.Type, itemInfo.MyContent.Type, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
return tmp; return tmp;
} }