Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public bool CreateEvent(Operations operation)
- {
- try
- {
- if (operation == null)
- return false;
- user = (Users)Session["CurrentUser"];
- var contentResources = services.ApiResult(user, Constants.RscService);
- var resource = ResourceData(contentResources, operation.Resources.ResourceID);
- EpicorRest.AppPoolHost = ConfigurationManager.AppSettings["EpicorRest.AppPoolHos"];
- EpicorRest.AppPoolInstance = ConfigurationManager.AppSettings["EpicorRest.AppPoolInstance"];
- EpicorRest.UserName = user.UserLogin;
- EpicorRest.Password = user.Password;
- EpicorRest.IgnoreCertErrors = true;
- EpicorRest.CallSettings = new CallSettings(operation.CompanyID, string.Empty, string.Empty, string.Empty);
- dynamic UDRecord = new
- {
- Company = operation.CompanyID,
- Key1 = Guid.NewGuid().ToString(),
- Key2 = "",
- Key3 = "",
- Key4 = "",
- Key5 = "",
- Address1_c = operation.ShipAddress1,
- Address2_c = operation.ShipAddress2,
- Comment_c = operation.SchedComment,
- CustName_c = operation.CustName,
- Email_c = operation.CustEmail,
- PhoneNum_c = operation.CustPhoneNum,
- StartDate_c = operation.StartOperationDate,
- EndDate_c = operation.EndOperationDate,
- JobNum_c = operation.JobNum,
- Operation_c = operation.OpCode,
- Resource_c = operation.Resources.ResourceID,
- ResourceGroup_c = resource.GroupID,
- ShipToCity_c = operation.ShipCity,
- ShipToState_c = operation.ShipState,
- ShipToZIP_c = operation.ShipZip,
- Part_c = operation.PartNum,
- RowMod = "U"
- };
- EpicorRest.PostUDRecord("UD20", UDRecord);
- return true;
- }
- catch (Exception ex)
- {
- string errorMessage = ex.Message;
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement