public void AddFile(string type, int code, string _name, string desc, string newName) { C2.HrAttachment photo = new C2.HrAttachment(); photo.FileName = _name; photo.Person = code; photo.FileNote = desc; photo.FileType = type; photo.FilePath = "../../Photos/Hr/" + this.txt_Sn.Text + "/" + newName; Manager.ORManager.StartTracking(photo, Wilson.ORMapper.InitialState.Inserted); Manager.ORManager.PersistChanges(photo); }
public void AddFile(string type, string code, string _name, string desc, string _category) { C2.HrAttachment photo = new C2.HrAttachment(); photo.FileName = _name; //photo.conterno = cmb_ContNo.Text; photo.Person = SafeValue.SafeInt(code, 0); photo.FileNote = desc; photo.FileType = type; photo.FilePath = GetFilePath(this.txt_Sn.Text, this.cmb_ContNo.Text, this.cmb_DoNo.Text) + _name; photo.Category = _category; photo.CreateBy = HttpContext.Current.User.Identity.Name; photo.CreateDateTime = DateTime.Now.ToLocalTime(); Manager.ORManager.StartTracking(photo, Wilson.ORMapper.InitialState.Inserted); Manager.ORManager.PersistChanges(photo); }