public int Create(string Number, int?ContractorID, int?ToStructureObjectID, int?FromStructureObjectID, DateTime?Date, decimal DocumentSum, decimal PaySum, int DocumentTypeID, int?LinkedDocumentID, string Description, int CurrencyID, string Address, int EnterpriseID) { int result = 1; int userId = Compas.Logic.Security.CurrentSecurityContext.Identity.ID; WareDocument sr = WareDocument.CreateWareDocument(1, DocumentSum, PaySum, DocumentTypeID, userId, DateTime.Now, CurrencyID, true); sr.Number = Number; sr.ContractorID = ContractorID; sr.ToStructureObjectD = ToStructureObjectID; sr.FromStructureObjectID = FromStructureObjectID; sr.Date = Date; sr.LinkedDocumentID = LinkedDocumentID; sr.Description = Description; sr.Address = Address; sr.EnterpriseID = EnterpriseID; Logic.Staff.StaffEmployeeLogic staffLogic = new Staff.StaffEmployeeLogic(manager); StaffEmployee employee = staffLogic.GetByUserID(userId); if (employee != null) { sr.CreatedEmployeeID = employee.ID; } context.AddToWareDocuments(sr); return(result); }
public int Create(int DocumentID, int StateID, DateTime StartDate) { int result = 1; WareDocumentState sr = new WareDocumentState(); sr.DocumentID = DocumentID; sr.Active = true; sr.StateID = StateID; sr.StartDate = StartDate; int userId = Compas.Logic.Security.CurrentSecurityContext.Identity.ID; Logic.Staff.StaffEmployeeLogic staffLogic = new Staff.StaffEmployeeLogic(manager); StaffEmployee employee = staffLogic.GetByUserID(userId); if (employee != null) { sr.EmployeeID = employee.ID; } context.WareDocumentStates.AddObject(sr); return(result); }