コード例 #1
0
 public DataSet GetAll_paginacion(string empresaid, tb_ad_movimientostarj BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd = new SqlCommand("", cnx))
         {
             DataSet ds = new DataSet();
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.Add("@moduloid", SqlDbType.Char, 4).Value = BE.moduloid;
                 cmd.Parameters.Add("@local", SqlDbType.Char, 3).Value = BE.local;
                 cmd.Parameters.Add("@tipodoc", SqlDbType.Char, 2).Value = BE.tipodoc;
                 cmd.Parameters.Add("@serdoc", SqlDbType.Char, 4).Value = BE.serdoc;
                 cmd.Parameters.Add("@numdoc", SqlDbType.Char, 10).Value = BE.numdoc;
                 cmd.Parameters.Add("@posicion", SqlDbType.VarChar, 10).Value = BE.posicion;
             }
             try
             {
                 cnx.Open();
                 using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                 {
                     da.Fill(ds);
                 }
                 return ds;
             }
             catch (Exception ex)
             {
                 throw new Exception(ex.Message);
             }
         }
     }
 }
コード例 #2
0
 public bool Delete(string empresaid, tb_ad_movimientostarj BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd = new SqlCommand("", cnx))
         {
             {
                 //cmd.CommandType = CommandType.StoredProcedure;
                 //cmd.Parameters.Add("@moduloid", SqlDbType.Char, 4).Value = BE.moduloid;
                 //cmd.Parameters.Add("@colorid", SqlDbType.Char, 3).Value = BE.colorid;
             }
             try
             {
                 cnx.Open();
                 if (cmd.ExecuteNonQuery() > 0)
                 {
                     return true;
                 }
                 else
                 {
                     return false;
                 }
             }
             catch (Exception ex)
             {
                 throw new Exception(ex.Message);
             }
         }
     }
 }
コード例 #3
0
 public bool Update(string empresaid, tb_ad_movimientostarj BE)
 {
     return tablaDA.Update(empresaid, BE);
 }
コード例 #4
0
 public bool Insert(string empresaid, tb_ad_movimientostarj BE)
 {
     return tablaDA.Insert(empresaid, BE);
 }
コード例 #5
0
 public DataSet GetReport(string empresaid, tb_ad_movimientostarj BE)
 {
     return tablaDA.GetReport(empresaid, BE);
 }
コード例 #6
0
 public DataSet GetAll_paginacion(string empresaid, tb_ad_movimientostarj BE)
 {
     return tablaDA.GetAll_paginacion(empresaid, BE);
 }
コード例 #7
0
        private void data_TablaTarjetas()
        {
            try
            {
                var BL = new tb_ad_movimientostarjBL();
                var BE = new tb_ad_movimientostarj();
                var dt = new DataTable();
                BE.moduloid = modulo;
                BE.local = local;
                BE.tipodoc = tipodoc.SelectedValue.ToString().Trim();
                BE.serdoc = serdoc.Text.Trim().PadLeft(4, '0');
                BE.numdoc = numdoc.Text.Trim().PadLeft(6, '0');

                dt = BL.GetAll(EmpresaID, BE).Tables[0];

                foreach (DataRow fila in dt.Rows)
                {
                    row = TablaTarjetas.NewRow();
                    row["tarjetaid"] = fila["tarjetaid"].ToString();
                    row["tarjetaimpo"] = fila["tarjimporte"].ToString();
                    row["tarjetanume"] = fila["tarjnumoper"].ToString().Trim();
                    row["tarjetaname"] = fila["tarjetaname"].ToString().Trim();
                    row["tarjetalogo"] = fila["tarjetalogo"];
                    TablaTarjetas.Rows.Add(row);
                }
                dgbtarjetas.DataSource = TablaTarjetas;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #8
0
 public DataSet GetReport(string empresaid, tb_ad_movimientostarj BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd = new SqlCommand("", cnx))
         {
             DataSet ds = new DataSet();
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 //cmd.Parameters.Add("@moduloid", SqlDbType.Char, 4).Value = BE.moduloid;
                 //cmd.Parameters.Add("@colorid", SqlDbType.Char, 3).Value = BE.colorid;
             }
             try
             {
                 cnx.Open();
                 using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                 {
                     da.Fill(ds);
                 }
                 return ds;
             }
             catch (Exception ex)
             {
                 throw new Exception(ex.Message);
             }
         }
     }
 }