public InitData() { obj = db_ZohoToken.Detalles("api-modules"); Cliente_id = obj.Client_ID; Client_Secret = obj.Client_Secret; }
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- public void Borrar(ZohoToken ZohoToken, bool Tran = false) { string[] ObjParameter = new string[2]; ObjParameter[0] = ZohoToken.ID; try { this.InicializarMensajeError(); this.OpenSqlBD(); SqlCommand cmd = new SqlCommand(); cmd = this.ConfigurarComando(TieneTransaccion.Si, "sp_del_Remisiones", ObjParameter); cmd.ExecuteNonQuery(); if (Tran == false) { Commit(); } } catch (Exception ex) { this.CodigoError = -1; if (Tran == false) { Rollback(); } XtraMsg(ex.Message, MessageBoxIcon.Error); } finally { if (Tran == false) { CloseSqlBD(); } } }
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- public static ZohoToken Detalles(string Id) { DataTable dt = ObtieneDatos("sp_sel_ZohoToken", Id); ZohoToken det = new ZohoToken(); if (dt.Rows.Count > 0) { det.ID = dt.Rows[0]["ID"].ToString(); det.Empresa = dt.Rows[0]["Empresa"].ToString(); det.Nombre = dt.Rows[0]["Nombre"].ToString(); det.Client_ID = dt.Rows[0]["Client_ID"].ToString(); det.Client_Secret = dt.Rows[0]["Client_Secret"].ToString(); det.Redirect_Uri = dt.Rows[0]["Redirect_Uri"].ToString(); det.Code = dt.Rows[0]["Code"].ToString(); } return(det); }
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- public void Actualizar(ZohoToken ZohoToken, bool Tran = false) { string[] ObjParameter = new string[6]; ObjParameter[0] = ZohoToken.ID; ObjParameter[1] = ZohoToken.Empresa; ObjParameter[2] = ZohoToken.Nombre; ObjParameter[3] = ZohoToken.Client_ID; ObjParameter[4] = ZohoToken.Client_Secret; ObjParameter[5] = ZohoToken.Redirect_Uri; ObjParameter[6] = ZohoToken.Code; try { this.InicializarMensajeError(); this.OpenSqlBD(); SqlCommand cmd = new SqlCommand(); cmd = this.ConfigurarComando(TieneTransaccion.Si, "sp_upd_ZohoToken", ObjParameter); cmd.ExecuteNonQuery(); if (Tran == false) { Commit(); } } catch (Exception ex) { this.CodigoError = -1; if (Tran == false) { Rollback(); } XtraMsg(ex.Message, MessageBoxIcon.Error); } finally { if (Tran == false) { CloseSqlBD(); } } }