Example #1
0
        public static ResultadoTransaccion AsignarTomaDesicionTargetAccount(Int64 IdTargetAccount, clsTargetAccountTomaDesiciones tomadesicion, SqlConnection conn, SqlTransaction transaction)
        {
            ResultadoTransaccion res = new ResultadoTransaccion();

            try
            {
                objParams = SqlHelperParameterCache.GetSpParameterSet(conn, "SP_N_CLIENTES_TARGET_ACCOUNT_TOMADESICIONES");
                objParams[0].Value = IdTargetAccount;
                objParams[1].Value = tomadesicion.Nombre;
                SqlCommand command4 = new SqlCommand("SP_N_CLIENTES_TARGET_ACCOUNT_TOMADESICIONES", conn);
                command4.Transaction = transaction;
                command4.Parameters.AddRange(objParams);
                command4.CommandType = CommandType.StoredProcedure;
                command4.ExecuteNonQuery();

                res.Estado = Enums.EstadoTransaccion.Aceptada;

            }
            catch (Exception ex)
            {
                res.Estado = Enums.EstadoTransaccion.Rechazada;
                res.Descripcion = ex.Message;
                Log.EscribirLog(ex.Message);
            }
            return res;
        }
Example #2
0
        private void AgregarTomaDesiciones()
        {
            clsTargetAccountTomaDesiciones desicion = new clsTargetAccountTomaDesiciones();

                        desicion.Nombre = txtNombreTomaDesiciones.Text.Trim();

                        List<clsTargetAccountTomaDesiciones> desicioneslista = new List<clsTargetAccountTomaDesiciones>(TargetAccount.TomaDesiciones);
                        clsTargetAccountTomaDesiciones foo = desicioneslista.Find(delegate(clsTargetAccountTomaDesiciones var)
                        {
                            return var.Nombre.ToUpper().Trim() ==
                                   desicion.Nombre.ToUpper().Trim();
                        });

                        if (foo != null)
                        {
                            dxErrorProvider1.SetError(txtNombreTomaDesiciones, "El Nombre '" + desicion.Nombre + "' ya esta ingresado", ErrorType.Critical);
                            return;
                        }

                        TargetAccount.TomaDesiciones.Add(desicion);

                        lstTomanDesiciones.ValueMember = "Id";
                        lstTomanDesiciones.DisplayMember = "Nombre";
                        lstTomanDesiciones.DataSource = TargetAccount.TomaDesiciones;
                        lstTomanDesiciones.Refresh();

                        txtNombreTomaDesiciones.Text = "";
                        dxErrorProvider1.ClearErrors();
        }
Example #3
0
        public static IList<clsTargetAccountTomaDesiciones> ObtenerTomaDesicionesTargetAccount(Int64 IdTargetAccount)
        {
            IList<clsTargetAccountTomaDesiciones> listado = new List<clsTargetAccountTomaDesiciones>();
            clsTargetAccountTomaDesiciones desicion = null;
            try
            {

                objParams = SqlHelperParameterCache.GetSpParameterSet(BaseDatos.NuevaConexion(), "SP_C_CLIENTES_TARGET_ACCOUNT_TOMADESICIONES");
                objParams[0].Value = IdTargetAccount;

                DataSet ds = SqlHelper.ExecuteDataset(BaseDatos.NuevaConexion(), CommandType.StoredProcedure, "SP_C_CLIENTES_TARGET_ACCOUNT_TOMADESICIONES", objParams);

                if (ds != null && ds.Tables.Count > 0)
                {
                    foreach (DataRow item in ds.Tables[0].Rows)
                    {
                        desicion = new clsTargetAccountTomaDesiciones();
                        desicion.Id = Convert.ToInt64(item["Id"]);
                        desicion.Nombre = item["Descripcion"].ToString();

                        listado.Add(desicion);
                    }
                }
            }
            catch (Exception ex)
            {
                Base.Log.Log.EscribirLog(ex.Message);
            }
            finally
            {
                BaseDatos.CerrarNuevaCOnexion();
            }

            return listado;
        }