public AddStudentUserControl() { InitializeComponent(); this.Rooms.ItemsSource = RoomService.GetRoomsByCampus(campus).Select(r => r.Number); this.University.ItemsSource = GeneralService.GetUniversities().Select(u => u.Name); this.Town.ItemsSource = TownService.GetTowns().Select(t => t.Name); }
public JsonResult CreateAPIUser(NewUsersModel nUsermodel) { try { var newUserResult = _db.Query <CreatedUserResultModel>(";Exec Supreme_InsertUser @UserName,@Password,@CompanyName,@Address,@CreatedBy", new { UserName = nUsermodel.UserName, Password = GetHashedPassword(nUsermodel.Password), CompanyName = nUsermodel.CompanyName, Address = nUsermodel.Address, CreatedBy = nUsermodel.CreatedBy }).SingleOrDefault(); nUsermodel.Password = string.Empty; logger.LogWrite(JsonConvert.SerializeObject(nUsermodel).ToString()); return(Json(newUserResult, JsonRequestBehavior.AllowGet)); } catch (Exception ee) { GenericResultModel AccListResult2 = new GenericResultModel(); AccListResult2.Status = "Fail"; AccListResult2.Remarks = ee.Message; GeneralService.WriteErrorLog(ref ee); return(Json(AccListResult2, JsonRequestBehavior.AllowGet)); } }
private void tbxBarcode_TextChanged(object sender, TextChangedEventArgs e) { var textbox = sender as TextBox; string inputBarcode = textbox.Text; InventoryDBContext inventoryDBContext = new InventoryDBContext(); ItemRepository itemRepository = new ItemRepository(); var existingItemByBarcode = itemRepository.GetItemByBarcodeNumber(inventoryDBContext, inputBarcode); if (existingItemByBarcode != null) { tbxProductName.Text = existingItemByBarcode.Name; tbxBrandName.Text = existingItemByBarcode.BrandName; tbxUnit.Text = existingItemByBarcode.Unit; tbxStock.Text = existingItemByBarcode.Stock.ToString(); tbxSellingPrice.Text = existingItemByBarcode.SellingPrice.ToString(); tbxWholeSalePrice.Text = existingItemByBarcode.WholeSalePrice.ToString(); tbxDescription.Text = existingItemByBarcode.Description; } else { generalService = new GeneralService(); generalService.TraverseVisualTree(this); } }
public IHttpActionResult obtenerMaestro(string maestroDesc) { GeneralService serv = new GeneralService(); var lista = serv.obtenerMaestro(maestroDesc); return(Ok(lista)); }
public IHttpActionResult ListarAgentesRecomendados(int idDiagnostico) { GeneralService serv = new GeneralService(); var lista = serv.ListarAgentesRecomendados(idDiagnostico); return(Ok(lista)); }
//Consulta em tabela customizada por objeto, passar nome da tabela e coleção de parâmetros(Nome do campo e valor) protected GeneralData Consultar(string nomeObjeto, Dictionary <string, string> parametros) { oGeneralData = null; try { if (!String.IsNullOrEmpty(nomeObjeto) && parametros != null) { oCompService = oCompany.GetCompanyService(); oGeneralService = oCompService.GetGeneralService(nomeObjeto); oGeneralParams = ((SAPbobsCOM.GeneralDataParams)(oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralDataParams))); if (parametros != null && parametros.Count > 0) { foreach (var item in parametros) { oGeneralParams.SetProperty(item.Key.ToString(), item.Value); } oGeneralData = oGeneralService.GetByParams(oGeneralParams); } } } catch (Exception e) { throw e; } return(oGeneralData); }
//Alteração em tabela customizada por objeto, passar nome da tabela e coleção de parâmetros(Nome do campo e valor) protected bool Alterar(string nomeObjeto, string codigo, Dictionary <string, string> parametros) { bool retorno = false; try { oCompService = oCompany.GetCompanyService(); oGeneralService = oCompService.GetGeneralService(nomeObjeto); oGeneralParams = ((SAPbobsCOM.GeneralDataParams)(oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralDataParams))); //Recupera Objeto para alteração oGeneralParams.SetProperty("Code", codigo); oGeneralData = oGeneralService.GetByParams(oGeneralParams); if (parametros != null && parametros.Count > 0) { foreach (var item in parametros) { oGeneralData.SetProperty(item.Key.ToString(), item.Value.ToString()); } oGeneralService.Update(oGeneralData); } retorno = true; } catch (Exception e) { throw e; } return(retorno); }
//Inclusão em tabela customizada por objeto, passar nome da tabela e coleção de parâmetros(Nome do campo e valor) protected void Incluir(string nomeObjeto, Dictionary <string, string> parametros) { try { oCompService = oCompany.GetCompanyService(); oCompany.StartTransaction(); oGeneralService = oCompService.GetGeneralService(nomeObjeto); oGeneralData = (SAPbobsCOM.GeneralData)oGeneralService.GetDataInterface(GeneralServiceDataInterfaces.gsGeneralData); if (parametros != null && parametros.Count > 0) { foreach (var item in parametros) { oGeneralData.SetProperty(item.Key.ToString(), item.Value.ToString()); } oGeneralService.Add(oGeneralData); } if (oCompany.InTransaction) { oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_Commit); } } catch (Exception e) { if (oCompany.InTransaction) { oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack); } throw e; } }
public async Task <IHttpActionResult> SignIn(SignInViewModel model) { var token = await WebApiService.Instance.AuthenticateAsync <TokenViewModel>(model.Email, model.Password); var loginInfo = token.LoginInfo; token.LoginInfo = null;//remove logininfo as it increases token cookie size token.UserId = loginInfo.UserId; var tokenConfig = TokenConfig.GetToken(); tokenConfig.UpdateTokenSession(token); var userPages = await WebApiService.Instance.GetAsync <List <UserPageViewModel> >($"UserPage/Get?id={token.UserId}"); var notificationCount = await WebApiService.Instance.PostAsync <int>($"Notification/Count", loginInfo); var settings = await WebApiService.Instance.GetAsync <List <SettingViewModel> >($"AccessibleToViewSetting/List"); var isHLM = await WebApiService.Instance.GetAsync <bool>($"general/ishlm?roleid={loginInfo.RoleId}"); return(Ok(new { Token = GeneralService.EncryptText(token.AccessToken), UserInfo = loginInfo, UserPages = userPages, NotificationCount = notificationCount, Settings = settings, IsHLM = isHLM })); }
public ActionResult RecentList() { SearchViewModel viewModel = GeneralService.GetSearchService().GetRecentList(); viewModel.NumberOfItemsPerRow = Request.Browser.ScreenPixelsWidth >= 800 ? 4 : 3; return(PartialView("SearchList", viewModel)); }
/// <summary> /// Deleta registro /// </summary> /// <param name="tableName">Nome da tabela</param> /// <param name="where">Condição WHERE</param> public void DeleteModel(string tableName, string where) { Recordset rs = (Recordset)SBOApp.Company.GetBusinessObject(BoObjectTypes.BoRecordset); string sql = @"SELECT Code FROM [{0}] WHERE {1}"; sql = SBOApp.TranslateToHana(String.Format(sql, tableName, where)); rs.DoQuery(String.Format(sql, tableName, where)); if (rs.RecordCount > 0) { CompanyService sCompany = SBOApp.Company.GetCompanyService(); GeneralService oGeneralService = sCompany.GetGeneralService(tableName.Replace("@", "")); GeneralDataParams oGeneralParams = (GeneralDataParams)oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralDataParams); oGeneralParams.SetProperty("Code", rs.Fields.Item(0).Value.ToString()); oGeneralService.Delete(oGeneralParams); } //Libera o objeto rs e chama o Garbage Collector Marshal.ReleaseComObject(rs); rs = null; GC.Collect(); }
public static TokenValidation ValidateToken(string validToken) { try { System.Data.IDbConnection _Mydb = Supreme_Mobile.Models.GeneralService.DapperConnection(); var loginResult = _Mydb.Query <ValidTokenResultModel>(";Exec Supreme_AuthenticateToken @TokenID", new { TokenID = validToken }).SingleOrDefault(); MyUsersModel userModel = new MyUsersModel(); userModel.UserID = loginResult.UserID; userModel.UserName = loginResult.UserName; userModel.SecurityStamp = loginResult.SecurityStamp; GeneralService logger = new GeneralService(); logger.LogWrite("Token: " + validToken + " - " + JsonConvert.SerializeObject(userModel).ToString()); var validation = TokenManager.ValidateToken(ConfirmLoginTokenPurpose, userModel, validToken); return(validation); } catch (Exception ee) { var result = new TokenValidation(); result.Errors.Add(TokenValidationStatus.Expired); GeneralService.WriteErrorLog(ref ee); return(result); } }
private void btnReset_Click(object sender, RoutedEventArgs e) { //clear all fields generalService = new GeneralService(); generalService.TraverseVisualTree(this); }
private void BorderChoice_Tap(object sender, System.Windows.Input.GestureEventArgs e) { var choice = (sender as FrameworkElement).DataContext as Concept; var currentQuestion = DisplayQuestions[_currentQuestion]; if (currentQuestion.Answer.Uid.Equals(choice.Uid)) { SlideViewQuestion.MoveToNextItem(); //replace the current question with a new one DisplayQuestions[_currentQuestion] = GeneralService.GetRandomQuestion(); _questionCount++; TextBlockTitle.Text = "Question " + (_questionCount + 1); if (_currentQuestion == 1) { _currentQuestion = 0; } else { _currentQuestion = 1; } _counterStoryboard.Stop(); _counterStoryboard.Begin(); TextBlockAnswer.Text = ""; } else { GameOver(); } }
public AddCampusUserControl() { InitializeComponent(); University.ItemsSource = GeneralService.GetUniversities().Select(u => u.Name); Password.BorderBrush = Brushes.Black; RepeatPassword.BorderBrush = Brushes.Black; }
public static bool addUDOInfo(object UDOInfo, string UDOName) { bool blResult = false; CompanyService objCompanyService = null; GeneralService UDOService = null; GeneralData headerInfo = null; GeneralDataParams addResult = null; try { objCompanyService = MainObject.Instance.B1Company.GetCompanyService(); UDOService = objCompanyService.GetGeneralService(UDOName); headerInfo = UDOService.GetDataInterface(GeneralServiceDataInterfaces.gsGeneralData); foreach (var prop in UDOInfo.GetType().GetProperties()) { headerInfo.SetProperty(prop.Name, prop.GetValue(UDOInfo, null)); } addResult = UDOService.Add(headerInfo); } catch (Exception er) { _Logger.Error("", er); } return(blResult); }
// GET: Search public ActionResult Index(string searchText) { SearchViewModel viewModel = GeneralService.GetSearchService().GetSearchResults(searchText); viewModel.NumberOfItemsPerRow = Request.Browser.ScreenPixelsWidth >= 800 ? 4 : 3; return(View(viewModel)); }
public static GeneralData getUDOInfo(object objKey, string UDOName) { GeneralData objResult = null; CompanyService objCompanyService = null; GeneralService UDOService = null; GeneralDataParams getInfo = null; try { objCompanyService = MainObject.Instance.B1Company.GetCompanyService(); UDOService = objCompanyService.GetGeneralService(UDOName); foreach (var prop in objKey.GetType().GetProperties()) { getInfo.SetProperty(prop.Name, prop.GetValue(objKey, null)); } objResult = UDOService.GetByParams(getInfo); } catch (COMException comEx) { _Logger.Error("", comEx); } catch (Exception er) { _Logger.Error("", er); } return(objResult); }
/// <summary> /// Almacena los datos de la tabla TFECERT /// </summary> /// <param name="comp"></param> /// <param name="ruta"></param> /// <param name="pass"></param> /// <param name="usuario"></param> /// <returns></returns> public bool AlmacenarTFECERT(string ruta, string pass) { bool salida = true; GeneralService servicioGeneral = null; GeneralData dataGeneral = null; if (comprobarCertificado(ruta, pass)) { try { string[] borrar = consultaBorrar(); if (borrar != null) { Eliminar(borrar); } //Obtener servicio general de la compañia servicioGeneral = ProcConexion.Comp.GetCompanyService().GetGeneralService("TTFECERT"); //Apuntar a la cabecera del udo dataGeneral = servicioGeneral.GetDataInterface(GeneralServiceDataInterfaces.gsGeneralData); //Establecer los valores para las propiedades dataGeneral.SetProperty("U_RutaCer", ruta); dataGeneral.SetProperty("U_ClaveCer", pass); dataGeneral.SetProperty("U_UsuarioCer", ProcConexion.Comp.UserName); //Agregar el nuevo registro a la base de datos mediante el serivicio general servicioGeneral.Add(dataGeneral); } catch (Exception) { salida = false; } finally { if (dataGeneral != null) { //Liberar memoria utlizada por objeto dataGeneral System.Runtime.InteropServices.Marshal.ReleaseComObject(dataGeneral); System.GC.Collect(); } if (servicioGeneral != null) { //Liberar memoria utlizada por objeto servicioGeneral System.Runtime.InteropServices.Marshal.ReleaseComObject(servicioGeneral); System.GC.Collect(); } } } else { errorCertificado = true; salida = false; } return(salida); }
/// <summary> /// Almacena un nuevo registro en la tabla de CAE's /// </summary> /// <param name="comp"></param> /// <param name="cae"></param> /// <returns></returns> public bool Almacenar(CAE cae, out string idCAE) { bool resultado = false; idCAE = ""; GeneralService servicioGeneral = null; GeneralData dataGeneral = null; try { //Obtener servicio general de la compañia servicioGeneral = ProcConexion.Comp.GetCompanyService().GetGeneralService("TTFECAE"); //Apuntar a la cabecera del udo dataGeneral = servicioGeneral.GetDataInterface(GeneralServiceDataInterfaces.gsGeneralData); //Establecer los valores para las propiedades dataGeneral.SetProperty("U_TipoDoc", ((int)cae.TipoCFE).ToString()); dataGeneral.SetProperty("U_NombDoc", cae.NombreDocumento); dataGeneral.SetProperty("U_Sucursal", cae.Sucursal); dataGeneral.SetProperty("U_Caja", QuitarGuion(cae.Caja)); dataGeneral.SetProperty("U_Serie", cae.Serie.ToUpper()); dataGeneral.SetProperty("U_NumIni", cae.NumeroDesde.ToString()); dataGeneral.SetProperty("U_NumFin", cae.NumeroHasta.ToString()); dataGeneral.SetProperty("U_TipAut", cae.TipoAutorizacion); dataGeneral.SetProperty("U_NumAut", cae.NumeroAutorizacion); dataGeneral.SetProperty("U_ValDesde", cae.FechaEmision); dataGeneral.SetProperty("U_ValHasta", cae.FechaVencimiento); //Agregar el nuevo registro a la base de datos mediante el serivicio general servicioGeneral.Add(dataGeneral); //Consulta el DocEntry generado para el cae recien ingresado idCAE = ConsultarNumeroRangoCreado(cae); resultado = true; } catch (Exception) { } finally { if (dataGeneral != null) { //Liberar memoria utlizada por objeto dataGeneral System.Runtime.InteropServices.Marshal.ReleaseComObject(dataGeneral); System.GC.Collect(); } if (servicioGeneral != null) { //Liberar memoria utlizada por objeto servicioGeneral System.Runtime.InteropServices.Marshal.ReleaseComObject(servicioGeneral); System.GC.Collect(); } } return(resultado); }
/// <summary> /// Actualiza los datos de un motivo de rechazo determinado /// </summary> /// <param name="comp"></param> /// <param name="estadoCertificadoRecibido"></param> /// <returns></returns> public bool Actualizar(EstadoCertificadoRecibido estadoCertificadoRecibido) { bool resultado = false; GeneralService servicioGeneral = null; GeneralData dataGeneral = null; GeneralDataParams parametros = null; try { //Obtener servicio general de la compañia servicioGeneral = ProcConexion.Comp.GetCompanyService().GetGeneralService("TTFEESTCFER"); //Obtener lista de parametros parametros = servicioGeneral.GetDataInterface(GeneralServiceDataInterfaces.gsGeneralDataParams); //Establecer parametros parametros.SetProperty("DocEntry", estadoCertificadoRecibido.DocEntry); //Apuntar al udo que corresponde con los parametros dataGeneral = servicioGeneral.GetByParams(parametros); //Establecer los valores para las propiedades dataGeneral.SetProperty("U_Motivo", estadoCertificadoRecibido.Motivo); dataGeneral.SetProperty("U_Glosa", estadoCertificadoRecibido.Glosa); dataGeneral.SetProperty("U_Detalle", estadoCertificadoRecibido.Detalle); dataGeneral.SetProperty("U_ConsRec", estadoCertificadoRecibido.IdConsecutivo); //Agregar el nuevo registro a la base de datos mediante el serivicio general servicioGeneral.Update(dataGeneral); resultado = true; } catch (Exception) { } finally { if (servicioGeneral != null) { //Liberar memoria utlizada por objeto servicioGeneral System.Runtime.InteropServices.Marshal.ReleaseComObject(servicioGeneral); System.GC.Collect(); } if (dataGeneral != null) { //Liberar memoria utlizada por objeto dataGeneral System.Runtime.InteropServices.Marshal.ReleaseComObject(dataGeneral); System.GC.Collect(); } if (parametros != null) { //Liberar memoria utlizada por objeto parametros System.Runtime.InteropServices.Marshal.ReleaseComObject(parametros); System.GC.Collect(); } } return(resultado); }
public JsonResult AddNewAccount(AddAccountModel accountmodel) { string errMessage = string.Empty; if (ModelState.IsValid) { var validation = SecurityController.ValidateToken(accountmodel.TokenCode); try { if (validation.Validated == true) { var AccListResult = _db.Query <AccountResultModel>(";Exec Supreme_AddNewAccount @ClientID,@AccountName,@ProductID,@Address,@CityID,@CountryID,@Mobile,@OperatingModeID,@OperatorID", new { ClientID = accountmodel.ClientID, AccountName = accountmodel.AccountName, ProductID = accountmodel.ProductID, Address = accountmodel.Address, CityID = accountmodel.CityID, CountryID = accountmodel.CountryID, Mobile = accountmodel.Mobile, OperatingModeID = accountmodel.OperatingModeID, OperatorID = SecurityController.GetValidOperator(accountmodel.TokenCode).ToString() }).SingleOrDefault(); logger.LogWrite(JsonConvert.SerializeObject(accountmodel).ToString() + ":-" + JsonConvert.SerializeObject(AccListResult).ToString()); return(Json(AccListResult, JsonRequestBehavior.AllowGet)); } else { GenericResultModel AccListResult2 = new GenericResultModel(); AccListResult2.Status = "Fail"; AccListResult2.Remarks = validation.Errors[0].ToString(); logger.LogWrite(JsonConvert.SerializeObject(validation).ToString()); return(Json(AccListResult2, JsonRequestBehavior.AllowGet)); } } catch (Exception ee) { GenericResultModel AccListResult2 = new GenericResultModel(); AccListResult2.Status = "Fail"; AccListResult2.Remarks = ee.Message; GeneralService.WriteErrorLog(ref ee); return(Json(AccListResult2, JsonRequestBehavior.AllowGet)); } } else { var message = string.Join(" | ", ModelState.Values .SelectMany(v => v.Errors) .Select(e => e.ErrorMessage)); GenericResultModel AccListResult2 = new GenericResultModel(); AccListResult2.Status = "Fail"; AccListResult2.Remarks = message; return(Json(AccListResult2, JsonRequestBehavior.AllowGet)); } }
public JsonResult LoanProcessing(ProcessLoanModel loanmodel) { string errMessage = string.Empty; if (ModelState.IsValid) { var validation = SecurityController.ValidateToken(loanmodel.TokenCode); try { if (validation.Validated == true) { var AccListResult = _db.Query <LoanProcessResultModel>(";Exec Supreme_ProcessNewLoan @ClientID,@ProductID,@LoanAmount,@LoanTerm,@InterestRate,@LoanPeriodID,@PurposeCodeID,@CreditOfficerID,@Remarks,@OperatorID", new { ClientID = loanmodel.ClientID, ProductID = loanmodel.ProductID, LoanAmount = loanmodel.LoanAmount, LoanTerm = loanmodel.LoanTerm, InterestRate = loanmodel.InterestRate, LoanPeriodID = loanmodel.LoanPeriodID, PurposeCodeID = loanmodel.PurposeCodeID, CreditOfficerID = loanmodel.CreditOfficerID, Remarks = loanmodel.Remarks, OperatorID = SecurityController.GetValidOperator(loanmodel.TokenCode).ToString()//loanmodel.OperatorID }).SingleOrDefault(); logger.LogWrite(JsonConvert.SerializeObject(loanmodel).ToString()); return(Json(AccListResult, JsonRequestBehavior.AllowGet)); } else { GenericResultModel AccListResult2 = new GenericResultModel(); AccListResult2.Status = "Fail"; AccListResult2.Remarks = validation.Errors[0].ToString(); logger.LogWrite(JsonConvert.SerializeObject(validation).ToString()); return(Json(AccListResult2, JsonRequestBehavior.AllowGet)); } } catch (Exception ee) { GenericResultModel AccListResult2 = new GenericResultModel(); AccListResult2.Status = "Fail"; AccListResult2.Remarks = ee.Message; GeneralService.WriteErrorLog(ref ee); return(Json(AccListResult2, JsonRequestBehavior.AllowGet)); } } else { var message = string.Join(" | ", ModelState.Values .SelectMany(v => v.Errors) .Select(e => e.ErrorMessage)); GenericResultModel AccListResult2 = new GenericResultModel(); AccListResult2.Status = "Fail"; AccListResult2.Remarks = message; return(Json(AccListResult2, JsonRequestBehavior.AllowGet)); } }
public IHttpActionResult enviarRecordatorio(RecordatorioDTO param) { GeneralService serv = new GeneralService(); serv.enviarRecordatorioTerapiaSms(param.nroTelefono, param.fecha, param.terapista, param.sala); //serv.enviarRecordatorioTerapiaEmail(); return(Ok()); }
/// <summary> /// Actualiza la configuracion de ejecucion del reporte diario /// </summary> /// <param name="confRptd"></param> /// <returns></returns> private bool Actualizar(ConfRptd confRptd, string docEntry) { bool salida = false; GeneralService servicioGeneral = null; GeneralData dataGeneral = null; GeneralDataParams parametros = null; try { //Obtener servicio general de la compañia servicioGeneral = ProcConexion.Comp.GetCompanyService().GetGeneralService("TTCRPTD"); //Apuntar a la cabecera del udo dataGeneral = servicioGeneral.GetDataInterface(GeneralServiceDataInterfaces.gsGeneralData); parametros = servicioGeneral.GetDataInterface(GeneralServiceDataInterfaces.gsGeneralDataParams); //Establecer parametros parametros.SetProperty("DocEntry", docEntry); //Apuntar al udo que corresponde con los parametros dataGeneral = servicioGeneral.GetByParams(parametros); //Establecer los valores para las propiedades dataGeneral.SetProperty("U_DiaE", confRptd.DiaEjecucion); dataGeneral.SetProperty("U_Modo", confRptd.ModoEjecucion); dataGeneral.SetProperty("U_SecEnv", confRptd.SecuenciaEnvio); dataGeneral.SetProperty("U_CAE_General", confRptd.CAEGenerico); dataGeneral.SetProperty("U_AutoGenerar", confRptd.AutoGenerar); dataGeneral.SetProperty("U_HoraEjecucion", confRptd.HoraEjec); dataGeneral.SetProperty("U_DiaEFinal", confRptd.DiaFin); //Agregar el nuevo registro a la base de datos mediante el servicio general servicioGeneral.Update(dataGeneral); salida = true; } catch (Exception) { } finally { if (dataGeneral != null) { //Liberar memoria utlizada por objeto dataGeneral System.Runtime.InteropServices.Marshal.ReleaseComObject(dataGeneral); System.GC.Collect(); } if (servicioGeneral != null) { //Liberar memoria utlizada por objeto servicioGeneral System.Runtime.InteropServices.Marshal.ReleaseComObject(servicioGeneral); System.GC.Collect(); } } return(salida); }
/// <summary> /// Metodo para actualizar los datos de correo electronico /// </summary> /// <param name="comp"></param> /// <returns></returns> private bool actualizarCorreoElectronico(Correo correo, string entry) { bool resultado = false; GeneralService servicioGeneral = null; GeneralData dataGeneral = null; GeneralDataParams parametros = null; try { //Obtener servicio general de la compañia servicioGeneral = ProcConexion.Comp.GetCompanyService().GetGeneralService("TTECA"); //Obtener lista de parametros parametros = servicioGeneral.GetDataInterface(GeneralServiceDataInterfaces.gsGeneralDataParams); //Establecer parametros parametros.SetProperty("DocEntry", entry); //Apuntar al udo que corresponde con los parametros dataGeneral = servicioGeneral.GetByParams(parametros); //Establecer los valores para las propiedades dataGeneral.SetProperty("U_Correo", correo.Cuenta); dataGeneral.SetProperty("U_Clave", correo.Clave); dataGeneral.SetProperty("U_Opcion", correo.Opcion); //Agregar el nuevo registro a la base de datos mediante el servicio general servicioGeneral.Update(dataGeneral); resultado = true; } catch (Exception) { } finally { if (parametros != null) { //Liberar memoria utlizada por parametros System.Runtime.InteropServices.Marshal.ReleaseComObject(parametros); System.GC.Collect(); } if (dataGeneral != null) { //Liberar memoria utlizada por dataGeneral System.Runtime.InteropServices.Marshal.ReleaseComObject(dataGeneral); System.GC.Collect(); } if (servicioGeneral != null) { //Liberar memoria utlizada por objeto servicioGeneral System.Runtime.InteropServices.Marshal.ReleaseComObject(servicioGeneral); System.GC.Collect(); } } return(resultado); }
/// <summary> /// Actualiza los datos del emisor de factura electronica en la base de datos /// </summary> /// <param name="comp"></param> /// <param name="emisor"></param> /// <returns></returns> public bool Actualizar(Emisor emisor) { bool resultado = false; GeneralService servicioGeneral = null; GeneralData dataGeneral = null; GeneralDataParams parametros = null; try { //Obtener servicio general de la compañia servicioGeneral = ProcConexion.Comp.GetCompanyService().GetGeneralService("TTFEEMI"); //Obtener lista de parametros parametros = servicioGeneral.GetDataInterface(GeneralServiceDataInterfaces.gsGeneralDataParams); //Establecer parametros parametros.SetProperty("DocEntry", 1); //Apuntar al udo que corresponde con los parametros dataGeneral = servicioGeneral.GetByParams(parametros); dataGeneral.SetProperty("U_Ruc", emisor.Ruc.ToString()); dataGeneral.SetProperty("U_Nombre", emisor.Nombre); dataGeneral.SetProperty("U_NombreC", emisor.NombreComercial); dataGeneral.SetProperty("U_NumRes", emisor.NumeroResolucion); //Agregar el nuevo registro a la base de datos mediante el servicio general servicioGeneral.Update(dataGeneral); resultado = true; } catch (Exception) { } finally { if (parametros != null) { //Liberar memoria utlizada por el objeto parametros System.Runtime.InteropServices.Marshal.ReleaseComObject(parametros); System.GC.Collect(); } if (dataGeneral != null) { //Liberar memoria utlizada por el objeto dataGeneral System.Runtime.InteropServices.Marshal.ReleaseComObject(dataGeneral); System.GC.Collect(); } if (servicioGeneral != null) { //Liberar memoria utlizada por el objeto servicioGeneral System.Runtime.InteropServices.Marshal.ReleaseComObject(servicioGeneral); System.GC.Collect(); } } return(resultado); }
public JsonResult AddCashTrx(CashTrxAddModel addcashTrxmodel) { string errMessage = string.Empty; if (ModelState.IsValid) { var validation = SecurityController.ValidateToken(addcashTrxmodel.TokenCode); try { if (validation.Validated == true) { var AccListResult = _db.Query <TrfResultModel>(";Exec Supreme_AddCashTrx @AccountTypeID, @AccountID, @TrxAmount, @Narration, @RefNumber,@OperatorID,@TrxTypeID", new { AccountTypeID = addcashTrxmodel.AccountTypeID, AccountID = addcashTrxmodel.AccountID, TrxAmount = addcashTrxmodel.TrxAmount, Narration = addcashTrxmodel.Narration, RefNumber = addcashTrxmodel.RefNumber, OperatorID = SecurityController.GetValidOperator(addcashTrxmodel.TokenCode).ToString(), TrxTypeID = addcashTrxmodel.TrxTypeID }).SingleOrDefault(); logger.LogWrite(JsonConvert.SerializeObject(addcashTrxmodel).ToString()); return(Json(AccListResult, JsonRequestBehavior.AllowGet)); } else { GenericResultModel AccListResult2 = new GenericResultModel(); AccListResult2.Status = "Fail"; AccListResult2.Remarks = validation.Errors[0].ToString(); logger.LogWrite(JsonConvert.SerializeObject(validation).ToString()); return(Json(AccListResult2, JsonRequestBehavior.AllowGet)); } } catch (Exception ee) { GenericResultModel AccListResult2 = new GenericResultModel(); AccListResult2.Status = "Fail"; AccListResult2.Remarks = ee.Message; GeneralService.WriteErrorLog(ref ee); return(Json(AccListResult2, JsonRequestBehavior.AllowGet)); } } else { var message = string.Join(" | ", ModelState.Values .SelectMany(v => v.Errors) .Select(e => e.ErrorMessage)); GenericResultModel AccListResult2 = new GenericResultModel(); AccListResult2.Status = "Fail"; AccListResult2.Remarks = message; return(Json(AccListResult2, JsonRequestBehavior.AllowGet)); } //return Json(UserListResult, JsonRequestBehavior.AllowGet); }
/// <summary> /// Actualiza los datos de un tipo de documento a conservar determinado /// </summary> /// <param name="comp"></param> /// <param name="cae"></param> /// <param name="numeroRegistro"></param> /// <returns></returns> public bool Actualizar(CAE cae, string numeroRegistro) { bool resultado = false; GeneralService servicioGeneral = null; GeneralData dataGeneral = null; GeneralDataParams parametros = null; try { //Obtener servicio general de la compañia servicioGeneral = ProcConexion.Comp.GetCompanyService().GetGeneralService("TTFETDCON"); //Obtener lista de parametros parametros = servicioGeneral.GetDataInterface(GeneralServiceDataInterfaces.gsGeneralDataParams); //Establecer parametros parametros.SetProperty("DocEntry", numeroRegistro); //Apuntar al udo que corresponde con los parametros dataGeneral = servicioGeneral.GetByParams(parametros); //Establecer los valores para las propiedades dataGeneral.SetProperty("U_TipoDoc", ((int)cae.TipoCFE).ToString()); dataGeneral.SetProperty("U_NombDoc", cae.NombreDocumento); dataGeneral.SetProperty("U_IndCon", cae.IndicadorConservar); //Agregar el nuevo registro a la base de datos mediante el serivicio general servicioGeneral.Update(dataGeneral); resultado = true; } catch (Exception) { } finally { if (parametros != null) { //Liberar memoria utlizada por el objeto parametros System.Runtime.InteropServices.Marshal.ReleaseComObject(parametros); System.GC.Collect(); } if (dataGeneral != null) { //Liberar memoria utlizada por el objeto dataGeneral System.Runtime.InteropServices.Marshal.ReleaseComObject(dataGeneral); System.GC.Collect(); } if (servicioGeneral != null) { //Liberar memoria utlizada por el objeto servicioGeneral System.Runtime.InteropServices.Marshal.ReleaseComObject(servicioGeneral); System.GC.Collect(); } } return(resultado); }
/// <summary> /// Add new bom version /// </summary> private void AddBomVer(ref Recordset oRecBomVer, ref GeneralService oGeneralService, ref bool bubbleEvent, out string versionCode) { SAPbobsCOM.GeneralData oGeneralData; SAPbobsCOM.CompanyService sCmp; SAPbobsCOM.GeneralDataCollection oSons; SAPbobsCOM.GeneralData oSon; sCmp = oSBOCompany.GetCompanyService(); oGeneralService = sCmp.GetGeneralService("BOMVER"); oGeneralData = oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralData); oSons = oGeneralData.Child("SOL_BOMVER_D"); versionCode = string.Empty; try { // Specify data for main UDO versionCode = GenerateBomVersion(oRecBomVer.Fields.Item("ItemCode").Value); oGeneralData.SetProperty("U_SOL_ITEMCODE", oRecBomVer.Fields.Item("ItemCode").Value); oGeneralData.SetProperty("U_SOL_ITEMNAME", oRecBomVer.Fields.Item("ItemName").Value); oGeneralData.SetProperty("U_SOL_ITMGRPCOD", oRecBomVer.Fields.Item("ItmsGrpCod").Value); oGeneralData.SetProperty("U_SOL_ITEMGROUP", oRecBomVer.Fields.Item("ItmsGrpNam").Value); oGeneralData.SetProperty("U_SOL_BOMTYPE", oRecBomVer.Fields.Item("BomType").Value); oGeneralData.SetProperty("U_SOL_VERSION", versionCode); oGeneralData.SetProperty("U_SOL_PLANQTY", oRecBomVer.Fields.Item("PlanQty").Value); oGeneralData.SetProperty("U_SOL_POSTDATE", DateTime.Now.Date); oGeneralData.SetProperty("U_SOL_STATUS", "A"); oGeneralData.SetProperty("U_SOL_WHSCODE", oRecBomVer.Fields.Item("ToWH").Value); oGeneralData.SetProperty("U_SOL_REMARK", "Created by Add-On Update Bom Version"); while (!oRecBomVer.EoF) { oSon = oSons.Add(); oSon.SetProperty("U_SOL_TYPE", oRecBomVer.Fields.Item("Type").Value); oSon.SetProperty("U_SOL_ITEMCODE", oRecBomVer.Fields.Item("ItemCodeComp").Value); oSon.SetProperty("U_SOL_ITEMNAME", GetItemName(oRecBomVer.Fields.Item("ItemCodeComp").Value)); oSon.SetProperty("U_SOL_QTY", oRecBomVer.Fields.Item("Quantity").Value); oSon.SetProperty("U_SOL_WHSCODE", oRecBomVer.Fields.Item("Warehouse").Value); oSon.SetProperty("U_SOL_UOM", oRecBomVer.Fields.Item("Uom").Value); oSon.SetProperty("U_SOL_METHOD", oRecBomVer.Fields.Item("IssueMthd").Value); oRecBomVer.MoveNext(); } oGeneralService.Add(oGeneralData); } catch (Exception ex) { bubbleEvent = false; oSBOApplication.MessageBox(ex.Message); } finally { Utils.releaseObject(oGeneralData); Utils.releaseObject(sCmp); Utils.releaseObject(oSons); } }
public HorseService(GeneralService generalService) { _generalService = generalService; }
public JokeyService(GeneralService generalService) { _generalService = generalService; }
public RaceService(GeneralService generalService) { _generalService = generalService; }