public void CopyFrom(ViewDocs ev, Model.ApplicationDbContext db) { this.CreatedByLogin = ev.CreatedByLogin; //var EvTime = new System.TimeSpan(ev.DocsInsertTime.Hour, ev.DocsInsertTime.Minute, 0); this.DocsName = ev.DocsName; this.DocYear = ev.DocYear; this.DocMonth = ev.DocMonth; this.StausChangeDateTime = ev.StausChangeTime; this.DocType = (int)ev.DocType; this.StausChangeDateTime = ev.StausChangeTime; this.DocWeek = ev.DocWeek; this.InvoiceNo = ev.InvoiceNo; this.IsForeign = ev.IsForeign; this.Status = (int)ev.Status; this.ExternalLinkBig = ev.ExternalLinkBig; this.Description = ev.Description; if (ev.OrganizerEvent != null && ev.OrganizerEvent != "") { this.OrganizerEvent = ev.OrganizerEvent; } this.OrganizerName = ev.OrganizerName; using (db) { var org = db.Organizers.Find(ev.OrganizerEvent); //this.OrganizerName = org.OrganizerName; } }
public Doc(ViewDocs ev) { this.CreatedByLogin = ev.CreatedByLogin; //var EvTime = new System.TimeSpan(ev.DocsInsertTime.Hour, ev.DocsInsertTime.Minute, 0); this.DocsName = ev.DocsName; this.DocYear = ev.DocYear; this.DocMonth = ev.DocMonth; this.StausChangeDateTime = ev.StausChangeTime; this.DocWeek = ev.DocWeek; this.InvoiceNo = ev.InvoiceNo; this.IsForeign = ev.IsForeign; this.DocType = (int)ev.DocType; //this.StausChangeDateTime = this.StausChangeDateTime .Add(EvTime); this.Status = (int)ev.Status; this.Description = ev.Description; this.OrganizerEvent = ev.OrganizerEvent; this.OrganizerName = ev.OrganizerName; //using (ApplicationDBContext db = new ApplicationDBContext()) //{ // var org = db.Organizers.Find(ev.OrganizerEvent); // // this.OrganizerName = org.OrganizerName; //} }