protected unsafe void EnableActionRecord() { iCallbackRecord = new CallbackRecord(DoRecord); IntPtr ptr = GCHandle.ToIntPtr(iGch); DvServiceUpnpOrgAVTransport2EnableActionRecord(iHandle, iCallbackRecord, ptr); }
public ActionResult <GenericResponseModel> InsertCallbackRecord([FromBody] CallbackRecord pObject) { var loUserId = HelperMethods.GetApiUserIdFromToken(HttpContext.User.Identity); var loGenericResponse = new GenericResponseModel { Status = "Fail", Code = -1 }; if (string.IsNullOrEmpty(pObject.applicant_name) || string.IsNullOrEmpty(pObject.applicant_surname)) { loGenericResponse.Status = "Fail"; loGenericResponse.Code = -1; loGenericResponse.Message = "Talebe ait ad soyad girilmesi zorunludur."; return(loGenericResponse); } if (string.IsNullOrEmpty(pObject.applicant_phone)) { loGenericResponse.Status = "Fail"; loGenericResponse.Code = -1; loGenericResponse.Message = "Geri aranacak telefon numarası girilmesi zorunludur."; return(loGenericResponse); } if (pObject.asset_uuid == null) { loGenericResponse.Status = "Fail"; loGenericResponse.Code = -1; loGenericResponse.Message = "Talebe ait gayrimenkul seçilmesi zorunludur."; return(loGenericResponse); } pObject.applicant_phone = HelperMethods.SerializePhone(pObject.applicant_phone); pObject.row_create_date = DateTime.Now; pObject.row_create_user = loUserId; pObject.row_guid = Guid.NewGuid(); pObject.is_active = true; pObject.is_deleted = false; pObject.applicant_name = pObject.applicant_name.ToUpper(); pObject.applicant_surname = pObject.applicant_surname.ToUpper(); pObject.callback_record_state_type_system_type_id = 43; var loResult = Crud <CallbackRecord> .Insert(pObject, out _); if (loResult < 0) { loGenericResponse.Message = "Kayıt yapılamadı, tekrar deneyiniz!"; return(loGenericResponse); } Task.Run(() => HelperMethods.SendNewCallBackRecord(pObject)); loGenericResponse.Code = 200; loGenericResponse.Message = ""; loGenericResponse.Data = pObject; loGenericResponse.Status = "Ok"; return(loGenericResponse); }
public static void SendNewCallBackRecord(CallbackRecord pCallbackRecord) { var loAsset = GetData.GetAssetById(pCallbackRecord.asset_uuid.ToString()); var loMailContent = File.ReadAllText("winvestate_new_cr_mail.html"); loMailContent = loMailContent.Replace("@CustomerName@", pCallbackRecord.applicant_name + " " + pCallbackRecord.applicant_surname); loMailContent = loMailContent.Replace("@CustomerPhone@", pCallbackRecord.applicant_phone); loMailContent = loMailContent.Replace("@AssetName@", loAsset.asset_no + " " + loAsset.asset_name); loMailContent = loMailContent.Replace("@OperationDate@", pCallbackRecord.row_create_date.Value.ToString("f")); loMailContent = loMailContent.Replace("@AssetLink@", "https://e-teklif.winvestate.com/Asset/AssetDetail?pId=" + pCallbackRecord.asset_uuid); RestCalls.SendMail(loMailContent, Common.InfoMailList, "Yeni Geri Aranma Talebi"); }
public ActionResult <GenericResponseModel> ChangeCallbackRecord([FromBody] CallbackRecord pObject) { var loUserId = HelperMethods.GetApiUserIdFromToken(HttpContext.User.Identity); var loGenericResponse = new GenericResponseModel { Status = "Fail", Code = -1 }; var loCallbackRecord = GetData.GetCallbackRecordById(pObject.row_guid.ToString()); if (loCallbackRecord == null) { loGenericResponse.Status = "Fail"; loGenericResponse.Code = -1; loGenericResponse.Message = "Geri aranma talebi bulunamadı."; return(loGenericResponse); } loCallbackRecord.row_update_date = DateTime.Now; loCallbackRecord.row_update_user = loUserId; loCallbackRecord.callback_record_state_type_system_type_id = pObject.callback_record_state_type_system_type_id; loCallbackRecord.note = pObject.note; var loResult = Crud <CallbackRecord> .Update(loCallbackRecord, out _); if (!loResult) { loGenericResponse.Message = "Kayıt yapılamadı, tekrar deneyiniz!"; return(loGenericResponse); } loGenericResponse.Code = 200; loGenericResponse.Message = ""; loGenericResponse.Data = pObject; loGenericResponse.Status = "Ok"; return(loGenericResponse); }
static extern void DvServiceUpnpOrgAVTransport2EnableActionRecord(uint aHandle, CallbackRecord aCallback, IntPtr aPtr);