Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [HttpPost]
- public AttachmentDto CreateAttachment(JObject json)
- {
- using (var _client = new DataServiceClient("epData"))
- {
- if (Properties.Settings.Default.Domain != "")
- {
- _client.ClientCredentials.Windows.ClientCredential.UserName = Properties.Settings.Default.Domain + "\" + Properties.Settings.Default.Login;
- _client.ClientCredentials.Windows.ClientCredential.Password = Properties.Settings.Default.Password;
- }
- var userId = json["userId"].ToObject<Guid>();
- _client.SetCurrentUser(userId);
- var filePath = json["filePath"].ToObject<string>();
- var originalFilePath = Convert.FromBase64String(filePath);
- var fileName = json["fileName"].ToObject<string>();
- var categoryId = json["categoryId"].ToObject<Guid>();
- var result = _client.CreateAttachment(fileName, categoryId, data);
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement